diff options
Diffstat (limited to 'test/functional/ui/fold_spec.lua')
| -rw-r--r-- | test/functional/ui/fold_spec.lua | 367 | 
1 files changed, 366 insertions, 1 deletions
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua index 6ce8b33a63..d3b1d33956 100644 --- a/test/functional/ui/fold_spec.lua +++ b/test/functional/ui/fold_spec.lua @@ -38,7 +38,9 @@ describe("folded lines", function()          [6] = {background = Screen.colors.Yellow},          [7] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray},          [8] = {foreground = Screen.colors.Brown }, -        [9] = {bold = true, foreground = Screen.colors.Brown} +        [9] = {bold = true, foreground = Screen.colors.Brown}, +        [10] = {background = Screen.colors.LightGrey, underline = true}, +        [11] = {bold=true},        })      end) @@ -290,6 +292,369 @@ describe("folded lines", function()        end      end) +    it("works with split", function() +      insert([[ +        aa +        bb +        cc +        dd +        ee +        ff]]) +      feed_command('2') +      command("set foldcolumn=1") +      feed('zf3j') +      feed_command('1') +      feed('zf2j') +      feed('zO') +      feed_command("rightbelow new") +      insert([[ +        aa +        bb +        cc +        dd +        ee +        ff]]) +      feed_command('2') +      command("set foldcolumn=1") +      feed('zf3j') +      feed_command('1') +      feed('zf2j') +      if multigrid then +        meths.input_mouse('left', 'press', '', 4, 0, 0) +        screen:expect([[ +        ## grid 1 +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          {2:[No Name] [+]                                }| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          {3:[No Name] [+]                                }| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:-}aa                                          | +          {7:-}bb                                          | +        ## grid 3 +          :1                                           | +        ## grid 4 +          {7:-}^aa                                          | +          {7:+}{5:+---  4 lines: bb···························}| +          {7:│}ff                                          | +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 3, 0) +        screen:expect([[ +          {7:-}aa                                          | +          {7:-}bb                                          | +          {2:[No Name] [+]                                }| +          {7:-}^aa                                          | +          {7:+}{5:+---  4 lines: bb···························}| +          {7:│}ff                                          | +          {3:[No Name] [+]                                }| +          :1                                           | +        ]]) +      end + +      if multigrid then +        meths.input_mouse('left', 'press', '', 4, 1, 0) +        screen:expect([[ +        ## grid 1 +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          {2:[No Name] [+]                                }| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          {3:[No Name] [+]                                }| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:-}aa                                          | +          {7:-}bb                                          | +        ## grid 3 +          :1                                           | +        ## grid 4 +          {7:-}^aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 4, 0) +        screen:expect([[ +          {7:-}aa                                          | +          {7:-}bb                                          | +          {2:[No Name] [+]                                }| +          {7:-}^aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +          {3:[No Name] [+]                                }| +          :1                                           | +        ]]) +      end + +      if multigrid then +        meths.input_mouse('left', 'press', '', 2, 1, 0) +        screen:expect([[ +        ## grid 1 +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          {3:[No Name] [+]                                }| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          {2:[No Name] [+]                                }| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:-}aa                                          | +          {7:+}{5:^+---  4 lines: bb···························}| +        ## grid 3 +          :1                                           | +        ## grid 4 +          {7:-}aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 1, 0) +        screen:expect([[ +          {7:-}aa                                          | +          {7:+}{5:^+---  4 lines: bb···························}| +          {3:[No Name] [+]                                }| +          {7:-}aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +          {2:[No Name] [+]                                }| +          :1                                           | +        ]]) +      end + +      if multigrid then +        meths.input_mouse('left', 'press', '', 2, 0, 0) +        screen:expect([[ +        ## grid 1 +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          {3:[No Name] [+]                                }| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          {2:[No Name] [+]                                }| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:+}{5:^+--  6 lines: aa····························}| +          {1:~                                            }| +        ## grid 3 +          :1                                           | +        ## grid 4 +          {7:-}aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 0, 0) +        screen:expect([[ +          {7:+}{5:^+--  6 lines: aa····························}| +          {1:~                                            }| +          {3:[No Name] [+]                                }| +          {7:-}aa                                          | +          {7:-}bb                                          | +          {7:2}cc                                          | +          {2:[No Name] [+]                                }| +          :1                                           | +        ]]) +      end +    end) + +    it("works with tab", function() +      insert([[ +        aa +        bb +        cc +        dd +        ee +        ff]]) +      feed_command('2') +      command("set foldcolumn=2") +      feed('zf3j') +      feed_command('1') +      feed('zf2j') +      feed('zO') +      feed_command("tab split") +      if multigrid then +        meths.input_mouse('left', 'press', '', 4, 1, 1) +        screen:expect([[ +        ## grid 1 +          {10: + [No Name] }{11: + [No Name] }{2:                  }{10:X}| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [3:---------------------------------------------]| +        ## grid 2 (hidden) +          {7:- }aa                                         | +          {7:│-}bb                                         | +          {7:││}cc                                         | +          {7:││}dd                                         | +          {7:││}ee                                         | +          {7:│ }ff                                         | +          {1:~                                            }| +        ## grid 3 +          :tab split                                   | +        ## grid 4 +          {7:- }^aa                                         | +          {7:│+}{5:+---  4 lines: bb··························}| +          {7:│ }ff                                         | +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 2, 1) +        screen:expect([[ +          {10: + [No Name] }{11: + [No Name] }{2:                  }{10:X}| +          {7:- }^aa                                         | +          {7:│+}{5:+---  4 lines: bb··························}| +          {7:│ }ff                                         | +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          :tab split                                   | +        ]]) +      end + +      if multigrid then +        meths.input_mouse('left', 'press', '', 4, 0, 0) +        screen:expect([[ +        ## grid 1 +          {10: + [No Name] }{11: + [No Name] }{2:                  }{10:X}| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [4:---------------------------------------------]| +          [3:---------------------------------------------]| +        ## grid 2 (hidden) +          {7:- }aa                                         | +          {7:│-}bb                                         | +          {7:││}cc                                         | +          {7:││}dd                                         | +          {7:││}ee                                         | +          {7:│ }ff                                         | +          {1:~                                            }| +        ## grid 3 +          :tab split                                   | +        ## grid 4 +          {7:+ }{5:^+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 1, 0) +        screen:expect([[ +          {10: + [No Name] }{11: + [No Name] }{2:                  }{10:X}| +          {7:+ }{5:^+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          :tab split                                   | +        ]]) +      end + +      feed_command("tabnext") +      if multigrid then +        meths.input_mouse('left', 'press', '', 2, 1, 1) +        screen:expect([[ +        ## grid 1 +          {11: + [No Name] }{10: + [No Name] }{2:                  }{10:X}| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:- }^aa                                         | +          {7:│+}{5:+---  4 lines: bb··························}| +          {7:│ }ff                                         | +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ## grid 3 +          :tabnext                                     | +        ## grid 4 (hidden) +          {7:+ }{5:+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 2, 1) +        screen:expect([[ +          {11: + [No Name] }{10: + [No Name] }{2:                  }{10:X}| +          {7:- }^aa                                         | +          {7:│+}{5:+---  4 lines: bb··························}| +          {7:│ }ff                                         | +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          :tabnext                                     | +        ]]) +      end + +      if multigrid then +        meths.input_mouse('left', 'press', '', 2, 0, 0) +        screen:expect([[ +        ## grid 1 +          {11: + [No Name] }{10: + [No Name] }{2:                  }{10:X}| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [2:---------------------------------------------]| +          [3:---------------------------------------------]| +        ## grid 2 +          {7:+ }{5:^+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ## grid 3 +          :tabnext                                     | +        ## grid 4 (hidden) +          {7:+ }{5:+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +        ]]) +      else +        meths.input_mouse('left', 'press', '', 0, 1, 0) +        screen:expect([[ +          {11: + [No Name] }{10: + [No Name] }{2:                  }{10:X}| +          {7:+ }{5:^+--  6 lines: aa···························}| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          {1:~                                            }| +          :tabnext                                     | +        ]]) +      end +    end) +      it("works with multibyte text", function()        -- Currently the only allowed value of 'maxcombine'        eq(6, meths.get_option('maxcombine'))  | 
