Commit Graph

10 Commits

Author SHA1 Message Date
Daniel James
19ccdd6cbd Reformat 2017-12-24 12:46:59 +00:00
Daniel James
974b5b5f01 This was fixed in 4ff7f3a9 2017-10-03 19:44:00 +01:00
Daniel James
38e5c35294 Wrapper for boost::string_view
Can be constructed from an rvalue std::string.
2017-03-26 19:55:21 +01:00
Daniel James
13023a2ed3 Fix unindenting trailing spaces in code blocks.
[SVN r84187]
2013-05-07 23:25:47 +00:00
Daniel James
0e4b7dad31 Clean up mixed tabs/spaces when unindenting.
If the whitespace to be removed when unindenting a block is not
consistent, then replace all the indentation in that block with spaces
(i.e. expand tabs). This fixes some odd results that could happen, e.g.

    ....Line 1
    --->Line 2

(dots = spaces, arrow = tab) would become:

    ...Line 1
    Line 2

Because the first character was removed from each line. This now works
okay.

But I don't expand tabs when the whitespace that isn't removed is
inconsistent, which can have odd results, for example:

    ..Line 1
    ..->Line 2
    ......Line 3

Will just remove the first two spaces, resulting in:

    Line 1
    --->Line 2
    ....Line 3

This should be rare, as tabs after spaces are a bit odd. But maybe I
should convert to spaces more often. Perhaps when indentation is
inconsistent, or perhaps whenever a mixture of tabs and spaces are used,
or even always just do it.

[SVN r84150]
2013-05-05 13:46:23 +00:00
Daniel James
8fa09072c2 Remove whitespace only leading lines from indented blocks.
[SVN r83123]
2013-02-24 11:23:15 +00:00
Daniel James
4ff7f3a9fb Fix mapped position when breaking up indented code.
[SVN r83122]
2013-02-24 11:23:02 +00:00
Daniel James
75842c4f5d Clean up poorly overloaded 'add' method.
[SVN r83120]
2013-02-24 11:22:33 +00:00
Daniel James
f34940b3a7 Store indentation change in source map.
Used to infer it when required, which could go wrong.

[SVN r83118]
2013-02-24 11:22:03 +00:00
Daniel James
a586cd7822 Source map tests.
[SVN r83117]
2013-02-24 11:21:50 +00:00