syntax: make code folding in choice blocks in Kconfig files more convenient

Review Request #123144 - Created March 27, 2015 and submitted

Information
Martin Walch
ktexteditor
master
Reviewers
kate
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

Dominik Haumann
Martin Walch
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit d7654b55c293a855dfec940a5bfb4d0752e82c96 by Martin Walch to branch master.
Loading...