From c6f5d6b7e0f274a245cecd80c480212d399df9d4 Mon Sep 17 00:00:00 2001 From: sach1t Date: Sat, 4 Jun 2016 01:37:32 -0400 Subject: normal.c: Restore vim-like tab dragging. #4874 Closes #4663 References #3310 --- test/functional/ui/mouse_spec.lua | 216 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 041e9338b1..388d84fba6 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -111,6 +111,222 @@ describe('Mouse input', function() ]]) end) + describe('tab drag', function() + before_each(function() + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=Screen.colors.Blue}, + tab = { background=Screen.colors.LightGrey, underline=true }, + sel = { bold=true }, + fill = { reverse=true } + }) + screen.timeout = 15000 + end) + + it('in tabline on filler space moves tab to the end', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<14,0>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('in tabline to the left moves tab left', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<11,0>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<6,0>') + screen:expect([[ + {sel: + bar }{tab: + foo }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('in tabline to the right moves tab right', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<7,0>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline under filler space moves tab to the end', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,1>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<14,1>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline to the left moves tab left', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<11,0>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<11,1>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<6,1>') + screen:expect([[ + {sel: + bar }{tab: + foo }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + end) + + it('out of tabline to the right moves tab right', function() + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<4,1>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + feed('<7,1>') + screen:expect([[ + {tab: + bar }{sel: + foo }{fill: }{tab:X}| + this is fo^o | + {0:~ }| + {0:~ }| + | + ]]) + end) + end) + describe('tabline', function() before_each(function() screen:set_default_attr_ids( { -- cgit From ac819b8994079d78fdafb883e6e6144dd9aa952f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 12 Sep 2016 02:36:59 +0200 Subject: CI: Travis macOS: Skip tab left-drag tests. These tests fail on master, so it's not a regression. Changes in #4874 (parent commit) seem to work (and pass most CI), so skipping these tests is better than blocking the changes. --- test/functional/api/server_requests_spec.lua | 4 ++-- test/functional/core/job_spec.lua | 4 ++-- test/functional/ui/mouse_spec.lua | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'test/functional') diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index b668b5ba86..4c47f85f72 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -141,8 +141,8 @@ describe('server -> client', function() describe('when the client is a recursive vim instance', function() if os.getenv("TRAVIS") and helpers.os_name() == "osx" then - -- XXX: Hangs Travis OSX since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. - pending("[Hangs on Travis OSX. #5002]", function() end) + -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. + pending("[Hangs on Travis macOS. #5002]", function() end) return end diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index f764898f72..adbe17d4b5 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -109,8 +109,8 @@ describe('jobs', function() it("will not buffer data if it doesn't end in newlines", function() if os.getenv("TRAVIS") and os.getenv("CC") == "gcc-4.9" and helpers.os_name() == "osx" then - -- XXX: Hangs Travis OSX since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. - pending("[Hangs on Travis OSX. #5002]", function() end) + -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. + pending("[Hangs on Travis macOS. #5002]", function() end) return end diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 388d84fba6..13bfe9e23f 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -153,6 +153,11 @@ describe('Mouse input', function() end) it('in tabline to the left moves tab left', function() + if os.getenv("TRAVIS") and helpers.os_name() == "osx" then + pending("[Fails on Travis macOS. #4874]", function() end) + return + end + execute('%delete') insert('this is foo') execute('silent file foo | tabnew | file bar') @@ -251,6 +256,11 @@ describe('Mouse input', function() end) it('out of tabline to the left moves tab left', function() + if os.getenv("TRAVIS") and helpers.os_name() == "osx" then + pending("[Fails on Travis macOS. #4874]", function() end) + return + end + execute('%delete') insert('this is foo') execute('silent file foo | tabnew | file bar') -- cgit