aboutsummaryrefslogtreecommitdiff
path: root/test/functional
Commit message (Collapse)AuthorAge
* Merge branch 'colorcolchar' into HEADJosh Rahm2023-01-14
|\
| * feat(colorcolchar): revert "feat: rename colorcol in fillchars to colorc"Josh Rahm2022-08-30
| | | | | | | | | | This reverts commit 234959abbfcf075cb09304b00fc391780580056d and renames the option 'colorc' -> 'colorcol' again.
| * feat(colorcolchar): fix highlight_spec.luaJosh Rahm2022-08-30
| | | | | | | | | | Problem was interpreting a '|' as next command, causing vim to interpret set fillchars+=colorcol:| incorrectly
| * feat(colorcolchar): rename colorcol in fillchars to colorcJosh Rahm2022-08-30
| | | | | | | | Rename the colorcol option in fillchars to the more terse colorc.
| * feat(colorcolchar): add the option "colorcol" to the fillchars settingJosh Rahm2022-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This option will let neovim draw a character in the colorcolumn when there is no other character occupying that spot. For example, I'm someone who likes the elegance of seeing a 1px wide line at the 80 character mark, rather than a rectangle the width of a cell at that mark. To accomplish this, I run :set colorcol=80 :set fillchars=colorcol:│ of course ':' and '.' are good ASCII alteratives.
* | 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.
* | feat(lua): store "nvim -l" scriptname in _G.arg[0]Justin M. Keyes2023-01-07
| |
* | fix(tui): do not invoke loop recursively for pad()bfredl2023-01-06
| | | | | | | | fixes #21610
* | feat(lua): execute stdin ("-") as LuaJustin M. Keyes2023-01-05
| |
* | feat(lua): exit 1 on Lua "-l" script errorJustin M. Keyes2023-01-05
| |
* | feat(lua): send "--" literally to Lua "-l" scriptJustin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | Problem: When "-l" is followed by "--", we stop sending args to the Lua script and treat "--" in the usual way. This was for flexibility but didn't have a strong use-case, and has these problems: - prevents Lua "-l" scripts from handling "--" in their own way. - complicates the startup logic (must call nlua_init before command_line_scan) Solution: Don't treat "--" specially if it follows "-l".
* | feat(lua)!: execute Lua with "nvim -l"Justin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua scripts, especially scripts that take arguments or produce output. Solution: - support "nvim -l [args...]" for running scripts. closes #15749 - exit without +q - remove lua2dox_filter - remove Doxyfile. This wasn't used anyway, because the doxygen config is inlined in gen_vimdoc.py (`Doxyfile` variable). - use "nvim -l" in docs-gen CI job Examples: $ nvim -l scripts/lua2dox.lua --help Lua2DoX (0.2 20130128) ... $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2 $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l - TODO? -e executes Lua code -l loads a module -i enters REPL _after running the other arguments_.
* | dist: generated version of ccomplete.vim (#21623)TJ DeVries2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first PR featuring a conversion of an upstream vim9script file into a Lua file. The generated file can be found in `runtime/autoload/ccomplete.vim` in the vim repository. Below is a limited history of the changes of that file at the time of conversion. ``` ❯ git log --format=oneline runtime/autoload/ccomplete.vim c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files 4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files 20aac6c1126988339611576d425965a25a777658 Update runtime files. 30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files. b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files. 00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files. 8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a ... ``` The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated (for any bug fixes or new features, like implementing class and interface, the latest in vim9script). Further PRs will improve the DX of generated the converted lua and tracking which files in the neovim's code base have been generated.
* | fix(diff): avoid restoring invalid 'foldcolumn' value (#21650)zeertzjq2023-01-05
| | | | | | | | Use "0" for 'foldcolumn' when w_p_fdc_save is empty, like how "manual" is used for 'foldmethod' when w_p_fdm_save is empty.
* | fix(tui): make a copy of data->params before unibi_format() (#21643)zeertzjq2023-01-05
| | | | | | | | | | | | | | | | Problem: When unibi_format() modifies params and data->buf overflows, unibi_format() is called again, causing the params to be modified twice. This can happen for escapes sequences that use the %i terminfo format specifier (e.g. cursor_address), which makes unibi_format() increase the param by 1. Solution: Make a copy of data->params before calling unibi_format().
* | test(tui_spec): avoid race between nvim_paste and nvim_input (#21639)zeertzjq2023-01-04
| | | | | | | | | | Now that the TUI calls nvim_paste and nvim_input through RPC, the data race is much more likely, as nvim_paste is deferred while nvim_input is not. Add an expect_child_buf_lines() call to avoid the race.
* | docs: fix typos (#21427)dundargoc2023-01-04
| | | | | | | | | | | | Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Tomas Nemec <nemi@skaut.cz>
* | fix(clipboard): show provider warning when not during batch changes #21451zeertzjq2023-01-03
| | | | | | | | It is strange that Ex commands that explicitly interact with the clipboard show provider warning, but Normal mode commands do not.
* | Merge pull request #21633 from gpanders/editorconfigGregory Anders2023-01-03
|\ \ | | | | | | Builtin EditorConfig support
| * | test(editorconfig): add editorconfig testsGregory Anders2023-01-03
| | |
* | | fix(fs): duplicate path separator #21509Eric Haynes2023-01-03
| | | | | | | | | Fixes #21497
* | | Merge #21580 cmdline issues with cmdheight=0Justin M. Keyes2023-01-03
|\ \ \ | |/ / |/| |
| * | test: add test cases for command line issuesLuuk van Baal2022-12-31
| | |
* | | feat(lsp): add function to clear codelens (#21504)Mathias Fußenegger2022-12-31
| | | | | | | | | | | | | | | | | | | | | | | | Currently once you retrieve the lenses you're pretty much stuck with them as saving new lenses is additive. Adding a dedicated method to reset lenses allows users to toggle lenses on/off which can be useful for language servers where they are noisy or expensive and you only want to see them temporary.