aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
| * test: add tests for keypad keys from kitty keyboard protocolzeertzjq2022-07-04
| |
* | vim-patch:8.2.0614: get ml_get error when deleting a line in 'completefunc' ↵zeertzjq2022-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | (#19244) Problem: Get ml_get error when deleting a line in 'completefunc'. (Yegappan Lakshmanan) Solution: Lock the text while evaluating 'completefunc'. https://github.com/vim/vim/commit/ff06f283e3e4b3ec43012dd3b83f8454c98f6639 Fix a mistake in the porting of patch 8.1.0098. Cherry-pick Test_run_excmd_with_text_locked() from patch 8.2.0270. Cherry-pick test_gf.vim changes from patch 8.2.0369. Cherry-pick message change from later patches.
* | feat: add 'mousescroll' option (#12355)Jay2022-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'mousescroll' option to control how many lines to scroll by when a mouse wheel keycode is received. The mousescroll option controls both horizontal and vertical scrolling. The option is a string in the format: set mousescroll=direction:count,direction:count Where direction is either "ver" or "hor", and count is a non negative integer. If a direction is omitted, a default value is used. The default values remain unchanged, that is 3 for vertical scrolling, and 6 for horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6". Add mousescroll documentation - Add option documentation in options.txt - Add brief summary in quickref.txt Update :help scroll-mouse-wheel - Mention mousescroll option as a means of controlling scrolling. - Remove obsolete suggestion to map scroll wheel keys to <C-U> to scroll by a single line -- users should prefer the mousescroll option. - Add some information about the consequences of remapping scroll wheel keys (they lose their magic ability to affect inactive windows). Update :help vim-differences - Add brief mousescroll summary under Options Add mousescroll tests - Test option validation - Test default mousescroll value and behavior - Test fallback to default values - Test mouse vertical and horizontal scrolling in normal mode - Test mouse vertical and horizontal scrolling in insert mode
* | fix(mark): fix unexpected cursor movements (#19253)zeertzjq2022-07-06
| |
* | fix(terminal): crash if TermClose deletes own buffer #19222Justin M. Keyes2022-07-05
| | | | | | | | | | | | | | | | - Partially fixes #10386 except for the case where the alternate buffer is the default, empty, first buffer created on startup. #vimlife - TODO: port patches related to `can_unload_buffer`, maybe that fully fixes #10386? vim-patch:8.0.1732: crash when terminal API call deletes the buffer
* | fix(mark): mark without a view restores at topline #19224zeertzjq2022-07-04
| | | | | | | | | | For a local mark without a view, currently trying to restore its view will put the cursor at topline, which is not the correct behavior. Initialize `topline_offset` to `MAXLNUM` instead to fix this.
* | fix(tui): resize at startup #17795Javier Lopez2022-07-04
|/ | | | | | | | | | | | | | | | | | * fix(test): screen.lua nil index When actual_rows and expected_rows are different avoid a nil index. * fix(tui): resize at startup The deleted code is not needed after 402b4e8. It caused the condition to false positive when the function was called more than once before startup (first normal mode). Being itself what set the dimension and not the user, locking the size of the screen to an incorrect size. Make got_winch an int to mitigate: tui_grid_resize changing the size of the host terminal between the signal handler and the call to sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't directly call the callback, the event loop does. Fixes #17285 Fixes #15044 Fixes #11330
* feat(api): add `unsilent` to command APIszeertzjq2022-07-03
|
* feat(ui): make right-click menu work properly with ext_multigridzeertzjq2022-07-01
| | | | Add tests both with and without ext_multigrid.
* vim-patch:8.0.1570: can't use :popup for a menu in the terminalzeertzjq2022-07-01
| | | | | | | Problem: Can't use :popup for a menu in the terminal. (Wei Zhang) Solution: Make :popup work in the terminal. Also fix that entries were included that don't work in the current state. https://github.com/vim/vim/commit/29a2c08d792e4458a0af8371f5341394829fce29
* cmdheight=0: fix bugs #18961Shougo2022-06-30
| | | | | | | | | | | | Continue of #16251 Fix #18953 Fix #18960 Fix #18958 Fix #18955 Fix #18970 Fix #18983 Fix #18995 Fix #19112
* feat(marks): restore viewport on jump #15831Javier Lopez2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** Refactor Previously most functions used to "get" a mark returned a position, changed the line number and sometimes changed even the current buffer. Now functions return a {x}fmark_T making calling context aware whether the mark is in another buffer without arcane casting. A new function is provided for switching to the mark buffer and returning a flag style Enum to convey what happen in the movement. If the cursor changed, line, columns, if it changed buffer, etc. The function to get named mark was split into multiple functions. - mark_get() -> fmark_T - mark_get_global() -> xfmark_T - mark_get_local() -> fmark_T - mark_get_motion() -> fmark_T - mark_get_visual() -> fmark_T Functions that manage the changelist and jumplist were also modified to return mark types. - get_jumplist -> fmark_T - get_changelist -> fmark_T The refactor is also seen mainly on normal.c, where all the mark movement has been siphoned through one function nv_gomark, while the other functions handle getting the mark and setting their movement flags. To handle whether context marks should be left, etc. ** Mark View While doing the refactor the concept of a mark view was also implemented: The view of a mark currently implemented as the number of lines between the mark position on creation and the window topline. This allows for moving not only back to the position of a mark but having the window look similar to when the mark was defined. This is done by carrying and extra element in the fmark_T struct, which can be extended later to also restore horizontal shift. *** User space features 1. There's a new option, jumpoptions+=view enables the mark view restoring automatically when using the jumplist, changelist, alternate-file and mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark] ** Limitations - The view information is not saved in shada. - Calls to get_mark should copy the value in the pointer since we are using pos_to_mark() to wrap and provide a homogeneous interfaces. This was also a limitation in the previous state of things.
* feat: stdpath('run'), /tmp/nvim.user/ #18993Justin M. Keyes2022-06-30
| | | | | | | | | | | | | | | | Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
* refactor(highlight)!: rename attributes to match Vim (#19159)zeertzjq2022-06-30
| | | | | | | | | Ref: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417 Rename: - `underlineline` to `underdouble` - `underdot` to `underdotted` - `underdash` to `underdashed` `underdouble` also now takes higher precedence than `undercurl`.
* fix(lsp): small bugs in snippet-parser #18998L3MON4D32022-06-29
| | | | | | | | | This fixes the following bugs: `${1:else_text}` -> format with if_text: "else_text" `${1:-else_text}` -> format with if_text: "else_text" `${1:}` in `format` (eg. empty else_text) -> error. `${1:}` (eg. empty placeholder) -> error. Thanks hrsh7th :)
* vim-patch:8.2.4378: incsearch HL broken when calling searchcount in ↵zeertzjq2022-06-29
| | | | | | | | | 'tabLine' (#19147) Problem: Incsearch highlight broken when calling searchcount() in 'tabLine' function. (Mirko Palmer) Solution: Save and restore the incsearch state. (Christian Brabandt, closes vim/vim#9763, closes vim/vim#9633) https://github.com/vim/vim/commit/6dd7424c7e6ab81998c29ca3526c41b75cfde5a1
* Merge pull request #19133 from famiu/feat/api/cmd_support_filterbfredl2022-06-29
|\ | | | | feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filter
| * feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filterFamiu Haque2022-06-28
| | | | | | | | | | | | Also fixes a memory leak in `parse_cmdline`. Closes #18954.
* | refactor(aucmd): call define_autocmd() directly for default autocmdsbfredl2022-06-28
| |
* | build: rename build-related dirsJustin M. Keyes2022-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Dirs "config", "packaging", and "third-party" are all closely related but this is not obvious from the layout. This adds friction for new contributors. Solution: - rename config/ to cmake.config/ - rename test/config/ to test/cmakeconfig/ because it is used in Lua tests: require('test.cmakeconfig.paths'). - rename packaging/ to cmake.packaging/ - rename third-party/ to cmake.deps/ (parallel with .deps/)
* | Merge #19060 memory leaksJustin M. Keyes2022-06-28
|\ \ | |/ |/|
| * fix(coverity/348300): free memory when overiding sing attributeThomas Vigouroux2022-06-27
| | | | | | | | | | Nothing prevent the user from doing `:sign define abc culhl=Normal culhl=Normal` and thus this leads to an obvious memory leak.
* | fix(vim.ui.input): accept nil or empty "opts" #191090x74696d6d792022-06-28
| | | | | | Fix #18143
* | fix(inccommand): parse the command to check if it is previewableFamiu Haque2022-06-28
| | | | | | | | | | Free regprog if command isn't previewable Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* | fix(api): nvim_parse_cmd check for ambiguous user command (#19116)zeertzjq2022-06-27
| |
* | test: use "python3" to avoid skipped test #19106Justin M. Keyes2022-06-26
| | | | | | | | | | | | | | | | Problem: The "calls executable in $PATH" is skipped on some CI jobs because "python" is not found. Solution: Use "python3" instead.
* | Merge pull request #19091 from clason/do-aucmd-patsChristian Clason2022-06-26
|\ \ | | | | | | feat(api): support pattern array for exec_autocmds
| * | feat(api): support pattern array for exec_autocmdsChristian Clason2022-06-26
| | |
* | | refactor(filetype)!: allow vim.filetype.match to use different strategies ↵Gregory Anders2022-06-26
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#18895) This enables vim.filetype.match to match based on a buffer (most accurate) or simply a filename or file contents, which are less accurate but may still be useful for some scenarios. When matching based on a buffer, the buffer's name and contents are both used to do full filetype matching. When using a filename, if the file exists the file is loaded into a buffer and full filetype detection is performed. If the file does not exist then filetype matching is only performed against the filename itself. Content-based matching does the equivalent of scripts.vim, and matches solely based on file contents without any information from the name of the file itself (e.g. for shebangs). BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead of `vim.filetype.match(name, bufnr)`
* | refactor(tests): introduce testprg()Justin M. Keyes2022-06-25
| | | | | | | | | | | | Also: - Add a describe('shell :!') section to system_spec. - Make the test for #16271 work on systems without powershell.
* | fix: make_filter_cmd for :! powershell #15913Enan Ajmain2022-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim fails to create tempfile "…/nvim6UJx04/7" when 'shell' is set to pwsh (PowerShell Core). This breaks filtered shell commands ":{range}!". With shell set to cmd, it works. Solution: PowerShell doesn't use "<" for stdin redirection. Instead, use "-RedirectStandardInput". Closes #15913
* | Merge pull request #19041 from lewis6991/globallocalbfredl2022-06-25
|\ \ | |/ |/| fix(api): nvim_set_option_value for global-local options
| * fix(api): nvim_set_option_value for global-local optionsLewis Russell2022-06-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | global-local window options need to be handled specially. When `win` is given but `scope` is not, then we want to set the local version of the option but not the global one, therefore we need to force `scope='local'`. Note this does not apply to window-local only options (e.g. 'number') Example: nvim_set_option_value('scrolloff', 10, {}) -- global-local window option; set global value nvim_set_option_value('scrolloff', 20, {win=0}) -- global-local window option; set local value nvim_set_option_value('number', true, {}) -- local window option is now equivalent to: nvim_set_option_value('scrolloff', 10, {}) nvim_set_option_value('scrolloff', 20, {win=0, scope='local'}) -- changed from before nvim_set_option_value('number', true, {win=0}) -- unchanged from before Only the global-local option with a `win` provided gets forced to local scope.
* | fix(tests): remove misleading $TEST_PATH segment #19050Justin M. Keyes2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: RunTests.cmake adds $TEST_PATH to $TMPDIR with the implication that it gives more isolation. But this is misleading because $TEST_PATH is only defined once. Full test runs use the same $TMPDIR for all tests. This was likely added with the intention of invoking RunTests.cmake once-per-testfile from a wrapper than does the isolation/orchestration. But even so, Nvim's vim_maketempdir() / vim_mktempdir() _already_ creates a unique tempdir per session. Solution: Don't append $TEST_PATH to $TMPDIR. Avoids confusion and makes the path shorter.
* | fix(api): check for inclusive buffer line index out of bounds correctly (#19056)zeertzjq2022-06-23
| |
* | Merge pull request #19020 from echasnovski/screenchar-floatbfredl2022-06-23
|\ \ | | | | | | fix(float): make `screen*()` functions respect floating windows
| * | fix(float): make `screen*()` functions respect floating windowsEvgeni Chasnovski2022-06-23
| | | | | | | | | | | | Resolves #19013.
* | | fix(input): use correct grid when restoring cursor for <expr> mapping (#19047)zeertzjq2022-06-23
| | |
* | | fix(api): check error after getting win/buf handle (#19052)Gregory Anders2022-06-22
| | |
* | | fix(build): only pass -municode if MINGW #19049Justin M. Keyes2022-06-22
| |/ |/| | | | | | | Avoids this warning in the Windows build: 2022-06-22T08:58:13.0542153Z LINK : warning LNK4044: unrecognized option '/municode'; ignored [D:\a\neovim\neovim\build\test\functional\fixtures\printenv-test.vcxproj]
* | perf(highlight): don't allocate duplicates for color namesbfredl2022-06-21
| |
* | Merge pull request #18743 from gpanders/bowooptvalueGregory Anders2022-06-20
|\ \ | | | | | | Add "buf" and "win" to nvim_get_option_value and use them in vim.bo and vim.wo
| * | refactor: use nvim_{get,set}_option_value for vim.{b,w}oGregory Anders2022-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `nvim_get_option_value` and `nvim_set_option_value` better handle unsetting local options. For instance, this is currently not possible: vim.bo.tagfunc = nil This does not work because 'tagfunc' is marked as "local to buffer" and does not have a fallback global option. However, using :setlocal *does* work as expected :setlocal tagfunc= `nvim_set_option_value` behaves more like :set and :setlocal (by design), so using these as the underlying API functions beneath vim.bo and vim.wo makes those two tables act more like :setlocal. Note that vim.o *already* uses `nvim_set_option_value` under the hood, so that vim.o behaves like :set.
| * | feat(api): add "buf" and "win" to nvim_get_option_valueGregory Anders2022-06-20
| | | | | | | | | | | | These mirror their counterparts in nvim_set_option_value.
* | | perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl2022-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note for external UIs: Nvim can now emit multiple "redraw" event batches before a final "flush" event is received. To retain existing behavior, clients should make sure to update visible state at an explicit "flush" event, not just the end of a "redraw" batch of event. * Get rid of copy_object() blizzard in the auto-generated ui_event layer * Special case "grid_line" by encoding screen state directly to msgpack events with no intermediate API events. * Get rid of the arcane notion of referring to the screen as the "shell" * Array and Dictionary are kvec_t:s, so define them as such. * Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with a predetermined size within an arena. * Eliminate redundant capacity checking when filling such kvec_t:s with values.
* | | fix(decorations): nvim_buf_set_extmark breaks conceal #19010ii142022-06-19
| |/ |/| | | | | | | | | Closes #19007 Co-authored-by: bfredl <bjorn.linse@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* | fix(ci): noisy logs, unreliable test #19019Justin M. Keyes2022-06-18
|/ | | | | | | | | | | | | | | | | | | Problem: 1. CI logs have too many (40+) logs mentioning SIGHUP: ``` WRN 2022-06-18T16:05:47.075 T3568.22499.0/c deadly_signal:177: got signal 1 (SIGHUP) WRN 2022-06-18T16:05:47.273 T3569.91095.0/c deadly_signal:177: got signal 1 (SIGHUP) WRN 2022-06-18T16:05:47.651 T3570.59545.0/c deadly_signal:177: got signal 1 (SIGHUP) ``` 2. TS parser test still sometimes fails on BSD CI. 3. remote_spec test fails too often. Solution: 1. Log deadly signals at INFO level. It hasn't been helpful in CI, and for local troubleshooting it's reasonable to adjust the loglevel as needed. 2. Adjust the TS parser test again. ref #18911 3. Skip the remote_spec test. The `--remote` feature was merged before it was fully formed and needs to be revisited.
* fix(hl): return cterm fg/bg even if they match Normal #18981Oliver Marriott2022-06-16
| | | | | | | | | | Fixes #18980 - 831fa45ad84e is related but this doesn't regress that - The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally carried from patch to patch starting all the way back in 29bc6dfabde2 where it was avoiding setting a HL attr. But `hlattrs2dict()` now is just informational.
* test(treesitter): add benchmark #18989Lewis Russell2022-06-16
| | | add benchmark from #18109
* Merge #8519 feat: name, test ids, sockets in stdpath(state)Justin M. Keyes2022-06-17
|\