Open madakk opened 7 years ago
I was able to reproduce on Atom v1.13.0 on Mac OS X 10.12.2.
Same on 1.30.0 x64 with plain text and:
"*":
editor:
autoIndent: false
autoIndentOnPaste: false
normalizeIndentOnPaste: false
Also, similarly:
a
b
c
d
Copy 'd' to after 'b' and you get:
a
b
d
c
d
When you were expecting:
a
b
d
c
d
And the obligatory gif:
Super annoying!
Related forum post (comes with animated examples):
Copy/paste indent wrong: How to fix?
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:
Config settings:
editor:
autoIndent: false
autoIndentOnPaste: false
normalizeIndentOnPaste: false
System info:
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?
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.
Note that this issue is marked as a bug.
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.)
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.
Oooh, nice find! I had not even considered CMD + SHIFT + V!
I just added this to my keymap.cson
:
'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!
For non-mac folks, I put this:
'atom-workspace':
'ctrl-v': 'editor:paste-without-reformatting'
into my keymap.cson file, and it worked! Atom is finally doing the sane thing! @mhulse Thanks guys!
I still don't really get why it's the default behavior - I can kinda get what they were going for (by copying the relative addition of a tab from the previous line, it could technically make nesting easier/faster) ... but it seems like that would be useful far less often than the default behavior used by every other text editor, but eh. Not an issue for me anymore.
Prerequisites
Description
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%
Versions
Atom : 1.12.7 Electron: 1.3.13 Chrome : 52.0.2743.82 Node : 6.5.0
apm 1.12.9 npm 3.10.5 node 4.4.5 python git visual studio 2013
Windows 8.1
Additional Information