|Formatter on files with different line-endings [message #1218468]
||Fri, 29 November 2013 09:32
| Siber Just Siber
Registered: October 2013
I have implemented some custom formatting rules for my DSL, so that I overrode one-space formatter with my custom one.
I faced a problem that when I give my formatter a file with just '\n' at the end of every line, then after the very first execution (when the file is just added to a project) formatter adds some white-spaces and new lines which are not supposed to appear. After the second execution everything is fine, those new-lines disappear and the result looks as it should.
When I give it a file with the same content but only with different line endings (not with '\n', but with '\r\n') everything works fine right from the very first try.
Can somebody explain the nature of the phenomenon and maybe propose a solution to avoid invocation of the formatter two times for '\n' line-ended files?
Powered by FUDForum
. Page generated in 0.01686 seconds