aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* test(filetype): port test_filetype to LuaGregory Anders2022-01-05
| | | | | | | | | | Because filetype.lua is gated behind an opt-in variable, it's not tested during the "standard" test_filetype.vim test. So port the test into filetype_spec where we enable the opt-in variable. This means runtime Vim patches will need to update test_filetype in two places. This can eventually be removed if/when filetype.lua is made opt-out rather than opt-in.
* fix(filetype): match on <afile> rather than <abuf> (#16943)Gregory Anders2022-01-05
| | | | | | | Filetype detection runs on BufRead and BufNewFile autocommands, both of which can fire without an underlying buffer, so it's incorrect to use <abuf> to determine the file path. Instead, match on <afile> and assume that the buffer we're operating on is the current buffer. This is the same assumption that filetype.vim makes, so it should be safe.
* feat(lsp): enable default debounce of 150 ms (#16908)Michael Lingelbach2022-01-05
|
* feat(autocmd): populate v:event in RecordingLeave (#16828)Axel Dahlberg2022-01-04
|
* test: fix absolute paths in filetype_spec (#16920)Gregory Anders2022-01-04
|
* chore: fix typos (#16816)dundargoc2022-01-04
| | | | | | | Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sebastian Volland <seb@baunz.net> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat: filetype.lua (#16600)Gregory Anders2022-01-04
| | | | Adds a new vim.filetype module that provides support for filetype detection in Lua.
* test: make test for #14040 more stable (#16911)Daniel Steinberg2022-01-04
|
* feat(lua): make =expr print result of exprshadmansaleh2022-01-04
|
* fix(lua): stricter type check when calling API function (#16745)dundargoc2022-01-03
| | | | | Solves #13651 Co-authored-by: Gregory Anders <greg@gpanders.com>
* fix(diagnostic): improve validation for list arguments (#16855)Gregory Anders2022-01-01
| | | | | | Function arguments that expect a list should explicitly use tbl_islist rather than just checking for a table. This helps catch some simple errors where a single table item is passed as an argument, which passes validation (since it's a table), but causes other errors later on.
* feat(lua): add support for multiple optional types in vim.validate (#16864)Shadman2022-01-01
|
* test: make some tests more stable (#16860)zeertzjq2022-01-01
|
* feat(api): add support for lua function & description in keymapshadmansaleh2022-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behavioral changes: 1. Added support for lua function in keymaps in -------------------------------------------- - nvim_set_keymap Can set lua function as keymap rhs like following: ```lua vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references}) ``` Note: lua function can only be set from lua . If api function being called from viml or over rpc this option isn't available. - nvim_{buf_}get_keymap When called from lua, lua function is returned is `callback` key . But in other cases callback contains number of the function ref. - :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly. - :map commands for displaing rhs . For lua keymaps rhs is displayed as <Lua function ref_no> Note: lua keymap cannot be set through viml command / functions. - mapargs() When dict is false it returns string in `<Lua function ref_no>` format (same format as :map commands). When dict is true it returns ref_no number in `callback` key. - mapcheck() returns string in `<Lua function ref_no>` format (same format as :map commands). 2. Added support for keymap description --------------------------------------- - nvim_{buf_}set_keymap: added `desc` option in opts table . ```lua vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'}) ``` - nvim_{buf_}get_keymap: contains `desc` in returned list. - commands like `:nmap <leader>w` will show description in a new line below rhs. - `maparg()` return dict contains `desc`.
* vim-patch:8.2.3952: first line not redrawn when adding lines to an empty bufferzeertzjq2021-12-31
| | | | | | | Problem: First line not redrawn when adding lines to an empty buffer. Solution: Adjust the argument to appended_lines(). (closes vim/vim#9439, closes vim/vim#9438) https://github.com/vim/vim/commit/1fa3de1ce806ba18ebcc00c6d9a0678a84735463
* Merge pull request #16373 from zeertzjq/terminal-mouse-release-forwardBjörn Linse2021-12-28
|\ | | | | fix(terminal): correctly forward mouse events
| * fix(terminal): correctly forward mouse eventszeertzjq2021-12-27
| |
* | Merge pull request #16752 from gpanders/lua-user-commandsBjörn Linse2021-12-28
|\ \ | | | | | | feat(api): implement nvim_{add,del}_user_command
| * | feat(api): implement nvim_{add,del}_user_commandGregory Anders2021-12-28
| |/ | | | | | | | | Add support for adding and removing custom user commands with the Nvim API.
* / chore: fix typos (#16506)dundargoc2021-12-28
|/ | | | | | | | | Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com> Co-authored-by: Alef Pereira <ealefpereira@gmail.com> Co-authored-by: AusCyber <willp@outlook.com.au> Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
* fix(uri): change scheme pattern to not include the comma character (#16797)Dmytro Meleshko2021-12-26
|
* Merge pull request #16596 from ↵Björn Linse2021-12-26
|\ | | | | | | | | dm1try/do_not_leave_terminal_mode_after_mouse_activation do not leave Terminal mode after entering to it using a mouse
| * fix(terminal): ignore left-release mouse actiondm1try2021-12-10
| | | | | | | | | | | | | | | | | | if it is not proccesed by the terminal program to prevent leaving Terminal mode after using a mouse for window switching closes #9483 closes #8691
* | fix: do not save K_EVENT as lastc in Insert modezeertzjq2021-12-26
| | | | | | | | I'm also gonna move some other K_EVENT-related tests to vim_spec.lua
* | feat(lua): add vim.spell (#16620)Lewis Russell2021-12-25
| |
* | Merge pull request #16762 from zeertzjq/grid-truncate-pum-double-widthBjörn Linse2021-12-25
|\ \ | | | | | | Truncate double-width character at the end of popup menu correctly
| * | fix(pum_redraw): use grid_puts_len() to truncate the textzeertzjq2021-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nvim already resizes grid to the required width, so there is no need to truncate the text in pum_redraw(). What's more, truncation is currently done incorrectly because Vim patch 8.2.1995 was ported incorrectly. This nearly reverts the truncation part of Vim patch 8.2.1995, but not the part that reduces unnecessary calls to pum_redraw(). The original PR https://github.com/vim/vim/pull/7306 didn't explain much about which part of it actually reduces redraws.
* | | fix(options): disallow empty 'fdc' and 'scl' (#16765)Sean Dewar2021-12-24
|/ / | | | | | | | | | | | | | | | | Empty string values for these options aren't actually allowed, but check_opt_strings allows empty string options. It so happens that 'scl' handles empty string like "auto", but empty 'fdc' causes glitchiness (win_fdccol_count returns an incorrect value). Just disallow empty string values for these options completely.
* | fix(api): make nil value in nvim_set_option_value clear local value (#16710)Gregory Anders2021-12-21
| | | | | | | | For special options such as 'undolevels' and 'scrolloff', this sets the local value to the special "unset" value (e.g. -12345 for 'undolevels').
* | feat(lsp): add buf_detach_client (#16250)Michael Lingelbach2021-12-21
| | | | | | | | | | This allows the user to detach an active buffer from the language client. If no clients remain attached to a buffer, the on_lines callback is used to cancel nvim_buf_attach.
* | fix: update last cursor on first CursorMoved (#16698)Michael Lingelbach2021-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/neovim/neovim/issues/16625 https://github.com/neovim/neovim/issues/12923 The first defined CursorMoved autocommand will immediately fire if the cursor has previously moved upon definition of the autocommand. Plugins add dummy autocommands such as: ```lua autocmd CursorMoved * execute '' ``` to avoid this behavior. Instead, when defining a new CursorHold autocommand, force update the last cursor position. See https://github.com/vim/vim/issues/2053
* | Merge pull request #16294 from zeertzjq/test-fewest-iterationJames McCoy2021-12-18
|\ \ | | | | | | test: require fewest number of main loop iterations possible
| * | test: require fewest number of main loop iterations possiblezeertzjq2021-11-15
| | | | | | | | | | | | | | | Change exc_exec to pcall_err to reduce one main loop iteration. No need to call poke_eventloop() unless after nvim_input().
* | | Merge pull request #16707 from jamessan/filter-out-testsJames McCoy2021-12-18
|\ \ \ | | | | | | | | test: allow excluding functional/unti tests using TEST_FILTER_OUT
| * | | test: allow excluding functional/unit tests using TEST_FILTER_OUTJames McCoy2021-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Although this can already be done using `BUSTED_ARGS`, it complements our existing shortcut of `TEST_FILTER.` [skip ci]
* | | | feat(runtime): new checkhealth filetype (#16660)matveyt2021-12-18
|/ / /
* | | autocmd: RecordingEnter, RecordingLeave (#16684)Gregory Anders2021-12-18
|\ \ \
| * | | feat(autocmd): add Recording autocmdsThomas Vigouroux2021-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feat(eval): add reg_recorded() This function is used the get the last recorded register. style(Recording): rename handler to match suggestions fix(RecordingLeave): send autocommand earlier This makes the autocommand fire just before setting reg_recorded to reg_recording, this way we clearly show that we are actually just before actually quitting the recording mode.
* | | | fix(lsp): correctly align start and end range to codepoints during ↵Rishikesh Vaishnav2021-12-17
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incremental sync (#16670) Closes #16624 Fixes two issues with aligning the start position and end position to codepoints when calculating the start and end range. When aligning the start position: * use aligned byte index to calculate character index rather than the unadjusted byte When aligning the end position: * do not adjust the end byte if it falls on a UTF-8 codepoint * align byte to the first byte of the next codepoint rather than the last byte of the current codepoint * compute character character end range on the aligned byte index This commit also adds additional test coverage, including multibyte operations that previously failed before this commit.
* | | perf: pre-compile embedded Lua source into bytecode (#16631)Gregory Anders2021-12-16
| | | | | | | | | | | | | | | | | | The Lua modules that make up vim.lua are embedded as raw source files into the nvim binary. These sources are loaded by the Lua runtime on startuptime. We can pre-compile these sources into Lua bytecode before embedding them into the binary, which minimizes the size of the binary and improves startuptime.
* | | Merge pull request #16134 from zeertzjq/screenpos-borderBjörn Linse2021-12-16
|\ \ \ | | | | | | | | fix(screenpos, float): add top and left border adjustment
| * | | fix(screenpos, float): add top and left border adjustmentzeertzjq2021-12-15
| | | |
* | | | fix(terminal): fix resize crash with pending scrollback (#14891)Sean Dewar2021-12-15
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refresh_scrollback assumes pending scrollback rows exist only if the terminal window height decreased (or the screen was full). However, after accumulating scrollback, it's possible in some cases for the terminal height to increase before refresh_scrollback is called via invalidation (especially when the terminal buffer isn't initially displayed in a window before nvim_open_term), which may crash. As we'll have enough room for some scrollback rows, just append them to the top of the buffer until it fills the window, then continue with the previous logic for any remaining scrollback rows if necessary.
* | | test: expect the correct screen in TUI paste: big burst of input (#16656)zeertzjq2021-12-15
| | |
* | | Merge pull request #16602 from zeertzjq/tui-end-streamed-pasteJames McCoy2021-12-13
|\ \ \
| * | | fix(tui): end streamed paste correctly when key buffer is emptyzeertzjq2021-12-10
| | | |
* | | | feat(ts): add support for multiline nodes in get_node_text (#14999)Mathias Fußenegger2021-12-12
| | | | | | | | | | | | | | | | | | | | | | | | Based on https://github.com/neovim/neovim/pull/14445 This extends `vim.treesitter.query.get_node_text` to return the text that spans a node's range even if start_row ~= end_row.
* | | | test: remove references to misc1.czeertzjq2021-12-11
| | | |
* | | | feat: add autocommand event when search wraps around (#8487)Alejandro Exojo2021-12-10
|/ / /
* | | Merge pull request #16541 from jamessan/vim-8.2.3664James McCoy2021-12-09
|\ \ \ | | | | | | | | vim-patch:8.2.3664,8.2.3743,8.2.3747,8.2.3748,8.2.3757