aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript
Commit message (Collapse)AuthorAge
...
* 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>
* docs: fix typos (#20150)dundargoc2022-09-26
| | | | | | | Co-authored-by: Miguel Carneiro <mcarneiromorenas@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(mapset): remove existing abbreviation of same lhs (#20320)zeertzjq2022-09-24
|
* feat(ui): use msg_grid based implementation for cmdheight=0bfredl2022-09-15
|
* vim-patch:8.2.2646: Vim9: error for not using string doesn't mention argumentzeertzjq2022-09-12
| | | | | | Problem: Vim9: error for not using string doesn't mention argument. Solution: Add argument number. https://github.com/vim/vim/commit/f28f2ac425600b88da0bdcc12a82cd620f575681
* feat(mapset): support restoring Lua callback (#20024)zeertzjq2022-09-01
| | | | | | | vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly Problem: mapset() does not restore <Nop> mapping properly. Solution: Use an empty string for <Nop>. (closes vim/vim#11022) https://github.com/vim/vim/commit/92a3d20682d46359bb50a452b4f831659e799155
* fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
* vim-patch:8.2.0522: several errors are not tested for (#19901)zeertzjq2022-08-23
| | | | | | | | | | | | | | Problem: Several errors are not tested for. Solution: Add tests. (Yegappan Lakshmanan, closes vim/vim#5892) https://github.com/vim/vim/commit/ee4e0c1e9a81cb5d96e0060203a9033c2f28588e Omit Test_range() change: reverted in patch 8.2.0615. Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195. Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183. Make uniq() error behavior consistent with sort(). Cherry-pick Test_set_ttytype() change from patch 8.1.1826. Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim. Test_viminfo_error() is applicable. Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
* vim-patch:8.1.0832: confirm() is not tested (#19896)zeertzjq2022-08-23
| | | | | Problem: confirm() is not tested. Solution: Add a test. (Dominique Pelle, closes vim/vim#3868) https://github.com/vim/vim/commit/2e0500921891e4fec57e97d3c0021aa2d2b4d7ae
* vim-patch:partial:8.1.0822: peeking and flushing output slows down executionzeertzjq2022-08-15
| | | | | | | | | | | | | | | | | Problem: Peeking and flushing output slows down execution. Solution: Do not update the mode message when global_busy is set. Do not flush when only peeking for a character. (Ken Takata) https://github.com/vim/vim/commit/cb574f415486adff645ce384979bfecf27f5be8c Omit inchar() change: it breaks too many tests. N/A patches for version.c: vim-patch:8.2.5170: tiny issues Problem: Tiny issues. Solution: Tiny improvements. https://github.com/vim/vim/commit/944cc9ceba8868acd238264d4a3894803c566b37
* vim-patch:7.4.1168 (#19645)zeertzjq2022-08-13
| | | | | | Problem: This doesn't give the right result: eval(string(v:true)). (Nikolay Pavlov) Solution: Make the string "v:true" instead of "true". https://github.com/vim/vim/commit/f48aa160fdd7b8caa7678e1a2139244dd2bdc547
* test(let_spec): increase expect_exit() timeoutzeertzjq2022-08-05
| | | Test ":unlet self-referencing node in a List graph #6070" feeds many characters into typeahead, so a timeout of only 100 milliseconds sometimes fails. Change that timeout to 1000 milliseconds.
* feat(mapset): support restoring "replace_keycodes" and "desc"zeertzjq2022-08-01
|
* vim-patch:8.2.0815: maparg() does not provide enough information for mapset()zeertzjq2022-08-01
| | | | | | | | | | | | Problem: maparg() does not provide enough information for mapset(). Solution: Add "lhsraw" and "lhsrawalt" items. Drop "simplified" https://github.com/vim/vim/commit/9c65253fe702ea010afec11aa971acd542c35de2 vim-patch:9.0.0127: unused variable Problem: Unused variable. Solution: Remove the variable. (closes vim/vim#10829) https://github.com/vim/vim/commit/e95f22f63a1871b91e5508088e5ae4905ce28cd7
* vim-patch:9.0.0090: no error when assigning bool to a string option (#19539)zeertzjq2022-07-27
| | | | | Problem: No error when assigning bool to a string option with setwinvar(). Solution: Give an error (closes vim/vim#10766) https://github.com/vim/vim/commit/28f84e17b068daca2635692d279930dcb7a150d0
* test: deal with RPC call causing Nvim to exit laterzeertzjq2022-07-19
|
* fix(powershell): filter ":!" commands with args #19268Enan Ajmain2022-07-18
| | | | | | | | | | Problem: Since 0b9664f5240be4d9e9d6882fcd398970fd3a9532 powershell filtered :[range]! commands with args causes error: "Start-Process: A positional parameter cannot be found that accepts argument ..." Solution: Pass args to Start-Process via `-ArgumentList`. closes #19250
* fix(windows):exepath, stdpath return wrong slashes #19111Enan Ajmain2022-07-17
| | | | | | exepath and stdpath should respect shellslash and return path with proper file separator. Closes #13787
* fix(ex_cmds): correct flags for :const (#19387)zeertzjq2022-07-16
|
* feat(eval)!: input() support any type for "cancelreturn" in a dict (#19357)zeertzjq2022-07-14
|
* 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: 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
* 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.
* 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
* fix(float): make `screen*()` functions respect floating windowsEvgeni Chasnovski2022-06-23
| | | | Resolves #19013.
* feat(server): instance "name", store pipes in stdpath(state)Justin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | Problem: - Unix sockets are created in random /tmp dirs. - /tmp is messy, unclear when OSes actually clear it. - The generated paths are very ugly. This adds friction to reasoning about which paths belong to which Nvim instances. - No way to provide a human-friendly way to identify Nvim instances in logs or server addresses. Solution: - Store unix sockets in stdpath('state') - Allow --listen "name" and serverstart("name") to given a name (which is appended to a generated path). TODO: - is stdpath(state) the right place?
* feat(logging): include test-id in log messagesJustin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. Log messages (especially in CI) are hard to correlate with tests. 2. Since b353a5c05f02 #11886, dumplog() prints the logs next to test failures. This is noisy and gets in the way of the test results. Solution: 1. Associate an incrementing id with each test and include it in log messages. - FUTURE: add v:name so Nvim instances can be formally "named"? 2. Mention "child" in log messages if the current Nvim is a child (based on the presence of $NVIM). BEFORE: DBG … 12345 UI: event DBG … 12345 log_server_msg:722: RPC ->ch 1: … DBG … 12345 UI: flush DBG … 12345 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … 23454 UI: stop INF … 23454 os_exit:594: Nvim exit: 0 AFTER: DBG … T57 UI: event DBG … T57 log_server_msg:722: RPC ->ch 1: … DBG … T57 UI: flush DBG … T57 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … T57/child UI: stop INF … T57/child os_exit:594: Nvim exit: 0
* fix(tests): fix some screen.lua warningsbfredl2022-05-21
|
* feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009Justin M. Keyes2022-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM ------------------------------------------------------------------------ $NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the current process should listen on this address") and a descriptor ("the current process is a child of this address"). This contradiction means the presence of NVIM_LISTEN_ADDRESS is ambiguous, so child Nvim always tries to listen on its _parent's_ socket. This is the cause of lots of "Failed to start server" spam in our test/CI logs: WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0 WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0 SOLUTION ------------------------------------------------------------------------ 1. Set $NVIM to the parent v:servername, *only* in child processes. - Now the correct way to detect a "parent" Nvim is to check for $NVIM. 2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes. 3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after server init. 4. Open a channel to parent automatically, expose it as v:parent. Fixes #3118 Fixes #6764 Fixes #9336 Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696 Ref #8696
* fix(input): only disable mapped CTRL-C interrupts when getting input (#18310)zeertzjq2022-04-30
|
* fix: has() should preserve v:shell_error #18280Andrey Mishchenko2022-04-26
| | | fixes #18278
* test: correct order of arguments to eq() and neq()zeertzjq2022-04-26
|
* fix(ci): workaround bug in msgpackparse() on windows caused by api level bumpbfredl2022-04-25
|
* docs: typo fixes (#17859)dundargoc2022-04-15
| | | | | | | | | | Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com> Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com> Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: rwxd <rwxd@pm.me> Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
* fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913)zeertzjq2022-03-30
|
* feat(test): use nvim_exec in helpers.source() #16064Justin M. Keyes2022-03-27
| | | | | | | | helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
* fix(event-loop): call vpeekc() directly first to check for characterzeertzjq2022-02-03
| | | | Expand mappings first by calling `vpeekc()` directly.
* vim-patch:8.2.3917: the eval.txt help file is way too bigDaniel Steinberg2022-01-29
| | | | | | | | | | | | Problem: The eval.txt help file is way too big. Solution: Move the builtin function details to a separate file. https://github.com/vim/vim/commit/1cae5a0a034d0545360387407a7a409310f1efe2 Note: Neovim-specific references to |functions| were changed to |builtin-functions|. This included updates to: 1. test/functional/vimscript/functions_spec.lua 2. test/functional/vimscript/eval_spec.lua 3. runtime/doc/lua.txt
* fix(screenpos, float): add top and left border adjustmentzeertzjq2021-12-15
|
* vim-patch:7.4.1777Sean Dewar2021-11-26
| | | | | | | | | | | | | | | | Problem: Newly added features can escape the sandbox. Solution: Add checks for restricted and secure. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/3849992b16011e36a5cb5be4b127f843389b96fd timer_start is missing check_secure. The timer callback can, for example, call a function defined from outside the sandbox that does stuff that would be disallowed from inside the sandbox. This is usually not allowed. Cherry-pick eval.txt change from: https://github.com/vim/vim/commit/68e6560b84f196c82e27a72669684d5506a3a837 Required for v8.1.2013.
* fix(eval): fix has('wsl') #16153erw72021-10-29
| | | | | | | | Problem: has('wsl') is decided at build-time. Solution: Check os_uname(). Fixes #12642, #16143
* fix(eval): checking for a non-empty string is too strict (#15987)Fabian2021-10-28
| | | | | | Cherry-pick check_for_nonempty_string() from patch vim-8.2.2133 and apply it on the bases of https://github.com/neovim/neovim/pull/13489 https://github.com/vim/vim/commit/2a9d5d386bea8455b37c1accebc45683ec51d6fb
* feat(eval/method): partially port v8.1.1954Sean Dewar2021-10-03
| | | | | | | | | | | Does not include listener_*() functions. js_*() functions are N/A. json_encode() and json_decode() didn't include tests; add some anyway (to json_functions_spec.lua). test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
* refactor(tests): remove redir_exec #15718Justin M. Keyes2021-09-19
| | | | | | | | | | | Problem - `redir_exec` is obsolete, but it keeps getting used in new tests because people copy existing tests. - Disadvantages of `redir_exec`: - Captures extra junk before the actual error/message that we _want_ to test. - Does not fail on error, unlike e.g. `command()`. Solution - Use new functions like `nvim_exec` and `pcall_err`.
* test: reorg #15698Justin M. Keyes2021-09-17
Problem: Subdirectories like "visual", "insert", "normal" encourage people to separate *related* tests for no good reason. Typically the _mode_ is not the relevant topic of a test (and when it is, _then_ create an appropriate describe() or it()). Solution: - Delete the various `test/functional/<mode>/` subdirectories, move their tests to more meaningful topics. - Rename `…/normal/` to `…/editor/`. - Move or merge `…/visual/*` and `…/insert/*` tests into here where appropriate. - Rename `…/eval/` to `…/vimscript/`. - Move `…/viml/*` into here also. * test(reorg): insert/* => editor/mode_insert_spec.lua * test(reorg): cmdline/* => editor/mode_cmdline_spec.lua * test(reorg): eval core tests => eval_spec.lua