aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
Commit message (Collapse)AuthorAge
* vim-patch:8.2.3618: getcwd() is unclear about how 'autochdir' is usedzeertzjq2021-11-19
| | | | | | | Problem: getcwd() is unclear about how 'autochdir' is used. Solution: Update the help for getcwd(). Without any arguments always return the actual current directory. (closes vim/vim#9142) https://github.com/vim/vim/commit/851c7a699ae00bdc14a4db874cf722b7b7393b53
* feat(:source, nvim_exec): defer script item creation until s:var accessSean Dewar2021-10-14
| | | | | | | | For anonymous scripts, defer the creation of script items until an attempt to access a script-local variable is made. This dramatically reduces the number of script items created when using lots of vim.cmd and nvim_exec especially. This will mean <SID> usage fails until a script-local variable access is first made.
* feat(:source, nvim_exec): support script-local variablesSean Dewar2021-10-14
| | | | | | | | | | | | | | Based on #13143 (and #11507) with changes: - Omit script_type_E. Use sn_name == NULL to determine anon items. - Keep SID_STR. Used by anon :source for .lua files (no item). - Show SID in get_scriptname output (:verbose set). - Factor item creation into new_script_item. - Leave sc_seq = 0 (anon scripts don't re-use the same item when re-sourced). - Add tests for anon :source. Co-authored-by: Vikram Pal <vikrampal659@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* 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`.
* fix(:source): copy curbuf lines to memory before sourcing #15111Sean Dewar2021-09-15
| | | | | | | | | It's possible for weirdness to happen if curbuf is modified while sourcing from it via :source (with no arguments). For example: - Deleting lines from or wiping curbuf can cause internal error E315 to be thrown from ml_get. - Changing the curbuf to another buffer while sourcing can cause lines from the new curbuf to then be sourced instead.
* fix(:source, nvim_exec): handle Vimscript line continuations #14809Sean Dewar2021-09-14
| | | | | | | | | | | Problem: Anonymous :source (no args) and nvim_exec() don't support Vimscript line continuations. Solution: Factor out the concat logic into concat_continued_line() and a CONCAT_CONTINUED_LINES macro for simple concatenations where lines are fetched individually. Closes #14807
* refactor(tests): use assert_alive() #15546Justin M. Keyes2021-09-01
|
* test: update tests to work with 'hidden'Gregory Anders2021-08-18
|
* feat(defaults): set hiddenGregory Anders2021-08-17
|
* fixup! vim-patch:8.2.3019: location list only has the start position.Jan Edmund Lazo2021-07-31
|
* vim-patch:8.1.0829: when 'hidden' is set session creates extra buffersSean Dewar2021-07-17
| | | | | | | | | | | | | | Problem: When 'hidden' is set session creates extra buffers. Solution: Move :badd commands to the end. (Jason Franklin) https://github.com/vim/vim/commit/d39e275b57493f9e25e1b62f84810571eee30cf4 Adjust some tests in ex_cmds/mksession_spec.lua: - 'restores same :terminal buf in splits': Buffers aren't always :badded in the same order as they're :edited, :balted, etc, so the order of buffers in the buffer list may change slightly now that :badd happens afterwards. - 'restores buffers with tab-local CWD': This is explained in a comment.
* doc(options): Fix recommended PowerShell config (#14349)Dimitri Tcaciuc2021-07-02
| | | | | | | | | | | Ensure that * Shell uses UTF8 input/output mode * Stderr output is captured, in UTF8 * Program exit codes are correctly captured Update functional test harness and add tests for :make command. Closes #13713
* fix(source): Source giving E484 & parsing error at line 1 for lua filesshadmansaleh2021-06-21
| | | | | | | | | | | It's happening because do_source is only expected to return FAIL when it was unable to open file . But `nlua_exec_file` returns fail for parsing and execution error too . Those errors are emitted through `nlua_error`. So now return value of nlua_exec_file is ignored like do_cmdline. It now only returns fail when it was unable to open file that check is done before calling nlua_exec_file or do_cmdline. Errors in nlua_exec_file are still directly emitted through nlua_error like before.
* refactor(source): Move lua file detection to do_sourceshadmansaleh2021-06-11
| | | | | | So now :source can run lua files too :) * feat: Add support for :[ranged]source for lua files
* more testsDaniel Hahler2021-03-30
|
* testDaniel Hahler2021-03-30
|
* Test and initial fix for crash with dictwatcherdelDaniel Hahler2021-03-30
| | | | Fixes https://github.com/neovim/neovim/issues/11188.
* vim-patch:8.1.0105: all tab stops are the sameVVKot2021-03-28
| | | | | | | Problem: All tab stops are the same. Solution: Add the variable tabstop feature. (Christian Brabandt, closes vim/vim#2711) https://github.com/vim/vim/commit/04958cbaf25eea27eceedaa987adfb354ad5f7fd
* [RFC] ":source" sources from current buffer if filename is omitted (#11444)Vikram Pal2021-02-18
| | | Fix https://github.com/neovim/neovim/issues/8722
* startup: handle autoload and lua packages during startupBjörn Linse2020-11-02
| | | | ¡NO HAY BANDA!
* A Mudholland Dr. RecastBjörn Linse2020-10-19
| | | | | The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.
* fix: runtimepath always updates lua package.pathTJ DeVries2020-08-10
|
* eval: improve ex_execute (#12445)erw72020-07-20
|
* vim-patch:8.2.0966: 'shortmess' flag "n" not used in two placesJan Edmund Lazo2020-06-18
| | | | | | | Problem: 'shortmess' flag "n" not used in two places. Solution: Make use of the "n" flag consistent. (Nick Jensen, closes vim/vim#6245, closes vim/vim#6244) https://github.com/vim/vim/commit/722e505d1a55dfde5ab62241d10da91d2e10c3c1
* test: add more profile testserw72020-05-10
| | | | | - Add a test to make sure that 'profile dump' does not reset the profile. - Add a test to make sure that 'profile stop' does reset the profile.
* vim-patch:8.0.1651: cannot filter :ls output for terminal buffersRob Pilling2020-04-19
| | | | | | Problem: Cannot filter :ls output for terminal buffers. Solution: Add flags for terminal buffers. (Marcin Szamotulski, closes vim/vim#2751) https://github.com/vim/vim/commit/0751f51a5b428805a8c1e9fe529693d032bec991
* vim-patch:8.1.0619: :echomsg and :echoerr do not handle List and DictJan Edmund Lazo2020-02-29
| | | | | | | | | | | | | Problem: :echomsg and :echoerr do not handle List and Dict like :echo does. (Daniel Hahler) Solution: Be more tolerant about the expression result type. https://github.com/vim/vim/commit/461a7fcfce3cd6414f990037e6468af3b5ccf119 Add lua functional tests for :echo,:echon,:echomsg,:echoerr because nvim did not port "test_" functions from Vim that modify internal state. Testing :echoerr via try/catch is sufficient.
* mksession: always unix slashes "/" for filepathsJustin M. Keyes2020-01-26
|
* mksession: simplify generated commandsJustin M. Keyes2020-01-26
| | | | | | | Doing ":file …" immediately after is enough to fixup the :terminal buffer name. ref #5250
* mksession: restore same :term buf in split windowsAlexandre Dubray2020-01-26
| | | | | | | | | | | | | | Problem: When session-restore creates a terminal buffer with command like `:edit term://.//16450:/bin/bash`, the buffer gets a different name (depends on PID). Thus the later call to `bufexists('term://.//16450:/bin/bash)` will return false. Solution: Force the buffer name with :file. This as least ensures the same buffer will show in multiple windows correctly, as expected when saving the session. But it still has problems: 1. the PID in the buffer name is bogus 2. redundant :terminal buffers still hang around fix #5250
* terminal: absolute CWD in term:// URI #11289Chris LaRose2020-01-26
| | | | | | | | | This makes it possible to restore the working directory of :terminal buffers when reading those buffers from a session file. Fixes #11288 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* API: deprecate nvim_command_outputJustin M. Keyes2019-12-02
|
* dictwatcher: fix use-after-free #11495erw72019-12-02
| | | | | fixes #11494
* tests: fix non-controversial misuse of `pending` (#11247)Daniel Hahler2019-10-18
| | | Ref: https://github.com/neovim/neovim/pull/11184
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
* getdigits: introduce `strict`, `def` parametersJustin M. Keyes2019-09-13
| | | | | | | | | | | | Problem: During a refactor long ago, we changed the `getdigits_*` familiy of functions to abort on overflow. But this is often wrong, because many of these codepaths are handling user input. Solution: Decide at each call-site whether to use "strict" mode. fix #5555
* test: Eliminate expect_errJustin M. Keyes2019-09-06
| | | | Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
* tests: use runtime from build for doc/tags with :help (#10479)Daniel Hahler2019-08-28
| | | | | | | | | | | | This is better practice in general, and allows to remove the "helptags ALL" hacks. Ref: https://github.com/neovim/neovim/issues/8824 Ref: https://github.com/neovim/neovim/commit/f1b67c3453c * Makefile: fix dependencies with regard to helptags - use the file as the main target to avoid unnecessary triggering - use "make oldtest" on Travis to ensure it gets built
* test: isCI(): add "name" parameterJustin M. Keyes2019-08-05
|
* tests: AppVeyor: fix test/functional/ex_cmds/arg_spec.lua (#10598)Daniel Hahler2019-07-24
| | | | | | | | | | | | | | | | | | | | For unknown reasons it does not have the trailing space in `:args` output there anymore: [ FAILED ] test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer test/functional\ex_cmds\arg_spec.lua:25: Expected objects to be the same. Passed in: (string) ' [term://.//4552:C:\Windows\system32\cmd.exe]' Expected: (string) ' [term://.//4552:C:\Windows\system32\cmd.exe] ' stack traceback: test/functional\ex_cmds\arg_spec.lua:25: in function <test/functional\ex_cmds\arg_spec.lua:11> The test is not about that though, and this can be made less strict by using `trim()`. The new test in `test_arglist.vim` for no trailing newline is OK, and contains trailing spaces. So this is likely due to the length of it exceeding the column width already.
* tests: use vim.inspect (#10485)Daniel Hahler2019-07-13
| | | | | | | The inspect modules is vendored as `vim.inspect`, and therefore it makes sense to use this in tests also. Ref: https://github.com/neovim/neovim/issues/6580 Ref: https://github.com/neovim/neovim/commit/bb3aa824b
* tests: fix flaky ':digraphs displays digraphs' (#10406)Daniel Hahler2019-07-04
|
* tests: shell-test: add INTERACT mode (#10405)Daniel Hahler2019-07-03
| | | | Use it to improve ls_spec: it should not use the user's real shell for performance and other reasons.
* :ls : show "R", "F" for terminal-jobs #10370Justin M. Keyes2019-06-29
| | | | | | | | | | | This matches Vim behavior. From `:help :ls` : R a terminal buffer with a running job F a terminal buffer with a finished job ? a terminal buffer without a job: `:terminal NONE` TODO: implement `:terminal NONE`. ref #10349
* vim-patch:8.0.1782: no simple way to label quickfix entriesMarco Hinz2019-05-05
| | | | | | | | Problem: No simple way to label quickfix entries. Solution: Add the "module" item, to be used instead of the file name for display purposes. (Martin Szamotulski) https://github.com/vim/vim/commit/d76ce852668635d81778cedacc2d3f021ed4e475
* test: clear(): `args_rm` parameterJustin M. Keyes2019-04-27
|
* Merge pull request #9896 from justinmk/api-async-errorJustin M. Keyes2019-04-13
|\ | | | | API: emit nvim_error_event on failed async request
| * API: emit nvim_error_event on failed async requestJustin M. Keyes2019-04-13
| | | | | | | | | | We already do this for _invalid_ async requests #9300. Now we also do it for failed invocation of valid requests.
* | options: properly reset directories on 'autochdir' (#9894)Marco Hinz2019-04-13
|/ | | Fixes https://github.com/neovim/neovim/issues/9892
* help: ignore snapshotted window if invalid (#9774)Marco Hinz2019-03-23
| | | | | | | | | | | | | | | | | | Nvim doesn't expect a window-changing command on an created-window event. autocmd WinNew * wincmd p help help - A snapshot for window 1000 is created. - The window is split and the cursor changes to the new window 1001. - The autocmd kicks in and switches back to 1000. - The help buffer is opened. - On closing the help window 1000, it tries to go back to the snapshotted window which is... 1000. - wp1000->w_buffer == NULL - w_buffer is used by check_cursor() - 🧨 -> 💥 Fixes https://github.com/neovim/neovim/issues/9773