syntax: make code folding in choice blocks in Kconfig files more convenient
Review Request #123144 - Created March 27, 2015 and submitted
config blocks in choice blocks are usually indented. Technically, the whitespace before an indented "config" line belongs to the config block above (if there is any). However, that means when folding a config block, then the next "config" line will be hidden which is unintuitive, surprising and inconvenient. For example, when considering this: choice prompt "example choice block" config CONFIG_0 bool "config 0" depends on SYMBOL_0 config CONFIG_1 bool "config 1" depends on SYMBOL_1 endchoice it is possible to fold the CONFIG_0 block, but afterwards it looks like this: choice prompt "example choice block" config CONFIG_0 bool "config 1" depends on SYMBOL_1 endchoice which is confusing, because now there is the header line of CONFIG_0 and right below the content of CONFIG_1. Fix this by adding the whitespace to the corresponding lookahead. Now after folding CONFIG_0 it will look like this: choice prompt "example choice block" config CONFIG_0 config CONFIG_1 bool "config 1" depends on SYMBOL_1 endchoice
Code folding tested on KDE 4.14
The patch looks good, feel free to commit.
If you want, you could also try this: <RegExpr ... firstNonSpace="true" .../>, this could also work, but it only is correct when you really want to match if it is the first text in a line.