Auto-indent inside of multi-line strings
已回答
To be exact I'm using Rubymine, but I'm sure this is general.
When I'm entering in a multiline string, say a prettyfied large JSON document, inside of a code file, auto-indent doesn't seem to work. Each <enter> I hit just takes me to the first column, not the column that last line's content started at.
Is there some way to enable auto-indent, when typing inside of multi-line strings.
请先登录再写评论。
Hi Jason,
What type of file is it in your case? Can you provide a code sample?
Just create a ruby file, and start a multi-line string.
say
But you could use just double quotes, or %Q or anything else that starts a multi-line string definition. The auto-indent doesn't work inside of multi-line strings. This means for cases like the above, if your adding a lot of lines you spend a great deal of time just hitting tab constantly to fix the indentation for each line your trying to enter, individually.
Hi Stephen378baker , Are you a bot? Because you repeated what I asked verbatim, then replied with search results that don't reflect what I was asking about.
For the record, removing indentation from a multi-line string, after the string is already defined isn't a problem.
The problem is that Intellij's auto-indent (while typing into the editor) doesn't seem to function when your cursor is inside of a string defined within the code. It works fine when your outside of a string definition, say typing code into a method or defining a class.
Intellij's auto-indentation also works fine when your typing in a file that it doesn't consider strictly code. Such as a JSON file or some regular text file.
I would just like to have this feature work, ANYWHERE inside of a code file. Not just in certain places within a code file.
Jason Stillwell, that looks similar to a known issue we have, could you please take a look at it and add your vote if you find it related.