aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
Commit message (Collapse)AuthorAge
* docs: small fixesdundargoc2023-10-10
| | | | | | Co-authored-by: Wansmer <wansmer@gmail.com> Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com> Co-authored-by: David Moberg <david.moberg@mediatek.com>
* feat: ignore swapfile for running Nvim processes #25336Justin M. Keyes2023-10-04
| | | | | | | | | | | | | | | | | | | Problem: The swapfile "E325: ATTENTION" dialog is displayed when editing a file already open in another (running) Nvim. Usually this behavior is annoying and irrelevant: - "Recover" and the other options ("Open readonly", "Quit", "Abort") are almost never wanted. - swapfiles are less relevant for "multi-Nvim" since 'autoread' is enabled by default. - Even less relevant if user enables 'autowrite'. Solution: Define a default SwapExists handler which does the following: 1. If the swapfile is owned by a running Nvim process, automatically chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile, which is mostly harmless and ignored except by `:recover` or `nvim -r`. 2. Shows a 1-line "ignoring swapfile..." message. 3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
* test: only trim trailing spaces in swapfile tests (#25341)zeertzjq2023-09-24
|
* fix(startup): stop TUI properly when quitting at swap dialog (#25337)zeertzjq2023-09-24
|
* fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | followup to #24109 fix #16150
* fix(remote): make --remote-expr print to stdout (#23980)zeertzjq2023-06-11
|
* fix(helptags): make multibyte help tags work properly (#23975)zeertzjq2023-06-11
|
* feat(:source): source current ft=lua buffer as Lua code (#23802)zeertzjq2023-06-02
|
* test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque2023-05-22
| | | | `nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* vim-patch:8.2.3887: E1135 is used for two different errorszeertzjq2023-05-08
| | | | | | | | | Problem: E1135 is used for two different errors. Solution: Renumber one error. https://github.com/vim/vim/commit/806da5176e9e9ab011d927c4ca33a8dde1769539 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1978: making a mapping work in all modes is complicatedzeertzjq2023-05-08
| | | | | | | | | | | | | Problem: Making a mapping work in all modes is complicated. Solution: Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282, closes 4784, based on patch by Bjorn Linse) https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d Change docs to match Vim if it's wording is better. Change error numbers to match Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(excmd): append original command to error messagezeertzjq2023-05-05
| | | | | | | | | | Revert the change to do_cmdline_cmd() from #5226. This function is used in many places, so making it different from Vim leads to small differences from Vim in the behavior of some functions like execute() and assert_fails(). If DOCMD_VERBOSE really needs to be removed somewhere, a do_cmdline() call without DOCMD_VERBOSE is also shorter than a do_cmdline() call with DOCMD_VERBOSE.
* vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
* docs(powershell): use tee.exe instead of Tee-ObjectT7272023-04-22
| | | | | | | Problem: Tee-Object does not create a file if it does not receive input for example when :grep does not find matches. and so nvim tries to open a nonexistent errorfile causing an error. Solution: use tee.exe instead of Tee-Object
* fix(usercmd): Fix buffer overflow in uc_list() (#23225)Andreas Schneider2023-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fix(usercmd): fix buffer overflow in uc_list() Build with: -Wp,-D_FORTIFY_SOURCE=3 -O1 and gcc 13. *** buffer overflow detected ***: terminated (gdb) bt #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78 #2 0x00007f3eb8b42aee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007f3eb8b2b87f in __GI_abort () at abort.c:79 #4 0x00007f3eb8b2c60f in __libc_message (fmt=fmt@entry=0x7f3eb8ca72e6 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:150 #5 0x00007f3eb8c27b29 in __GI___fortify_fail (msg=msg@entry=0x7f3eb8ca728c "buffer overflow detected") at fortify_fail.c:24 #6 0x00007f3eb8c26364 in __GI___chk_fail () at chk_fail.c:28 #7 0x00007f3eb8c25f45 in ___snprintf_chk (s=s@entry=0x55b8c7c096a5 <IObuff+5> "t' item", maxlen=maxlen@entry=1025, flag=flag@entry=2, slen=slen@entry=1020, format=format@entry=0x55b8c7b872a6 "%ldc") at snprintf_chk.c:29 #8 0x000055b8c7aea59f in snprintf (__fmt=0x55b8c7b872a6 "%ldc", __n=1025, __s=0x55b8c7c096a5 <IObuff+5> "t' item") at /usr/include/bits/stdio2.h:54 #9 uc_list (name=name@entry=0x55b8c8351788 "Explore", name_len=name_len@entry=7) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:534 #10 0x000055b8c7aeb8a0 in ex_command (eap=0x7fffdc350e60) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:1009 #11 0x000055b8c7972537 in execute_cmd0 (retv=retv@entry=0x7fffdc350e54, eap=eap@entry=0x7fffdc350e60, errormsg=errormsg@entry=0x7fffdc350e58, preview=preview@entry=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:1620 #12 0x000055b8c7975c55 in do_one_cmd (cmdlinep=cmdlinep@entry=0x7fffdc3510b8, flags=flags@entry=0, cstack=cstack@entry=0x7fffdc351140, fgetline=fgetline@entry=0x55b8c79882b8 <getexline>, cookie=cookie@entry=0x0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:2279 #13 0x000055b8c79767fe in do_cmdline (cmdline=<optimized out>, fgetline=0x55b8c79882b8 <getexline>, cookie=0x0, flags=0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:578 #14 0x000055b8c7a17463 in nv_colon (cap=0x7fffdc351780) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:3228 #15 0x000055b8c7a11b35 in normal_execute (state=0x7fffdc351700, key=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:1196 #16 0x000055b8c7ab0994 in state_enter (s=0x7fffdc351700) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/state.c:99 #17 0x000055b8c7a0ef68 in normal_enter (cmdwin=false, noexmode=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:497 #18 0x000055b8c78a0640 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641
* fix(excmd): make :def unknown rather than unimplemented (#23150)zeertzjq2023-04-17
|
* fix(highlight): add missing g: prefix for colors_name (#22952)zeertzjq2023-04-08
| | | | Fix #22951. This was fixed in Vim in patch 8.2.0613.
* test: replace lfs with luv and vim.fsdundargoc2023-04-04
| | | | | | test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
* test: use exec_capture() in more places (#22787)zeertzjq2023-03-26
| | | | | | | Problem: Using `meths.exec2("code", { output = true })` is too verbose. Solution: Use exec_capture() in more places.
* feat(api): nvim_exec2(), deprecate nvim_exec() #19032Evgeni Chasnovski2023-03-25
| | | | | | | Problem: The signature of nvim_exec() is not extensible per ":help api-contract". Solution: Introduce nvim_exec2() and deprecate nvim_exec().
* fix(shell): on Windows :make does not echo #22728Enan Ajmain2023-03-19
| | | | | | | | | | | | | | Problem: On Windows, :make does not display the output of the program it runs. The cause is the default 'shellpipe'. On Linux, nvim uses `tee` to redirect the output to both stdout and the error file. In Windows, for both cmd.exe and powershell, the output is only redirected to the error file. Solution: - On Windows, change the 'shellpipe' default to "2>&1| tee". - Nvim includes `tee` in its Windows package. - Document recommended defaults for powershell. Fixes #12910
* refactor(redraw): make cursor position redraw use the "redraw later" patternbfredl2023-03-12
|
* ci: bump to windows 2022dundargoc2023-03-11
| | | | Skip failing funcitonaltests. Use jobstart() instead termopen() for oldtests to prevent CI freezing.
* fix(api): set script context when setting usercmd or option (#22624)zeertzjq2023-03-11
|
* fix(highlight): avoid ORing underline flags (#22372)zeertzjq2023-02-23
| | | | | When combining attributes use the one that takes priority. For :highlight command use the last one specified. For API use a hard-coded order same as the order in docs.
* test: make {MATCH:} behave less unexpectedly in screen:expect()zeertzjq2023-02-18
| | | | Include the rest of the line and allow multiple {MATCH:} patterns.
* fix(rpc)!: preseve files when stdio channel is closed (#22137)zeertzjq2023-02-11
| | | | BREAKING CHANGE: Unsaved changes are now preserved rather than discarded when stdio channel is closed.
* test: add more tests for Unicodezeertzjq2023-01-09
|
* fix(mappings): use all buckets in second round of unmap (#21534)zeertzjq2022-12-26
|
* feat(secure): add `:trust` command and vim.secure.trust() (#21107)Jlll12022-11-28
| | | | | | | | | Introduce vim.secure.trust() to programmatically manage the trust database. Use this function in a new :trust ex command which can be used as a simple frontend. Resolves: https://github.com/neovim/neovim/issues/21092 Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: ii14 <ii14@users.noreply.github.com>
* test: simplify platform detection (#21020)dundargoc2022-11-22
| | | | | Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`.
* test: add a Lua test for swap file created before bootzeertzjq2022-11-17
| | | | Change the file modification time instead of uptime.
* test: introduce skip() #21010dundargoc2022-11-13
| | | | | | | This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`.
* vim-patch:8.2.2207: illegal memory access if popup menu items are changed ↵zeertzjq2022-11-12
| | | | | | | | | | | (#21028) Problem: Illegal memory access if popup menu items are changed while the menu is visible. (Tomáš Janoušek) Solution: Make a copy of the text. (closes vim/vim#7537) https://github.com/vim/vim/commit/38455a921395a56690790c8c1d28c1c43ca04c8a Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat: ":write ++p" creates parent dirs #20835Victor Blanchard2022-11-06
| | | | | | | | | | | - `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if they do not exist - Note: `:foo ++…` is usually for options. No existing options have a single-char abbreviation (presumably by design), so it's safe to special-case `++p` here. - Same for `writefile(…, 'foo/bar/baz.txt', 'p')` - `BufWriteCmd` can see the ++p flag via `v:cmdarg`. closes #19884
* docs: fix typosdundargoc2022-11-02
|
* ci: add cirrus to isCI function to skip tests (#20526)dundargoc2022-10-17
| | | | The environment variable CIRRUS_CI is manually passed to RunTests.cmake as it doesn't get passed when using cmake script mode.
* docs: fix typos (#20394)dundargoc2022-09-30
| | | | | Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(api): notify dict watchers on nvim_set_var and vim.g settersmolck2022-09-27
| | | | | Co-authored-by: bfredl <bjorn.linse@gmail.com> Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* ci: move BSD jobs from sourcehut to Cirrus CI #19616dundargoc2022-09-08
| | | | | | | | | | | | | | | | | | | dispatch.sr.ht is being deprecated, meaning that using sourcehut CI won't be possible (see https://github.com/neovim/neovim/issues/19609). Since Github Actions doesn't provide any BSD runners an external service is required and Cirrus CI seems like a good replacement for sourcehut. Initially experimented with using FreeBSD and OpenBSD virtual machines in GitHub Actions, but Cirrus has been a much better fit with better performance, logs and overall experience. Failing tests are automatically skipped on FreeBSD regardless if it's on CI or not. Ideally these tests should only be skipped in CI with the help of `isCI` helper function. Unfortunately, the tests don't recognize the environment variable CIRRUS_CI even if it's set manually. This workaround is good enough for the time being, but we might want to only skip tests when using the CI (or even better, fix the failing tests). Closes: https://github.com/neovim/neovim/issues/19609
* vim-patch:9.0.0409: #{g:x} was seen as a curly-braces expressionii142022-09-08
| | | | | | Problem: #{g:x} was seen as a curly-braces expression. Solution: Do never see #{} as a curly-braces expression. (closes vim/vim#11075) https://github.com/vim/vim/commit/7c7e1e9b98d4e5dbe7358c795a635c6f1f36f418
* vim-patch:8.2.3102: test for crash fix does not fail without the fix (#20018)zeertzjq2022-08-31
| | | | | | | Problem: Test for crash fix does not fail without the fix. Solution: Adjust the test sequence. (closes vim/vim#8506) https://github.com/vim/vim/commit/3777d6e32b22f0a70b774760c24160079e303bad Cherry-pick CheckUnix from patch 8.2.1432.
* vim-patch:8.2.4726: cannot use expand() to get the script namezeertzjq2022-08-23
| | | | | | | | | Problem: Cannot use expand() to get the script name. Solution: Support expand('<script>'). (closes vim/vim#10121) https://github.com/vim/vim/commit/6013d0045dec7ca7c0068fbe186c42d754a7368b Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported. Cherry-pick builtin.txt expand() doc from latest Vim.
* test: add test for using :normal to stop Visual mode in cmdwin (#19904)zeertzjq2022-08-23
|
* fix(tests): remove irrelevant usage of display-=msgsepbfredl2022-08-17
| | | | | | | | These were just added to avoid churn when changing the default of 'display'. To simplify message handling logic, we might want to remove support for printing messages in default_grid later on. This would allow things like printing error messages safely in the middle of redraw, or a future graduation of the 'multigrid' feature.
* feat: allow :wincmd to accept a count (#19815)Famiu Haque2022-08-17
| | | | | | | | | | | | | | | Let :wincmd command accept a count like what its documentation suggests. Previously it could only accept a range, which led to some ambiguity on which attribute should be used when executing :wincmd using nvim_cmd. Closes #19662. Also fix a typo in a related Vim test: vim-patch:9.0.0223: typo in diffmode test Problem: Typo in diffmode test. Solution: Fix the typo. (closes vim/vim#10932) https://github.com/vim/vim/commit/5fd6ab820b4a0aaa5c6020852f39d118375fab49
* fix(source): fix expand('<sfile>') no longer works for Luazeertzjq2022-08-16
|
* fix(source): make changing 'shellslash' change expand() resultzeertzjq2022-08-15
|
* vim-patch:8.2.1280: Ex command error cannot contain an argumentzeertzjq2022-08-07
| | | | | | | | | Problem: Ex command error cannot contain an argument. Solution: Add ex_errmsg() and translate earlier. Use e_trailing_arg where possible. https://github.com/vim/vim/commit/8930caaa1a283092aca81fdbc3fcf15c7eadb197 Remove duplicate test file 062_tab_pages_spec.lua