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

REPL: :paste should not interpret TAB #9336

Closed
scabug opened this Issue May 28, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@scabug
Copy link

scabug commented May 28, 2015

Pasting code with :paste fails when TAB's are present.
TABS are (very) common characters in code and should be anticipated and handled correctly by :paste (I.e. ignored/ not invoking completion)
If :paste with code containing TABS does not fail the paste is very slow.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented May 28, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9336?orig=1
Reporter: Jasper Mackenzie (SpmP)
Affected Versions: 2.10.4

@scabug

This comment has been minimized.

Copy link
Author

scabug commented May 29, 2015

@som-snytt said (edited on Feb 2, 2016 6:47:58 AM UTC):
JLine handles the tab for completion, but "42.\ttoString" has the same result both at the prompt and in paste mode. It erroneously detects completion.

scala> :pa
// Entering paste mode (ctrl-D to finish)

42.
%   +   >    >>>            isInstanceOf   toDouble   toLong     unary_+   |   
&   -   >=   ^              toByte         toFloat    toShort    unary_-       
*   /   >>   asInstanceOf   toChar         toInt      toString   unary_~       
42.toString

// Exiting paste mode, now interpreting.

res0: String = 42

Didn't JLine try to detect pasted tabs?

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 21, 2016

Valentin Tihhomirov (intellij) said:
Yes, probably there should be some hotkey for disabling/re-enabling the autocompletion and :paste mode would force it temporarily.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 21, 2016

Valentin Tihhomirov (intellij) said:
Alternatively, some environments use Ctrl+Space to open autocompletion. Probably you can replace Tab with Ctrl+Space as well, if this reduces the chance of this combination in the ascii stream.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 21, 2016

@som-snytt said (edited on Jun 21, 2016 4:27:45 PM UTC):
It works for interpreter.jline.InteractiveReader to

reader setCopyPasteDetection true

scala/scala#5240

@scabug scabug closed this Dec 16, 2016

@scabug scabug added this to the 2.11.9 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment