diff --git a/autotests/folding/Kconfig.fold b/autotests/folding/Kconfig.fold --- a/autotests/folding/Kconfig.fold +++ b/autotests/folding/Kconfig.fold @@ -8,8 +8,8 @@ help GammaRay Qt introspection probe. second line of help, with correct indentation - third line underindented and thus wrong + third line underindented and thus wrong default 'true' -menu myMenumenu myMenu +menu myMenu endmenu diff --git a/autotests/folding/folding.cpp.fold b/autotests/folding/folding.cpp.fold --- a/autotests/folding/folding.cpp.fold +++ b/autotests/folding/folding.cpp.fold @@ -9,7 +9,7 @@ //END } -#if 0 +#if 0 #elif 1#elif 1 #else#else #endif diff --git a/autotests/folding/highlight.cpp.fold b/autotests/folding/highlight.cpp.fold --- a/autotests/folding/highlight.cpp.fold +++ b/autotests/folding/highlight.cpp.fold @@ -18,7 +18,7 @@ #include PATH_IN_MACRO(a, b) #define SOME_VAR 1 -#ifdef SOME_VAR +#ifdef SOME_VAR #define MULTILINE_MACRO one \ two \ @@ -58,19 +58,19 @@ #wrong # wrong #endif x -#if DS() +#if DS() #else xelse x #else /* */xelse /* */x #else /* xelse /* x y */ z #endif // check that _XXX defines work, bug 397766 -#ifndef _HEADER_GUARD +#ifndef _HEADER_GUARD #define _HEADER_GUARD 1 #endif -#ifdef _HEADER_GUARD -#if (_HEADER_GUARD >= 1) +#ifdef _HEADER_GUARD +#if (_HEADER_GUARD >= 1) #endif #endif @@ -152,133 +152,133 @@ other::vector; } -#if 1 +#if 1 double foo(const A); #else // else#else // else double foo(const A); #endif // end -#if 0 +#if 0 double foo(const A); #else // else#else // else double foo(const A); #endif // end -#if 1 +#if 1 double foo(const A); #elif 1#elif 1 double foo(const A); #elif 0 double foo(const A); #endif // end -#if 0 +#if 0 double foo(const A); #elif 1#elif 1 double foo(const A); #elif 0#elif 0 double foo(const A); #endif // end -#if 0 +#if 0 double foo(const A); #elif a#elif a double foo(const A); -#elif 0elif 0 +#elif 0 double foo(const A); #elif a#elif a double foo(const A); #else // elseelse // else double foo(const A); #endif // end -#if 0 // blah blah +#if 0 // blah blah double foo(const A); #elif 1 // blah blah#elif 1 // blah blah double foo(const A); #else // else#else // else double foo(const A); #endif // end -#if 0 || a +#if 0 || a double foo(const A); #else // elseelse // else double foo(const A); #endif // end -#if 1 || a +#if 1 || a double foo(const A); #else // else#else // else double foo(const A); #endif // end -#if 0 && a +#if 0 && a double foo(const A); #else // elseelse // else double foo(const A); #endif // end -#if 1 && a +#if 1 && a double foo(const A); #else // elseelse // else double foo(const A); #endif // end -#if a +#if a double foo(const A); -#elif 0elif 0 +#elif 0 double foo(const A); #endif // end -#if a +#if a double foo(const A); -#elif 1elif 1 +#elif 1 double foo(const A); #endif // end -#if a +#if a double foo(const A); -#elif aelif a +#elif a double foo(const A); #endif // end int bar(void*p, void * pp) { -# if 0 +# if 0 double foo(); # else // else# else // else double foo(); # endif // end } -#if abc 0 +#if abc 0 double foo(); #endif // end -#if xxx +#if xxx double foo(); #elseelse double foo(); #endif // end -#if xxx +#if xxx double foo(); -#elif xxx // elseifelif xxx // elseif +#elif xxx // elseif double foo(); -#elif xxx // elseifelif xxx // elseif +#elif xxx // elseif double foo(); #endif // end // error # #d # d -#if -#elifelif +#if +#elif #endif -#ifndef +#ifndef #endif -#ifdef 0 +#ifdef 0 #endif // end static uint64_t intWithSuffix = 42ull; diff --git a/autotests/folding/highlight.lex.fold b/autotests/folding/highlight.lex.fold --- a/autotests/folding/highlight.lex.fold +++ b/autotests/folding/highlight.lex.fold @@ -1,4 +1,4 @@ -/* This test file tests kates Lex/Flex highlighting */ +/* This test file tests kates Lex/Flex highlighting */ %option c++ %option yyclass="KateTester" diff --git a/autotests/folding/highlight.sh.fold b/autotests/folding/highlight.sh.fold --- a/autotests/folding/highlight.sh.fold +++ b/autotests/folding/highlight.sh.fold @@ -202,6 +202,6 @@ 2) echo xxx; ;; 1) echo yyy; -esacesac +esac ls #should be outside of case 1 folding block diff --git a/autotests/folding/highlight.y.fold b/autotests/folding/highlight.y.fold --- a/autotests/folding/highlight.y.fold +++ b/autotests/folding/highlight.y.fold @@ -11,7 +11,7 @@ %} -%locations +%locations %union { int int_val; diff --git a/autotests/folding/light52_muldiv.vhdl.fold b/autotests/folding/light52_muldiv.vhdl.fold --- a/autotests/folding/light52_muldiv.vhdl.fold +++ b/autotests/folding/light52_muldiv.vhdl.fold @@ -104,23 +104,23 @@ ); end entity light52_muldiv; -architecture sequential of light52_muldiv is +architecture sequential of light52_muldiv is -signal bit_ctr : integer range 0 to 8; +signal bit_ctr : integer range 0 to 8; -signal b_shift_reg : t_word; +signal b_shift_reg : t_word; -signal den_ge_256 : std_logic; -signal num_ge_den : std_logic; -signal sub_num : std_logic; +signal den_ge_256 : std_logic; +signal num_ge_den : std_logic; +signal sub_num : std_logic; -signal denominator : t_byte; -signal rem_reg : t_byte; -signal quot_reg : t_byte; -signal prod_reg : t_word; -signal ready : std_logic; +signal denominator : t_byte; +signal rem_reg : t_byte; +signal quot_reg : t_byte; +signal prod_reg : t_word; +signal ready : std_logic; -signal load_regs : std_logic; +signal load_regs : std_logic; begin diff --git a/autotests/folding/light52_tb.vhdl.fold b/autotests/folding/light52_tb.vhdl.fold --- a/autotests/folding/light52_tb.vhdl.fold +++ b/autotests/folding/light52_tb.vhdl.fold @@ -57,49 +57,49 @@ end; -architecture testbench of light52_tb is +architecture testbench of light52_tb is -------------------------------------------------------------------------------- -- Simulation parameters -- FIXME these should be in parameter package -- Simulated clock period is the same as the usual target, the DE-1 board -constant T : time := 20 ns; -- 50MHz -constant SIMULATION_LENGTH : integer := 400000; +constant T : time := 20 ns; -- 50MHz +constant SIMULATION_LENGTH : integer := 400000; -------------------------------------------------------------------------------- -- MPU interface -signal clk : std_logic := '0'; -signal reset : std_logic := '1'; +signal clk : std_logic := '0'; +signal reset : std_logic := '1'; -signal p0_out : std_logic_vector(7 downto 0); -signal p1_out : std_logic_vector(7 downto 0); -signal p2_in : std_logic_vector(7 downto 0); -signal p3_in : std_logic_vector(7 downto 0); +signal p0_out : std_logic_vector(7 downto 0); +signal p1_out : std_logic_vector(7 downto 0); +signal p2_in : std_logic_vector(7 downto 0); +signal p3_in : std_logic_vector(7 downto 0); -signal external_irq : std_logic_vector(7 downto 0); +signal external_irq : std_logic_vector(7 downto 0); -signal txd, rxd : std_logic; +signal txd, rxd : std_logic; -------------------------------------------------------------------------------- -- Logging signals & simulation control -- Asserted high to disable the clock and terminate the simulation. -signal done : std_logic := '0'; +signal done : std_logic := '0'; -- Log file file log_file: TEXT open write_mode is "hw_sim_log.txt"; -- Console output log file file con_file: TEXT open write_mode is "hw_sim_console_log.txt"; -- Info record needed by the logging fuctions -signal log_info : t_log_info; +signal log_info : t_log_info; begin ---- UUT instantiation --------------------------------------------------------- -uut: entity work.light52_mcu +uut: entity work.light52_mcu generic map ( IMPLEMENT_BCD_INSTRUCTIONS => BCD, CODE_ROM_SIZE => work.obj_code_pkg.XCODE_SIZE, diff --git a/autotests/folding/preprocessor-bug363280.cpp.fold b/autotests/folding/preprocessor-bug363280.cpp.fold --- a/autotests/folding/preprocessor-bug363280.cpp.fold +++ b/autotests/folding/preprocessor-bug363280.cpp.fold @@ -1,8 +1,8 @@ -#if 1 +#if 1 int x; // variable shall not be grey #endif -#if defined (A) +#if defined (A) int y; // variable shall not be grey -#elif defined (B)elif defined (B) +#elif defined (B) int z; // variable shall not be grey #endif diff --git a/autotests/folding/test.diff.fold b/autotests/folding/test.diff.fold --- a/autotests/folding/test.diff.fold +++ b/autotests/folding/test.diff.fold @@ -34,7 +34,7 @@ if (text.at(offset) == m_char) return offset + 1; return offset; -diff --git a/src/lib/rule_p.h b/src/lib/rule_p.hdiff --git a/src/lib/rule_p.h b/src/lib/rule_p.hdiff --git a/src/lib/rule_p.h b/src/lib/rule_p.h +diff --git a/src/lib/rule_p.h b/src/lib/rule_p.h index d8862ae..d9cedbf 100644 --- a/src/lib/rule_p.h +++ b/src/lib/rule_p.h diff --git a/autotests/folding/test.mss.fold b/autotests/folding/test.mss.fold --- a/autotests/folding/test.mss.fold +++ b/autotests/folding/test.mss.fold @@ -1,4 +1,4 @@ -/* kate: hl CartoCSS +/* kate: hl CartoCSS This file contains some content coming from https://github.com/gravitystorm/openstreetmap-carto with CC0 license. This file is just for testing @@ -15,7 +15,7 @@ @admin-boundaries: #ac46ac; -/* For performance reasons, the admin border layers are split into three groups +/* For performance reasons, the admin border layers are split into three groups for low, middle and high zoom levels. For each zoomlevel, all borders come from a single attachment, to handle overlapping borders correctly. @@ -67,7 +67,7 @@ line-width: 3; } } - /* + /* The following code prevents admin boundaries from being rendered on top of each other. Comp-op works on the entire attachment, not on the individual border. Therefore, this code generates an attachment containing a set of diff --git a/autotests/folding/test.prolog.fold b/autotests/folding/test.prolog.fold --- a/autotests/folding/test.prolog.fold +++ b/autotests/folding/test.prolog.fold @@ -1,2 +1,2 @@ -#! Invalid shebang (it isn't in 1st line) +#! Invalid shebang (it isn't in 1st line) diff --git a/autotests/folding/test.yaml.fold b/autotests/folding/test.yaml.fold --- a/autotests/folding/test.yaml.fold +++ b/autotests/folding/test.yaml.fold @@ -78,72 +78,72 @@ \//||\/|| // || ||__ ---- > +--- > Mark McGwire's year was crippled by a knee injury. -? | +? | This is a key that has multiple lines -: | +: | and this is it's literal value -# Capture the indentation of the Key. The "-" and "?" operators +# Capture the indentation of the Key. The "-" and "?" operators # are considered as part of the indentation: key1: key2: !!hello | literal: " text" # [ ] # literal { } - key3: |+ + key3: |+ literal: 'text' - no-literal: " text" + no-literal: " text" #comment ? key: |- literal: "text" - no-literal: "text" + no-literal: "text" - item1 - item2 - - - key: >- "literal text" # [ ] 'literal block' - no-literal: 12 + no-literal: 12 ? - - - - ? key: | literal: [ ] - no-literal: [ ] + no-literal: [ ] # Capture the indentation of the literal/folded operator: |- literal: "text" -!!binary | +!!binary | R0lGODlhDAAMAIQAAP//9/X 17unp5WZmZgAAAOfn515eXv Pz7Y6OjuDg4J+fn5OTk6enp 56enmleECcgggoBADs= -key1: +key1: key2: | literal: "text" - key3: + key3: !!str | literal: "text" #literal -# Capture the indentation of the operators "-" or "?": +# Capture the indentation of the operators "-" or "?": ? - - - !!hello |+ literal: "sdfsd" # [ ] - no-literal: "sdfsd" # [ ] + no-literal: "sdfsd" # [ ] - - - - >- literal: "text" #literal - no-literal: "text" + no-literal: "text" # This implementation of literal blocks has a limitation: # it only supports 6 dashes at most. diff --git a/src/lib/abstracthighlighter.cpp b/src/lib/abstracthighlighter.cpp --- a/src/lib/abstracthighlighter.cpp +++ b/src/lib/abstracthighlighter.cpp @@ -253,9 +253,9 @@ // apply folding if (rule->endRegion().isValid()) - applyFolding(offset, newOffset - offset, rule->endRegion()); + applyFolding(offset, rule->isLookAhead() ? 0 : newOffset - offset, rule->endRegion()); if (rule->beginRegion().isValid()) - applyFolding(offset, newOffset - offset, rule->beginRegion()); + applyFolding(offset, rule->isLookAhead() ? 0 : newOffset - offset, rule->beginRegion()); if (rule->isLookAhead()) { Q_ASSERT(!rule->context().isStay());