Preserving tab position (indent from the left) when editing multiline strings
Hello,
when i am coding in php - every time i press enter - cursor get moved to a correct position so i can write a new line content according to current indent i am at. However, this doesn't happen If i am adding new line to a multi line string. For example:
$execsql = "SELECT *
FROM mytable
WHERE something = 'cool'";
When i type "FROM mytable" and hit enter, cursor gets its position at x=zero in new line while i would want it to be under the beginning of word "FROM". This dropping cursor at zero happens only within multiline strings.
Thanks in advance
Please sign in to leave a comment.
Hi there,
Works for me...
P.S.
And If "SQL" tag name is used then the IDE will inject SQL language straight away instead of waiting until you get enough text inside the string to recognize it as SQL.
Such a code with have leading indent whitespace stripped by PHP so only a nicely formatted part will remain:
The variable will contain the following (which is better looking than your multiline string will produce :) ):
Thanks for your input. Shift + Enter does exactly what i need. Enter alone - nope, but that's okay. Sift+Enter also is good. Will also give HEDOC/NOWDOC a try! :) Thanks!