Implement 'neoterm_bracketed_paste' option. #296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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"
andneoterm_repl_python
equal to"ipython"
and"python"
. In every one of them I executeTREPLSendFile
,TREPLSendSelection
, andTREPLSendLine
: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 givesSyntaxError: 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.