You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
If I've selected a block of ruby that is indented and then paste it on a line that is blank (no with #1407
If I've selected a block of ruby that is indented and then paste it on a line that is blank (no with no spaces on it), the lines are inserted with no indentation in front of them, instead of the indendation of the line above.
I have to hit "tab" before pasting if I want to get it to line up with everything else.
Atom Version: 0.44.0
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Atom/0.44.0 Atom-Shell/0.7.6 Safari/537.36
I actually want it on, I just want the behavior to be "use the indent of the last non-blank line" instead of "use the indent of the line I'm on", so it works when you've put your cursor after a line of something real.
We may need a second option to infer indent on paste, because while that behavior works great in Ruby and was Atom's original approach, it causes problems in indentation-sensitive languages like CoffeeScript by choosing the level of the end of the method above when pasting a new method. With explicit end delimiters that issue doesn't come up.
@probablycorey Are you okay reopening this issue or opening another one to address it? The current behavior is good for indentation-sensitive languages but not ideal for our Ruby customers. May be worth figuring out some kind of compromise.
Let's reopen it. @eric it sounds like you want "auto indent pasted text". Which is separate from our current auto indent and normalize indent on paste options.
I know that for me it was jarring to be inserting text on the line below some indented ruby and have it show up as column 0 instead of lined up under the stuff underneath.
I just played around with textmate and created this:
classSomethingdefanythingcallendend
If I am at column 0 on line 5 and start typing, it automatically moves the cursor to line up with call, but it doesn't in atom.
I wonder if these behaviors are related to where I expect pastes to go.
I apologize if this has gone off track, but I'm having trouble articulating what it is that I'm expected, I just know that what is happening now isn't what I'm used to, and is requiring more steps to fix it.
No apologies needed! We appreciate your input. I agree that it's a separate option for auto-indenting. I think in addition it would be a good idea to disable auto-indent for indent-sensitive languages regardless of the option, so people that are working on mixed Ruby/Coffee codebases don't have to toggle it back and forth. Either that, or allow a language to customize it's auto-indent procedure somehow.
This definitely continues to be the biggest source of frustration I have every day that I use Atom.
When it comes to working in Ruby, moving code around never ends up where I wanted it the first time without having to re-indent it. This is something I never had to think about with TextMate 2.
I believe I have a similar problem, when I copy and paste from a block of text which includes blank lines, the blank lines are not there when I paste either with ctl+v or ctl+shift+v
We're working on a new syntax system that should make it much easier to make the kind of syntax-based decisions that good auto-indentation support would require. Ruby will be one of the first supported languages.
@nathansobo its not specifically a syntax problem. I frequently paste in blocks of text (from code or perhaps a interface file) and line numbers from the source are important. I don't want anything reformatted or missing from the source and blank lines are removed, will this be supported?
@huntertj Ah, I misunderstood since the main issue seems to be about deficiencies in Atom's auto-formatting on paste. You just want a way to paste without any changes to the existing formatting, right?
Okay, I've opened #15976 to add a command to paste without formatting regardless of settings or the source of the copied text. Hopefully that will help.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
probablycorey commentedon Jan 14, 2014
There is a config option that will fix this for you called
editor.normalizeIndentOnPasteYou can set it in
~/.atom/config.csonOr using the horribly ugly settings pane

nathansobo commentedon Jan 14, 2014
I wonder if we should offer a non-normalized variant of paste, like
alt-cmd-v.eric commentedon Jan 16, 2014
I actually want it on, I just want the behavior to be "use the indent of the last non-blank line" instead of "use the indent of the line I'm on", so it works when you've put your cursor after a line of something real.
nathansobo commentedon Jan 16, 2014
We may need a second option to infer indent on paste, because while that behavior works great in Ruby and was Atom's original approach, it causes problems in indentation-sensitive languages like CoffeeScript by choosing the level of the end of the method above when pasting a new method. With explicit end delimiters that issue doesn't come up.
eric commentedon Jan 16, 2014
I definitely think that the behavior may need to be specific to the current language set for the file.
nathansobo commentedon Jan 16, 2014
@probablycorey Are you okay reopening this issue or opening another one to address it? The current behavior is good for indentation-sensitive languages but not ideal for our Ruby customers. May be worth figuring out some kind of compromise.
probablycorey commentedon Jan 16, 2014
Let's reopen it. @eric it sounds like you want "auto indent pasted text". Which is separate from our current auto indent and normalize indent on paste options.
eric commentedon Jan 16, 2014
I guess I'm not sure what I want.
I know that for me it was jarring to be inserting text on the line below some indented ruby and have it show up as column 0 instead of lined up under the stuff underneath.
I just played around with textmate and created this:
If I am at column 0 on line 5 and start typing, it automatically moves the cursor to line up with
call, but it doesn't in atom.I wonder if these behaviors are related to where I expect pastes to go.
I apologize if this has gone off track, but I'm having trouble articulating what it is that I'm expected, I just know that what is happening now isn't what I'm used to, and is requiring more steps to fix it.
nathansobo commentedon Jan 16, 2014
No apologies needed! We appreciate your input. I agree that it's a separate option for auto-indenting. I think in addition it would be a good idea to disable auto-indent for indent-sensitive languages regardless of the option, so people that are working on mixed Ruby/Coffee codebases don't have to toggle it back and forth. Either that, or allow a language to customize it's auto-indent procedure somehow.
eric commentedon Feb 13, 2014
This definitely continues to be the biggest source of frustration I have every day that I use Atom.
When it comes to working in Ruby, moving code around never ends up where I wanted it the first time without having to re-indent it. This is something I never had to think about with TextMate 2.
bobrocke commentedon Jun 9, 2014
I think this is an important feature. It's one of the things that keeps pulling me back to Sublime Text; its smart indent on paste works well.
jescalan commentedon Aug 4, 2014
+1 for this feature, doing me in consistently
4 remaining items
jackson-sandland commentedon Sep 11, 2017
Has this been resolved? cmd-shift-v should maintain the formatting of where the text is copied from!
nikibrown commentedon Sep 24, 2017
Found this after googling how to enable this feature in Atom. Recently switched from sublime. I guess its not there? :(
huntertj commentedon Sep 25, 2017
I believe I have a similar problem, when I copy and paste from a block of text which includes blank lines, the blank lines are not there when I paste either with ctl+v or ctl+shift+v
jackson-sandland commentedon Oct 22, 2017
Guys, this is a such a crucial feature. Is there a solution?
nathansobo commentedon Oct 23, 2017
We're working on a new syntax system that should make it much easier to make the kind of syntax-based decisions that good auto-indentation support would require. Ruby will be one of the first supported languages.
huntertj commentedon Oct 23, 2017
@nathansobo its not specifically a syntax problem. I frequently paste in blocks of text (from code or perhaps a interface file) and line numbers from the source are important. I don't want anything reformatted or missing from the source and blank lines are removed, will this be supported?
nathansobo commentedon Oct 23, 2017
@huntertj Ah, I misunderstood since the main issue seems to be about deficiencies in Atom's auto-formatting on paste. You just want a way to paste without any changes to the existing formatting, right?
nathansobo commentedon Oct 23, 2017
Okay, I've opened #15976 to add a command to paste without formatting regardless of settings or the source of the copied text. Hopefully that will help.
lock commentedon Apr 22, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!