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

Implement 'neoterm_bracketed_paste' option. #296

Merged
merged 1 commit into from
Jul 26, 2020
Merged

Implement 'neoterm_bracketed_paste' option. #296

merged 1 commit into from
Jul 26, 2020

Conversation

echasnovski
Copy link
Contributor

This PR is a suggestion for #295 solution. It introduces g:neoterm_bracketed_paste setting: value 0 (default) disables bracketed paste (which is exactly the current situation), value 1 enables it.

Here are (many) examples of how this setting works with neoterm_repl_r equal to "radian" and "r" and neoterm_repl_python equal to "ipython" and "python". In every one of them I execute TREPLSendFile, TREPLSendSelection, and TREPLSendLine:

Examples
radian Bracketed paste enabled (everything works):
Bracketed paste disabled (only sending single line works with default radian settings):
R Bracketed paste enabled (everything works):
Bracketed paste disabled (everything works; notice that every line is executed sequentially because '+' is present at its beginning):
ipython Bracketed paste enabled (everything works):
Bracketed paste disabled (only sending single line works; notice in terminal buffer extra indentation inside function body):
python Bracketed paste enabled (only sending single line works because Python gives SyntaxError: multiple statements found while compiling a single statement):
Bracketed paste disabled (everything works):

To sum up, when this setting is on, Neoterm can send multiline code to radian, R, and ipython, but not plain Python (because it can't compile multiple statements).

@kassio, I would really like this PR to be merged, as this seems to be a very crucial addition. If you give green light here (code is correct, names are appropriate), I'll update 'CHANDELOG.md' and 'neoterm.txt' (please, show the place where this setting should go and if there is any extra information you would like me to put there). Thanks.

@strboul
Copy link
Contributor

strboul commented Jul 26, 2020

Great @echasnovski you've picked this up. I tried your version (steps explained here) on mac OS Mojave and it seems to work well with radian. There's a disturbance that the echoed text after :TREPLSend* displays the escape sequences. It'd be nice if there's a way to remove them.

Screenshot 2020-07-26 at 15 17 43

@echasnovski
Copy link
Contributor Author

@strboul, thanks for additional testing.

Yes, those echoing escape characters are somewhat disturbing, but I currently don't have any idea of how to remove them. I am even not really sure about the purpose of this echoing (if this is "a bug or a feature"), as it is also present in main version.

@kassio kassio merged commit f4399a0 into kassio:master Jul 26, 2020
@echasnovski
Copy link
Contributor Author

Thanks, @kassio. How about updating changelog and documentation?

@kassio
Copy link
Owner

kassio commented Jul 26, 2020

@echasnovski, ooopsss.. Can you add another pull request, please?

@echasnovski
Copy link
Contributor Author

@echasnovski, ooopsss.. Can you add another pull request, please?

@kassio, no problem. Created #297.

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.

3 participants