diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/autocmd_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/core/fileio_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/fixtures/CMakeLists.txt | 23 | ||||
-rw-r--r-- | test/functional/helpers.lua | 12 | ||||
-rw-r--r-- | test/functional/legacy/statusline_spec.lua | 38 | ||||
-rw-r--r-- | test/functional/legacy/tabline_spec.lua | 51 | ||||
-rw-r--r-- | test/functional/lua/diagnostic_spec.lua | 26 | ||||
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 126 | ||||
-rw-r--r-- | test/functional/ui/sign_spec.lua | 10 | ||||
-rw-r--r-- | test/functional/ui/statuscolumn_spec.lua | 202 | ||||
-rw-r--r-- | test/functional/vimscript/system_spec.lua | 29 | ||||
-rw-r--r-- | test/includes/CMakeLists.txt | 1 |
15 files changed, 467 insertions, 102 deletions
diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua index 7fb52b097b..22a1311ee9 100644 --- a/test/functional/api/autocmd_spec.lua +++ b/test/functional/api/autocmd_spec.lua @@ -613,6 +613,20 @@ describe('autocmd api', function() eq(false, success) matches("'group' must be a string or an integer", code) end) + + it('raises error for invalid pattern array', function() + local success, code = unpack(meths.exec_lua([[ + return {pcall(function() + vim.api.nvim_create_autocmd("FileType", { + pattern = {{}}, + command = "echo 'hello'", + }) + end)} + ]], {})) + + eq(false, success) + matches("All entries in 'pattern' must be strings", code) + end) end) describe('patterns', function() diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index ed37032f25..bbf2202f0d 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -22,6 +22,7 @@ local tmpname = helpers.tmpname local trim = helpers.trim local currentdir = helpers.funcs.getcwd local assert_alive = helpers.assert_alive +local check_close = helpers.check_close local expect_exit = helpers.expect_exit local write_file = helpers.write_file local Screen = require('test.functional.ui.screen') @@ -34,7 +35,7 @@ describe('fileio', function() before_each(function() end) after_each(function() - expect_exit(command, ':qall!') + check_close() os.remove('Xtest_startup_shada') os.remove('Xtest_startup_file1') os.remove('Xtest_startup_file1~') @@ -270,7 +271,7 @@ describe('tmpdir', function() end) after_each(function() - expect_exit(command, ':qall!') + check_close() os.remove(testlog) end) diff --git a/test/functional/fixtures/CMakeLists.txt b/test/functional/fixtures/CMakeLists.txt index a5410c2f8c..6e64b1e4dc 100644 --- a/test/functional/fixtures/CMakeLists.txt +++ b/test/functional/fixtures/CMakeLists.txt @@ -1,14 +1,23 @@ -add_executable(tty-test EXCLUDE_FROM_ALL tty-test.c) -target_link_libraries(tty-test ${LIBUV_LIBRARIES}) +add_library(test_lib INTERFACE) +if(MINGW) + target_link_libraries(test_lib INTERFACE -municode) +endif() +if(WIN32) + target_compile_definitions(test_lib INTERFACE MSWIN) +endif() +target_link_libraries(test_lib INTERFACE nvim) +add_executable(tty-test EXCLUDE_FROM_ALL tty-test.c) add_executable(shell-test EXCLUDE_FROM_ALL shell-test.c) # Fake pwsh (powershell) for testing make_filter_cmd(). #16271 add_executable(pwsh-test EXCLUDE_FROM_ALL shell-test.c) add_executable(printargs-test EXCLUDE_FROM_ALL printargs-test.c) add_executable(printenv-test EXCLUDE_FROM_ALL printenv-test.c) -if(MINGW) - set_target_properties(printenv-test PROPERTIES LINK_FLAGS -municode) -endif() - add_executable(streams-test EXCLUDE_FROM_ALL streams-test.c) -target_link_libraries(streams-test ${LIBUV_LIBRARIES}) + +target_link_libraries(tty-test PRIVATE test_lib) +target_link_libraries(shell-test PRIVATE test_lib) +target_link_libraries(pwsh-test PRIVATE test_lib) +target_link_libraries(printargs-test PRIVATE test_lib) +target_link_libraries(printenv-test PRIVATE test_lib) +target_link_libraries(streams-test PRIVATE test_lib) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index a14bedbbbd..4e8bf1a323 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -397,9 +397,12 @@ local function remove_args(args, args_rm) return new_args end -function module.check_close(old_session) +function module.check_close() + if not session then + return + end local start_time = luv.now() - old_session:close() + session:close() luv.update_time() -- Update cached value of luv.now() (libuv: uv_now()). local end_time = luv.now() local delta = end_time - start_time @@ -408,12 +411,13 @@ function module.check_close(old_session) "This indicates a likely problem with the test even if it passed!\n") io.stdout:flush() end + session = nil end --- @param io_extra used for stdin_fd, see :help ui-option function module.spawn(argv, merge, env, keep, io_extra) - if session and not keep then - module.check_close(session) + if not keep then + module.check_close() end local child_stream = ChildProcessStream.spawn( diff --git a/test/functional/legacy/statusline_spec.lua b/test/functional/legacy/statusline_spec.lua index 056209154e..c5b17f8749 100644 --- a/test/functional/legacy/statusline_spec.lua +++ b/test/functional/legacy/statusline_spec.lua @@ -76,14 +76,46 @@ describe('statusline', function() [1] = {background = Screen.colors.LightGrey}, -- Visual [2] = {bold = true}, -- MoreMsg [3] = {bold = true, reverse = true}, -- StatusLine + [5] = {background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue}, -- Folded }) exec([[ + func MyStatusLine() + return '%S' + endfunc + set showcmd set laststatus=2 set statusline=%S set showcmdloc=statusline call setline(1, ['a', 'b', 'c']) + set foldopen+=jump + 1,2fold + 3 + ]]) + + feed('g') + screen:expect([[ + {5:+-- 2 lines: a···································}| + ^c | + {0:~ }| + {0:~ }| + {0:~ }| + {3:g }| + | ]]) + + -- typing "gg" should open the fold + feed('g') + screen:expect([[ + ^a | + b | + c | + {0:~ }| + {0:~ }| + {3: }| + | + ]]) + feed('<C-V>Gl') screen:expect([[ {1:a} | @@ -94,6 +126,7 @@ describe('statusline', function() {3:3x2 }| {2:-- VISUAL BLOCK --} | ]]) + feed('<Esc>1234') screen:expect([[ a | @@ -104,7 +137,10 @@ describe('statusline', function() {3:1234 }| | ]]) - feed('<Esc>:set statusline=<CR>:<CR>1234') + + feed('<Esc>:set statusline=<CR>') + feed(':<CR>') + feed('1234') screen:expect([[ a | b | diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua index d858f137c5..6b368d1857 100644 --- a/test/functional/legacy/tabline_spec.lua +++ b/test/functional/legacy/tabline_spec.lua @@ -22,16 +22,49 @@ describe('tabline', function() [2] = {bold = true}, -- MoreMsg, TabLineSel [3] = {reverse = true}, -- TabLineFill [4] = {background = Screen.colors.LightGrey, underline = true}, -- TabLine + [5] = {background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue}, -- Folded }) exec([[ + func MyTabLine() + return '%S' + endfunc + set showcmd set showtabline=2 + set tabline=%!MyTabLine() set showcmdloc=tabline call setline(1, ['a', 'b', 'c']) + set foldopen+=jump + 1,2fold + 3 + ]]) + + feed('g') + screen:expect([[ + {3:g }| + {5:+-- 2 lines: a···································}| + ^c | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + + -- typing "gg" should open the fold + feed('g') + screen:expect([[ + {3: }| + ^a | + b | + c | + {0:~ }| + {0:~ }| + | ]]) + feed('<C-V>Gl') screen:expect([[ - {2: + [No Name] }{3: }{4:3x2}{3: }| + {3:3x2 }| {1:a} | {1:b} | {1:c}^ | @@ -39,9 +72,10 @@ describe('tabline', function() {0:~ }| {2:-- VISUAL BLOCK --} | ]]) + feed('<Esc>1234') screen:expect([[ - {2: + [No Name] }{3: }{4:1234}{3: }| + {3:1234 }| a | b | ^c | @@ -49,5 +83,18 @@ describe('tabline', function() {0:~ }| | ]]) + + feed('<Esc>:set tabline=<CR>') + feed(':<CR>') + feed('1234') + screen:expect([[ + {2: + [No Name] }{3: }{4:1234}{3: }| + a | + b | + ^c | + {0:~ }| + {0:~ }| + : | + ]]) end) end) diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua index 946994fd97..d364986ad7 100644 --- a/test/functional/lua/diagnostic_spec.lua +++ b/test/functional/lua/diagnostic_spec.lua @@ -2124,5 +2124,31 @@ end) return vim.g.diagnostic_autocmd_triggered == diagnostic_bufnr ]]) end) + + it("checks if diagnostics are disabled in a buffer", function() + eq({true, true, true , true}, exec_lua [[ + vim.diagnostic.set(diagnostic_ns, diagnostic_bufnr, { + make_error('Diagnostic #1', 1, 1, 1, 1), + }) + vim.api.nvim_set_current_buf(diagnostic_bufnr) + vim.diagnostic.disable() + return { + vim.diagnostic.is_disabled(), + vim.diagnostic.is_disabled(diagnostic_bufnr), + vim.diagnostic.is_disabled(diagnostic_bufnr, diagnostic_ns), + vim.diagnostic.is_disabled(_, diagnostic_ns), + } + ]]) + + eq({false, false, false , false}, exec_lua [[ + vim.diagnostic.enable() + return { + vim.diagnostic.is_disabled(), + vim.diagnostic.is_disabled(diagnostic_bufnr), + vim.diagnostic.is_disabled(diagnostic_bufnr, diagnostic_ns), + vim.diagnostic.is_disabled(_, diagnostic_ns), + } + ]]) + end) end) end) diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index 8e689fb378..1c9ac7f7ba 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -4,10 +4,12 @@ local clear, feed = helpers.clear, helpers.feed local source = helpers.source local command = helpers.command local assert_alive = helpers.assert_alive +local poke_eventloop = helpers.poke_eventloop local exec = helpers.exec local eval = helpers.eval local eq = helpers.eq local is_os = helpers.is_os +local meths = helpers.meths local function new_screen(opt) local screen = Screen.new(25, 5) @@ -1387,17 +1389,21 @@ describe('cmdheight=0', function() ]]) end) - it("clears cmdline area when resized with external messages", function() + it("cannot be resized at all with external messages", function() clear() screen = new_screen({rgb=true, ext_messages=true}) - command('set laststatus=2 cmdheight=0') + command('set laststatus=2 mouse=a') command('resize -1') screen:expect([[ ^ | {1:~ }| {1:~ }| + {1:~ }| {3:[No Name] }| - | ]]) + meths.input_mouse('left', 'press', '', 0, 6, 10) + poke_eventloop() + meths.input_mouse('left', 'drag', '', 0, 5, 10) + screen:expect_unchanged() end) end) diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 038b9739a5..6759510ad1 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1373,9 +1373,9 @@ describe('float window', function() [2:----------------------------------------]| [3:----------------------------------------]| ## grid 2 - {20:1}{21: }{19: }{20: }{22:^x}{21: }| - {14:2 }{19: }{14: }{22:y} | - {14:3 }{19: }{14: }{22: } | + {20:1}{19: }{20: }{22:^x}{21: }| + {14:2}{19: }{14: }{22:y} | + {14:3}{19: }{14: }{22: } | {0:~ }| {0:~ }| {0:~ }| @@ -1389,9 +1389,9 @@ describe('float window', function() ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ - {20:1}{21: }{19: }{20: }{22:^x}{21: }| - {14:2 }{19: }{14: }{22:y} | - {14:3 }{19: }{14: }{22: } {15:x } | + {20:1}{19: }{20: }{22:^x}{21: }| + {14:2}{19: }{14: }{22:y} | + {14:3}{19: }{14: }{22: } {15:x } | {0:~ }{15:y }{0: }| {0:~ }{15: }{0: }| {0:~ }{15: }{0: }| diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index f7ffe16bd6..3052a74f38 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -908,6 +908,13 @@ stack traceback: {1:~ }| ]]} end) + + it('does not truncate messages', function() + command('write Xtest') + screen:expect({messages={ + {content = { { '"Xtest" [New] 0L, 0B written' } }, kind = "" } + }}) + end) end) describe('ui/builtin messages', function() @@ -1452,7 +1459,6 @@ describe('ui/ext_messages', function() feed(":set mouse=a<cr>") meths.input_mouse('left', 'press', '', 0, 12, 10) poke_eventloop() - meths.input_mouse('left', 'drag', '', 0, 12, 10) meths.input_mouse('left', 'drag', '', 0, 11, 10) feed("<c-l>") feed(":set cmdheight<cr>") diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 8670411b7c..0d874ae79d 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -2464,8 +2464,130 @@ describe('builtin popupmenu', function() {1:~ }{n: xyz }{1: }| :e あいう/123^ | ]]) + feed('<Esc>') - feed('<esc>') + -- Pressing <PageDown> should scroll the menu downward + feed(':sign <Tab><PageDown>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{s: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign undefine^ | + ]]) + feed('<PageDown>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{s: unplace }{1: }| + :sign unplace^ | + ]]) + feed('<PageDown>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign ^ | + ]]) + feed('<PageDown>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{s: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign define^ | + ]]) + feed('<C-U>sign <Tab><Right><Right><PageDown>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{s: unplace }{1: }| + :sign unplace^ | + ]]) + + -- Pressing <PageUp> should scroll the menu upward + feed('<C-U>sign <Tab><PageUp>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign ^ | + ]]) + feed('<PageUp>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{s: unplace }{1: }| + :sign unplace^ | + ]]) + feed('<PageUp>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{n: define }{1: }| + {1:~ }{s: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign jump^ | + ]]) + feed('<PageUp>') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }{s: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {1:~ }{n: place }{1: }| + {1:~ }{n: undefine }{1: }| + {1:~ }{n: unplace }{1: }| + :sign define^ | + ]]) + + feed('<Esc>') -- check positioning with multibyte char in pattern command("e långfile1") @@ -2562,7 +2684,7 @@ describe('builtin popupmenu', function() ]]) end) - it('wildoptions=pum with scrolled messages ', function() + it('wildoptions=pum with scrolled messages', function() screen:try_resize(40,10) command('set wildmenu') command('set wildoptions=pum') diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index a1683a32c9..7dcd4cff25 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -156,6 +156,9 @@ describe('Signs', function() {0:~ }| | ]]) + -- Check that 'statuscolumn' correctly applies numhl + command('set statuscolumn=%s%=%l\\ ') + screen:expect_unchanged() end) it('highlights the cursorline sign with culhl', function() @@ -233,11 +236,13 @@ describe('Signs', function() | ]]) command('set cursorlineopt=number') + command('hi! link SignColumn IncSearch') + feed('Go<esc>2G') screen:expect([[ {1:>>}a | {8:>>}^b | {1:>>}c | - {0:~ }| + {5: } | {0:~ }| {0:~ }| {0:~ }| @@ -249,6 +254,9 @@ describe('Signs', function() {0:~ }| | ]]) + -- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726) + command('set statuscolumn=%s') + screen:expect_unchanged() end) it('multiple signs #9295', function() diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua index 912c139ae4..a9d796c10b 100644 --- a/test/functional/ui/statuscolumn_spec.lua +++ b/test/functional/ui/statuscolumn_spec.lua @@ -77,6 +77,9 @@ describe('statuscolumn', function() 16│aaaaa | | ]]) + command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) + screen:expect_unchanged() + command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) command('set relativenumber') screen:expect([[ 4 4│aaaaa | @@ -94,6 +97,9 @@ describe('statuscolumn', function() 16 8│aaaaa | | ]]) + command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) + screen:expect_unchanged() + command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) command('norm 12GH') screen:expect([[ 4 0│^aaaaa | @@ -111,6 +117,9 @@ describe('statuscolumn', function() 16 12│aaaaa | | ]]) + command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) + screen:expect_unchanged() + command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) end) it('works with highlighted \'statuscolumn\'', function() @@ -181,6 +190,8 @@ describe('statuscolumn', function() [1] = {foreground = Screen.colors.Brown}, [2] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGrey}, [3] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey}, + [4] = {bold = true, foreground = Screen.colors.Brown}, + [5] = {background = Screen.colors.Grey90}, }) screen:expect([[ {1: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| @@ -206,91 +217,108 @@ describe('statuscolumn', function() command('sign place 3 line=6 name=piet1 buffer=1') command('sign place 4 line=6 name=piet2 buffer=1') screen:expect([[ - {1:>> 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | - {0:>!}{1: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | + {1:>>}{2: }{1: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │ }aaaaa | + {0:>!}{2: }{1: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │ }aaaaa | {1:>>}{0:>!}{1: 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | - {1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | - {1: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | - {1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {1: │ }aaaaa | - {1: 10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}| + {2: }{1: │ }aaaaa | + {2: }{1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │ }aaaaa | + {2: }{1: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │ }aaaaa | + {2: }{1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │ }aaaaa | + {2: }{1:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}| | ]]) command('norm zf$') -- Check that alignment works properly with signs after %= command("set stc=%C%=%{v:wrap?'':v:lnum}│%s\\ ") screen:expect([[ - {2: }{1: 4│>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1: 5│}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2:+}{1: 8│}{2: }{1: }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + | + ]]) + command('set cursorline') + screen:expect([[ + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2:+}{1: 8│ }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| - {2: }{1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2:+}{4: 8│}{2: }{4: }{5:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | | ]]) -- v:lnum is the same value on wrapped lines command("set stc=%C%=%{v:lnum}│%s\\ ") screen:expect([[ - {2: }{1: 4│>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 4│ }aaaaaa | - {2: }{1: 5│}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 5│ }aaaaaa | + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 4│}{2: }{1: }aaaaaa | + {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 5│}{2: }{1: }aaaaaa | {2: }{1: 6│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 6│ }aaaaaa | - {2: }{1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 7│ }aaaaaa | - {2:+}{1: 8│ }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| - {2: }{1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 9│ }aaaaaa | - {2: }{1:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1:10│ }aaaaaa | + {2: }{1: 6│}{2: }{1: }aaaaaa | + {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 7│}{2: }{1: }aaaaaa | + {2:+}{4: 8│}{2: }{4: }{5:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 9│}{2: }{1: }aaaaaa | + {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1:10│}{2: }{1: }aaaaaa | | ]]) -- v:relnum is the same value on wrapped lines command("set stc=%C%=\\ %{v:relnum}│%s\\ ") screen:expect([[ - {2: }{1: 4│>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 4│ }aaaaaa | - {2: }{1: 3│}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 3│ }aaaaaa | + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 4│}{2: }{1: }aaaaaa | + {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 3│}{2: }{1: }aaaaaa | {2: }{1: 2│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 2│ }aaaaaa | - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 1│ }aaaaaa | - {2:+}{1: 0│ }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 1│ }aaaaaa | - {2: }{1: 2│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: 2│ }aaaaaa | + {2: }{1: 2│}{2: }{1: }aaaaaa | + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 1│}{2: }{1: }aaaaaa | + {2:+}{4: 0│}{2: }{4: }{5:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 1│}{2: }{1: }aaaaaa | + {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: 2│}{2: }{1: }aaaaaa | | ]]) command("set stc=%C%=\\ %{v:wrap?'':v:relnum}│%s\\ ") screen:expect([[ - {2: }{1: 4│>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1: 3│}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | {2: }{1: 2│>>}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2:+}{1: 0│ }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | - {2: }{1: 2│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaa | + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2:+}{4: 0│}{2: }{4: }{5:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | + {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaa | | ]]) -- Up to 9 signs in a line @@ -303,19 +331,19 @@ describe('statuscolumn', function() command('sign place 10 line=6 name=piet2 buffer=1') command('sign place 11 line=6 name=piet1 buffer=1') screen:expect([[ - {2: }{1: 4│>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | - {2: }{1: 3│}{0:>!}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | + {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | + {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | {2: }{1: 2│>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | - {2:+}{1: 0│ }{3:^+-- 1 line: aaaaaaaaaaaaaaaaa}| - {2: }{1: 1│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | - {2: }{1: 2│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| - {2: }{1: │ }aaaaaaaaaaaaaaaaaaaa | + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | + {2:+}{4: 0│}{2: }{4: }{5:^+-- 1 line: aaaaaaaaaaaaaaaaa}| + {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | + {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaa | | ]]) end) @@ -347,5 +375,35 @@ describe('statuscolumn', function() eq('0 3 r 7', eval("g:testvar")) meths.input_mouse('right', 'press', '', 0, 3, 0) eq('0 4 r 7', eval("g:testvar")) + command('set laststatus=2 winbar=%f') + command('let g:testvar=""') + -- Check that winbar click doesn't register as statuscolumn click + meths.input_mouse('right', 'press', '', 0, 0, 0) + eq('', eval("g:testvar")) + -- Check that statusline click doesn't register as statuscolumn click + meths.input_mouse('right', 'press', '', 0, 12, 0) + eq('', eval("g:testvar")) end) + + it('fits maximum multibyte foldcolumn #21759', function() + command('set stc=%C fdc=9 fillchars=foldsep:𒀀') + for _ = 0,8 do command('norm zfjzo') end + screen:expect([[ + aaaaa | + aaaaa | + aaaaa | + aaaaa | + --------- ^aaaaa | + 𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀 aaaaa | + aaaaa | + aaaaa | + aaaaa | + aaaaa | + aaaaa | + aaaaa | + aaaaa | + | + ]]) + end) + end) diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index f099b4a36e..7ada1c4bea 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -662,4 +662,33 @@ describe('shell :!', function() 1]]) end end) + + it(':{range}! without redirecting to buffer', function() + local screen = Screen.new(500, 10) + screen:attach() + insert([[ + 3 + 1 + 4 + 2]]) + feed(':4verbose %w !sort<cr>') + if is_os('win') then + screen:expect{ + any=[[Executing command: .?sort %< .*]] + } + else + screen:expect{ + any=[[Executing command: .?%(sort%) %< .*]] + + } + end + feed('<CR>') + helpers.set_shell_powershell(true) + feed(':4verbose %w !sort<cr>') + screen:expect{ + any=[[Executing command: .?& { Get%-Content .* | & sort }]] + } + feed('<CR>') + helpers.expect_exit(command, 'qall!') + end) end) diff --git a/test/includes/CMakeLists.txt b/test/includes/CMakeLists.txt index b4da4c0611..0d30736091 100644 --- a/test/includes/CMakeLists.txt +++ b/test/includes/CMakeLists.txt @@ -23,7 +23,6 @@ foreach(hfile ${PRE_HEADERS}) COMMAND ${CMAKE_C_COMPILER} -std=c99 -E -P ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} ${gen_cflags} - -I${LIBUV_INCLUDE_DIRS} -o ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile}) list(APPEND POST_HEADERS ${post_hfile}) endforeach() |