Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Paste indentation issue with auto-indent off #13505
Paste apparently takes the current indentation into account, even when Auto Indent and Auto Indent On Paste are off. This happens in any grammar, including plain text.
Steps to Reproduce
Expected behavior: The result should be:
Actual behavior: The result is:
Reproduces how often: 100%
Atom : 1.12.7
Related forum post (comes with animated examples):
I run into this issue pretty regularly and always find it annoying as the behavior is different from any other editors I've used. In my humble opinion, it's not intuitive.
Anyway, not sure if it will help, but here's some comparisons:
Sublime Text 3.1.1
Visual Studio Code 1.27.2
editor: autoIndent: false autoIndentOnPaste: false normalizeIndentOnPaste: false
Atom : 1.30.0 Electron: 2.0.5 Chrome : 61.0.3163.100 Node : 8.9.3
I am having the same issue on Atom 1.32.1 on Mac OSX
This behavior makes no sense to me, I can't even build a good mental model of what it's doing after scanning the linked forum post.
If I have all the "smart auto clever indent" things off, I want "paste" to paste exactly the characters that I have just copied. How can I accomplish that?
I could be wrong, but I don't think you can at this time. :(
Note that this issue is marked as a bug.
Now, we either wait for someone to fix or try to do a PR.
Alternative would be to write a plugin, but at that point, time might be better spent trying to patch Atom’s core code.
I wish I had a better answer.
Ah, thanks for pointing that out. I got a serious whiff of "Will Not Fix, Working As Intended" from the forum thread (even though the person there technically was not speaking for the dev team)
for reference - I just tried "Command-SHIFT-V" instead of "Command-V" on a whim and it worked (i.e. it just pastes exactly what I had copied). In a way, that's sort of the opposite of what Command-SHIFT-V ("paste without formatting") usually does in rich-text editors, but whatever.
(also, based on the PR that implemented that functionality, the relevant option seems to be options.preserveTrailingLineIndentation; maybe I'll try to figure out how to expose/control that in my copious free time. That or go back to TextMate.)
Oooh, nice find! I had not even considered CMD + SHIFT + V!
I just added this to my
'atom-workspace': 'cmd-v': 'editor:paste-without-reformatting'
Not fully tested in numerous situation, but appears to fix the copy/paste issue.
Interesting ... Good find @yanamal!