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

REPL: :paste should not interpret TAB #9336

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

REPL: :paste should not interpret TAB #9336

scabug opened this issue May 28, 2015 · 5 comments

Comments

@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
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
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
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
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
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

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

No branches or pull requests

2 participants