Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Conjure ignores ; in Julia #416 #435

Merged
merged 4 commits into from
Nov 12, 2022
Merged

Conversation

usmcamp0811
Copy link

@usmcamp0811 usmcamp0811 commented Nov 2, 2022

Since the Julia REPL we are using doesn't care about ; this is a "duct tape-y" solution that uses regex to match a ; at the end of the line and replace it with ; nothing; which will ultimately suppress the output of the given line.

As stated in the discord channel this works if you eval the entire line manually. <localleader>ee will not send the ; to the REPL for evaluation.

relates #416
relates #380

@Olical
Copy link
Owner

Olical commented Nov 6, 2022

So to clarify, if you use ,ee it still won't pick up ; even with this change, so you need to remember to eval the whole line if you want to have ; work, even after this change.

Because this changes ; from not working at all to working if you eval the line with a visual selection? If so I can tweak this a little further and try to get the tree sitter integration to include ; in Julia. Happy to have a go at that if this solves the "sending a ;" problem.

@usmcamp0811
Copy link
Author

correct ,ee will NOT send the ;. The only way I can get it to send the ; is to select and eval all the code to include the ;. I made a mapping V :'<,'>ConjureEval<cr> to select the whole line and eval it.

I tried playing with treesitter some and it didn't seem like it was ever selecting the ;.

I did have one idea that if I could find the treesitter function that return the range that code existed we could then just do a simple check to see if the next character is a ;.

@Olical Olical merged commit 0b5e36a into Olical:develop Nov 12, 2022
@Olical
Copy link
Owner

Olical commented Nov 12, 2022

I like it! Merged, will have a look at the treesitter stuff myself too. If it really won't EVER capture a ; then yeah I agree with your idea, we should check the text for a trailing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants