]> git.lyx.org Git - features.git/commit
Fix Lexer::getLongString prefix pruning logic
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 Aug 2017 10:25:29 +0000 (12:25 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 29 Aug 2017 14:05:09 +0000 (16:05 +0200)
commitcc2835392294fb1e82a89b2ec3803f78c9183f18
tree6f109c11c74c6bc8a30b8d54f1bd618cd5f88ce7
parent3bb29375620e42e06948094fbb0018c21ab1d805
Fix Lexer::getLongString prefix pruning logic

This fixes 3 bugs:
1/ only spaces are considered as part of the prefix
2/ leading tabs are removed unconditionally
3/ off-by-one error in the removal

The new intended behavior is:

1/ find the prefix (sequence of spaces and tabs) before the first
   line; remove this prefix from the line
2/ on the next lines, check whether they start with the same prefix,
  and if they do, strip this prefix

(cherry picked from commit 48f099d93ab179eef76594ced6b735aa912c03f6)
src/Lexer.cpp