Paste indentation issue with auto-indent off


#1

I’m experiencing some issue with indentation and paste, which happens even when Auto Ident and Auto Indent On Paste are both off. I’m hoping someone can shed some light on this.

This can even be seen on a plain-text file. Simply type something like the following:

a
	b
		c

Then copy the from (and including) the new-line at the end of the first line, upto the end of the second line. Go to the end of the third line, and paste. The output is:

a
	b
		c
			b

While the expected output is:

a
	b
		c
	b

For the sake of discussion my editor is set to Soft Tabs off and to a Tab Length of 4, but the same behavior reproduces with Soft Tabs on and a Tab Length of 2. I’d expect the editor to not do any indentation manipulation when Auto Indent and Auto Indent On Paste are off, and to just work the same way a plain editor like Notepad would (in which I would get my expected behavior).

Update: opened https://github.com/atom/atom/issues/13505