aboutsummaryrefslogtreecommitdiff
path: root/test/functional
Commit message (Collapse)AuthorAge
* fix(semantic_tokens.lua): Fix nil tokens/data in semantic_tokens.luafix_semantic_tokens_pullJosh Rahm2023-01-19
| | | | | | | Some (poorly-implemented) LSPs can return an empty JSON object in LSP responses, which could cause tokens to be nil, which would eventually cause an error and a bad UI experience. This fix makes sure that the tokens variable is always set to a non-nil value.
* vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894)zeertzjq2023-01-19
| | | | | | | | | | | | | Problem: Command line completion popup menu positioned wrong when using a terminal window. Solution: Position the popup menu differently when editing the command line. (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035) https://github.com/vim/vim/commit/1104a6d0c2004d39e9b6cb8f804d12b628a69869 The test in the patch looks a bit hard to understand. Add a Lua test that is more straightforward. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(statusline): don't leak memory with truncated click labelszeertzjq2023-01-19
|
* fix(statusline): don't leak memory with zero-width click labelszeertzjq2023-01-19
| | | | | A zero-width click label isn't assigned to any click definition, so its function name should be freed when filling click definitions.
* vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 ↵zeertzjq2023-01-19
| | | | | | | | | | (#21883) Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work. https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(statuscolumn): always fill click defs array (#21878)zeertzjq2023-01-18
| | | | | | | | Click definitions are always filled for tabline, statusline and winbar, so they should also be always filled for statuscolumn, otherwise it will leak memory. Note: this doesn't actually change the existing code much, because of a typo in the existing code.
* fix(completion): correct what modes support fuzzy completionzeertzjq2023-01-17
|
* fix(tabline): avoid memory leak in tabline click definitions (#21847)luukvbaal2023-01-17
| | | | | | Problem: Memory is leaked in tabline click definitions since https://github.com/neovim/neovim/pull/21008. Solution: Add back a call to `stl_clear_click_defs()` that was lost in the refactor PR.
* fix: failing XDG test on Windows CIJustin M. Keyes2023-01-17
| | | | | | | | | | | | | Problem: Failing Windows CI: FAILED test/functional\options\defaults_spec.lua @ 361: XDG defaults with too long XDG variables are correctly set test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: /X/X/X" not found in log (last 10 lines): Xtest-defaults-log: FAILED test/functional\options\defaults_spec.lua @ 435: XDG defaults with XDG variables that can be expanded are not expanded test\helpers.lua:134: Pattern "Failed to start server: no such file or directory: %$XDG_RUNTIME_DIR%/" not found in log (last 10 lines): Xtest-defaults-log: Solution: The assert_log() statements are not relevant on Windows, because there XDG_RUNTIME_DIR is not used for creating servers, it uses \\.pipe\….
* test(statuscolumn): %l should follow default wrap behavior (#21766)Brian Koropoff2023-01-17
|
* Merge #21844 test: avoid noise in test logsJustin M. Keyes2023-01-16
|\
| * refactor(tests): lift retry() into assert_log()Justin M. Keyes2023-01-17
| |
| * test: avoid noise in NVIM_LOG_FILEJustin M. Keyes2023-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Tests that _intentionally_ fail certain conditions cause noise in $NVIM_LOG_FILE: $NVIM_LOG_FILE: /home/runner/work/neovim/neovim/build/.nvimlog (last 100 lines) WRN 2023-01-16T18:26:27.673 T599.7799.0 unsubscribe:519: RPC: ch 1: tried to unsubscribe unknown event 'doesnotexist' WRN 2023-01-16T18:29:00.557 ?.11151 server_start:163: Failed to start server: no such file or directory: /X/X/X/... WRN 2023-01-16T18:33:07.269 127.0.0.1:12345 server_start:163: Failed to start server: address already in use: 127.0.0.1 ... -- Output to stderr: module 'vim.shared' not found: no field package.preload['vim.shared'] no file './vim/shared.lua' no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared.lua' no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared/init.lua' no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared.lua' no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared/init.lua' no file './vim/shared.so' ... E970: Failed to initialize builtin lua modules Solution: - Log to a private $NVIM_LOG_FILE in tests that intentionally fail and cause ERR log messages. - Assert that the expected messages are actually logged.
* | fix(api): avoid memory leak with click functions in nvim_eval_statusline() ↵luukvbaal2023-01-17
|/ | | | | | | | | (#21845) Problem: Allocated click function memory is lost due to `nvim_eval_statusline()` not passing in a `StlClickRecord`. Solution: Do not allocate click function memory if `tabtab == NULL`. Resolve #21764, supersede #21842.
* Merge pull request #21768 from luukvbaal/test-virtlinezeertzjq2023-01-17
|\ | | | | | | | | | | | | | | fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines BREAKING CHANGE: In 'statuscolumn' evaluation, `v:wrap` has been replaced by `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
| * fix(column): avoid drawing columns for virt_lines_leftcolLuuk van Baal2023-01-16
| | | | | | | | | | | | | | | | Problem: The default fold column, as well as the 'statuscolumn', were drawn unnecessarily/unexpectedly for virtual lines placed with `virt_lines_leftcol` set. Solution: Skip the column states if a virtual line with `virt_lines_leftcol` set will be drawn.
| * fix(column)!: ensure 'statuscolumn' works with virtual and wrapped linesLuuk van Baal2023-01-16
| | | | | | | | | | | | | | | | | | | | Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
* | Merge pull request #21828 from clason/bump-libvtermChristian Clason2023-01-16
|\ \ | |/ |/| build(deps): bump libvterm to v0.3.1
| * build(deps): bump libvterm to v0.3.1Christian Clason2023-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Included patches: 821. By Paul "LeoNerd" Evans on 2022-12-29 Don't bother to emit the unrecognised sequence in DECRQSS response as it provides an echo roundtrip possibility 820. By Paul "LeoNerd" Evans on 2022-11-26 erase_internal() should only set fg/bg colour, resetting other attributes (especially RV) 819. By Paul "LeoNerd" Evans on 2022-11-09 Added vterm_screen_set_default_colors(), which repaints the cells in the buffer(s) 818. By Paul "LeoNerd" Evans on 2022-11-09 Permit either colour argument to be NULL to vterm_state_set_default_colors() 817. By Paul "LeoNerd" Evans on 2022-10-01 Delete the mk_wcswidth functions as they're not used; guard the CJK-wide one with an ifdef as by default we don't use it 816. By Paul "LeoNerd" Evans on 2022-10-01 Make sure to supply empty (void) prototype to functions that take no arguments in bin/vterm-ctrl.c
* | refactor: remove E5500, adjust testszeertzjq2023-01-16
| | | | | | | | | | | | Now with try_end() including more exception info, E5500 looks like redundant information. Adjust tests for more exception information.
* | feat(api): show more exception infoerw72023-01-16
|/
* Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenubfredl2023-01-15
|\ | | | | fix: properly close builtin popup in ext_popupmenu
| * fix: properly close builtin popup in ext_popupmenushirasaka2023-01-11
| |
* | test(fileio_spec): avoid expect_exit() without calling clear() (#21810)zeertzjq2023-01-15
| | | | | | | | | | Since before_each() doesn't call clear() in these tests, after_each() may call expect_exit() without calling clear() if a test is skipped, causing frequent test failures on Cirrus CI. Close the session instead.
* | vim-patch:8.2.4579: cannot use page-up and page-down in the cmdline popup menuzeertzjq2023-01-15
| | | | | | | | | | | | | | | | | | | | | | Problem: Cannot use page-up and page-down in the command line completion popup menu. Solution: Check for to page-up and page-down keys. (Yegappan Lakshmanan, closes vim/vim#9960) https://github.com/vim/vim/commit/5cffa8df7e3c28681b9e5deef6df395784359b6b Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | vim-patch:9.0.1195: restoring KeyTyped when building statusline not testedzeertzjq2023-01-14
| | | | | | | | | | | | | | Problem: Restoring KeyTyped when building statusline not tested. Solution: Add a test. Clean up and fix other tests. (closes vim/vim#11815) https://github.com/vim/vim/commit/378e6c03f98efc88e8c2675e05a548f9bb7889a1
* | vim-patch:8.2.4341: command line not redrawn when finishing popup menu (#21792)zeertzjq2023-01-14
| | | | | | | | | | | | | | | | | | | | | | Problem: Command line not redrawn when finishing popup menu and the screen has scrolled up. Solution: Redraw the command line after updating the screen. (closes vim/vim#9722) https://github.com/vim/vim/commit/414acd342f4a66d930da34d419929985b48bd301 Code change is N/A as Nvim doesn't call update_screen() here. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | fix(statuscolumn): make %l/%r respect 'number'/'relativenumber' (#21747)luukvbaal2023-01-13
| | | | | | Resolve https://github.com/neovim/neovim/issues/21745.
* | test: avoid consecutive mouse input at different positions (#21781)zeertzjq2023-01-13
| | | | | | | | The seconds call's position may override the first call if the first call isn't processed yet, defeating the purpose of the first call.
* | fix(ui): command line issues with external messages (#21709)luukvbaal2023-01-13
| | | | | | | | * fix: don't truncate external messages * fix: avoid resizing command line with external messages
* | fix(mouse): statusline click registered as statuscolumn (#21748)luukvbaal2023-01-13
| | | | | | | | | | | | | | | | fix(statuscolumn): statusline click registered as statuscolumn Problem: Status line click is registered as status status column click. Solution: Check that mouse is not on the status line. Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
* | fix(powershell): wrong length allocation for ":%w !" #20530Enan Ajmain2023-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The calculation of `len` in `make_filter_cmd` for powershell falls short by one character for the following ex command: :%w !sort This command satisfies these conditions: - `itmp` is not null - `otmp` is null __NOTE__ that other shells circumvent this bug only because of `len` allocation for six extra characters: a pair of curly braces and four spaces: https://github.com/neovim/neovim/blob/cfdb4cbada8c65aa57e69776bcc0f7b8b298317a/src/nvim/ex_cmds.c#L1551-L1554 If allocation for these six characters are removed, then bash also faces the same bug. Solution: Add allocation for 6 extra bytes. 1 would do, but let's keep powershell in sync with other shells as much as possible.
* | feat(diagnostic): vim.diagnostic.is_disabled() #21527Raphael2023-01-12
| |
* | fix(api): nvim_create_autocmd crash on invalid types inside pattern arrayii142023-01-12
| | | | | | Co-authored-by: ii14 <ii14@users.noreply.github.com>
* | fix(statuscolumn): foldcolumn buffer is too small (#21761)luukvbaal2023-01-12
| | | | | | Resolve https://github.com/neovim/neovim/issues/21759.
* | fix(statuscolumn): fix sign column highlights (#21727)luukvbaal2023-01-11
| | | | | | Resolve #21726.
* | build: use modern cmake (#21589)dundargoc2023-01-10
|/ | | | | | | | | | | | | | | | | | | | | Replace old-school cmake with the so-called "Modern CMake", meaning preferring using targets and properties over directory settings and variables. This allows greater flexibility, robustness and clarity over how the code works. The following deprecated commands will be replaced with their modern alternatives that operates on a specific target, rather than all targets in the current directory: - add_compile_options -> target_compile_options - include_directories -> target_include_directories - link_libraries -> target_link_libraries - add_definitions -> target_compile_definitions There are mainly four main targets that we currently use: nvim, libnvim, nvim-test (used by unittests) and ${texe} (used by check-single-includes). The goal is to explicitly define the dependencies of each target fully, rather than having everything be dependent on everything else.
* fix(statuscolumn): fix crashes and clang/PVS warnings (#21725)zeertzjq2023-01-10
|
* feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No easy way to position a LSP hover window relative to mouse. Solution: Introduce another option to the `relative` key in `nvim_open_win()`. With this PR it should be possible to override the handler and do something similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674 to have hover information displayed from the mouse. Test case: ```lua local util = require('vim.lsp.util') local function make_position_param(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) local row, col local mouse = vim.fn.getmousepos() row = mouse.line col = mouse.column offset_encoding = offset_encoding or util._get_offset_encoding(buf) row = row - 1 local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1] if not line then return { line = 0, character = 0 } end if #line < col then return { line = 0, character = 0 } end col = util._str_utfindex_enc(line, col, offset_encoding) return { line = row, character = col } end local make_params = function(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) offset_encoding = offset_encoding or util._get_offset_encoding(buf) return { textDocument = util.make_text_document_params(buf), position = make_position_param(window, offset_encoding), } end local hover_timer = nil vim.o.mousemoveevent = true vim.keymap.set({ '', 'i' }, '<MouseMove>', function() if hover_timer then hover_timer:close() end hover_timer = vim.defer_fn(function() hover_timer = nil local params = make_params() vim.lsp.buf_request( 0, 'textDocument/hover', params, vim.lsp.with(vim.lsp.handlers.hover, { silent = true, focusable = false, relative = 'mouse', }) ) end, 500) return '<MouseMove>' end, { expr = true }) ```
* fix(ui): set stc to empty in floatwin with minimal style (#21720)Raphael2023-01-10
| | | fix(ui): set stc to emtpy in floatwin with minimal style
* test(statuscolumn): add more tests for wrapped lines (#21718)zeertzjq2023-01-10
| | | | | | test(statuscolumn): add more tests more wrapped lines Also initialize a "relnum" variable to suppress a Coverity warning. The uninitialized value wasn't actually used by build_statuscol_str().
* feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
* Merge pull request #21702 from glepnir/fix_2bfredl2023-01-09
|\ | | | | fix(api): convert title_pos string in nvim_win_get_config
| * fix(ui): add test caseRaphael2023-01-09
| |
* | test: add more tests for Unicodezeertzjq2023-01-09
| |
* | test(tui_spec): doesn't use Unicode in cursor_address test (#21703)zeertzjq2023-01-09
|/ | | Using Unicode makes the test flaky because of #16245.
* test(tui_spec): improve cursor_address test (#21700)zeertzjq2023-01-09
|
* dist: transpile cfilter.vim => cfilter.lua #21662TJ DeVries2023-01-08
| | | | Vim has changed cfilter.vim from vimscript to vim9script. Nvim supports only vimscript, not vim9script.
* refactor(editorconfig)!: change editorconfig_enable to editorconfigGregory Anders2023-01-07
|
* feat(editorconfig): allow editorconfig to be toggled dynamicallyGregory Anders2023-01-07
| | | | | | | | | Rather than only check `editorconfig_enable` when the plugin is loaded, check it each time the autocommand fires, so that users may enable or disable it dynamically. Also check for a buffer local version of the variable, so that editorconfig can be enabled or disabled per-buffer.