aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api
Commit message (Collapse)AuthorAge
* Context: rename "buflist" => "bufs"Justin M. Keyes2019-09-14
| | | | | Given the other type names "jumps", "vars", etc., the name "buflist" is somewhat unintuitive.
* API: nvim_get_context: "opts" paramJustin M. Keyes2019-09-14
| | | | | Since the parameter is already non-primitive, make it an `opts` map instead of just a list, in case we want to extend it later.
* syntax, TUI: support "strikethrough"Jaskaran Singh2019-09-13
| | | | | | fix #3436 Includes: vim-patch:8.0.1038: strike-through text not supported
* UIEnter/UILeave: fire for embedder UI, builtin TUIJustin M. Keyes2019-09-12
| | | | | | | | | Before this, --embed UIs (without --headless) would not trigger UIEnter. For TUI, maybe UIEnter isn't useful, but: - It is less "surprising"/special. - Makes documentation simpler. - When TUI becomes a coprocess, it will happen anyway.
* rename: UIAttach/UIDetach => UIEnter/UILeaveJustin M. Keyes2019-09-12
| | | | | "enter"/"leave" is more conventional for Vim events, and "attach"/"detach" distinction does not gain much.
* UIAttach, UIDetachJustin M. Keyes2019-09-12
| | | | | doc: ginit.vim, gvimrc fix #3656
* UIAttach, UIDetachRui Abreu Ferreira2019-09-12
|
* test: Eliminate expect_errJustin M. Keyes2019-09-06
| | | | Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
* test: Rename meth_pcall to pcall_errJustin M. Keyes2019-09-06
| | | | | | | - Rename `meth_pcall`. - Make `pcall_err` raise an error if the function does not fail. - Add `vim.pesc()` to treat a string as literal where a Lua pattern is expected.
* Merge #10869 'vim-patch:8.1.{0309,0362,0365,0515,1946}'Justin M. Keyes2019-09-05
|\
| * Change test because maparg was changed to also return lnumerw72019-09-04
| |
* | test: is_os() #10933Justin M. Keyes2019-09-04
|/ | | | | - Move os_name() up to "global helpers". - Rename it to is_os(). - Make it depend on uname() instead of a running Nvim instance.
* shada/context: fully remove jumplist duplicates #10898Abdelhakeem Osama2019-09-03
| | | | | | | | | | | | | | | | - Always load files when cleaning up jumplist. - For Shada: avoids writing duplicate entries, which happens when you read from a shada file with duplicate entries (merging the jumplist while writing sometimes produces duplicate entries, bug?) and then write right away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement, that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`). - For Context: avoids non-idempotent behavior for the same reason (i.e.: first call to `shada_encode_jumps` does not remove duplicate entries). - Do not set pcmark when dumping jumplist for Context. - Retrieving current Context shouldn't add an entry to the jumplist (which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.: tail entry matching current position), just act like `getjumplist` for instance.
* tests: assert:set_parameter('TableFormatLevel', 100) #10925Daniel Hahler2019-09-03
| | | | | | luassert uses 3 by default, which is often not enough. Instead of documenting how to increase it, let's use a more fitting (sane) default of 100 levels.
* API: nvim_buf_set_lines: handle 'nomodifiable' #10910Justin M. Keyes2019-09-01
|
* API: make nvim_win_set_option() set window-global, not buffer-local #9110Björn Linse2019-09-01
| | | | | | NB: the `!(flags & SOPT_GLOBAL)` exception is for 'statusline'. Because `:set statusline=...` sets the global value for _all_ windows, `:setlocal` is the best we can do there. This is a one-of-a-kind option that doesn't work like any other option.
* paste: one undo-block per streamJustin M. Keyes2019-09-02
| | | | | | - All "chunks" in a paste-stream should form a single undo-block. Side effect of 7a8579288424 was to create an undo-block for each chunk. - Also: remove old :redraw force logic, irrelevant after 7a8579288424.
* api: make nvim_put support "\022{NUM}" regtype as returned by getregtype()Björn Linse2019-08-31
|
* API: nvim_paste: add `crlf` parameterJustin M. Keyes2019-08-30
|
* paste: break lines at CR, CRLF #10877Justin M. Keyes2019-08-29
| | | | | | Some terminals helpfully translate \n to \r. fix #10872 ref #10223
* API: TRY_WRAP() for "abort-causing non-exception errors"Justin M. Keyes2019-08-28
| | | | | | | | - Introduce TRY_WRAP() until we have an *architectural* solution. - TODO: bfredl idea: prepare error-handling at "top level" (nv_event). - nvim_paste(): Revert luaeval() hack (see parent commit). - With TRY_WRAP() in nvim_put(), 'nomodifiable' error now correctly "bubbles up".
* paste: handle 'nomodifiable'Justin M. Keyes2019-08-27
| | | | | | | | - nvim_paste(): Marshal through luaeval() instead of nvim_execute_lua() because the latter seems to hide some errors. - Handle 'nomodifiable' in `nvim_put()` explicitly. - Require explicit `false` from `vim.paste()` in order to "cancel", otherwise assume true ("continue").
* paste: make vim.paste() "public"Justin M. Keyes2019-08-27
|
* paste: handle vim.paste() failureJustin M. Keyes2019-08-27
| | | | | | | | - Show error only once per "paste stream". - Drain remaining chunks until phase=3. - Lay groundwork for "cancel". - Constrain semantics of "cancel" to mean "client must stop"; it is unrelated to presence of error(s).
* API: nvim_pasteJustin M. Keyes2019-08-27
|
* API: nvim_put: "follow" parameterJustin M. Keyes2019-08-27
|
* API: nvim_put: always PUT_CURSENDJustin M. Keyes2019-08-27
| | | | | | | | | Fixes strange behavior where sometimes the buffer contents of a series of paste chunks (vim._paste) would be out-of-order. Now the tui_spec.lua screen-tests are much more reliable. But they still sometimes fail because of off-by-one cursor (caused by "typeahead race" resulting in wrong mode; fixed later in this patch-series).
* API: nvim_put #6819Justin M. Keyes2019-08-27
|
* teardown: fix win_free_all() heap-use-after-free #10839Abdelhakeem Osama2019-08-25
| | | Fixes #10838
* API: fix nvim_command_output buffer overflow (#10830)Abdelhakeem Osama2019-08-22
| | | Fixes https://github.com/neovim/neovim/issues/10829.
* tests: support msg with global_helpers.ok (#10820)Daniel Hahler2019-08-21
| | | | | | Ref: https://github.com/neovim/neovim/pull/10768#discussion_r315904175 Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
* tests: skip "API nvim_parse_expression" on MSVC_32 (#10773)Daniel Hahler2019-08-14
| | | | | | Only "API nvim_parse_expression works with &opt" is flaky, but easier to skip all of "API nvim_parse_expression". Ref: https://github.com/neovim/neovim/issues/10241
* api/window: disallow closing non-current window in cmdwin stateBjörn Linse2019-08-10
|
* API: nvim_win_close: Fix closing cmdline-window #10087R. Simon2019-08-10
|
* test: isCI(): add "name" parameterJustin M. Keyes2019-08-05
|
* vim-patch:8.1.1759: no mode char for terminal mapping from maparg()notomo2019-07-28
| | | | | | Problem: No mode char for terminal mapping from maparg(). Solution: Check for TERMINAL mode. (closes vim/vim#4735) https://github.com/vim/vim/commit/14371ed69778107654e39268d0d90982e53ad6e0
* API: ContextAbdelhakeem2019-07-27
|
* api/lua: make nvim_execute_lua use native lua floats, not special tablesBjörn Linse2019-07-01
| | | | | | | | | | Rationale: the purpose of nvim_execute_lua is to simply call lua code with lua values. If a lua function expects a floating point value, it should be enough to specify a float as argument to nvim_execute_lua. However, make sure to preserve the existing roundtripping behavior of API values when using `vim.api` functions. This is covered by existing lua/api_spec.lua tests.
* tests: fix "api nvim_get_proc_children returns child process ids" (#10296)Daniel Hahler2019-06-22
| | | | | | | | | | | | | | | | | | | | | | There might be an existing job already - maybe due to some other test, but in this case there was only one failure in the test run. ``` [----------] Running tests from C:/projects/neovim/test/functional\api\proc_spec.lua [ RUN ] api nvim_get_proc_children returns child process ids: ERR test\functional\helpers.lua:392: retry() attempts: 450 C:/projects/neovim/test/functional\api\proc_spec.lua:22: Expected objects to be the same. Passed in: (number) 2 Expected: (number) 1 stack traceback: test\functional\helpers.lua:392: in function 'retry' C:/projects/neovim/test/functional\api\proc_spec.lua:21: in function <C:/projects/neovim/test/functional\api\proc_spec.lua:17> ``` https://ci.appveyor.com/project/neovim/neovim/builds/25461215/job/8ns204v6091iy9rs?fullLog=true#L2672
* api: allow nvim_buf_attach from lua using callbacksBjörn Linse2019-06-04
|
* api/buffer: create new buffers in the "opened" stateBjörn Linse2019-06-03
| | | | | | | Otherwise vim will think that ml_append() needs to "enter" the buffer, which emits unexpected autocommands. ref https://github.com/vim-airline/vim-airline/issues/1930
* messages: use proper multiline error message for rpcrequest and API wrappersBjörn Linse2019-05-26
|
* test: remove use of require('test.helpers')Justin M. Keyes2019-05-18
| | | | | | The test.functional.helpers and test.unit.helpers modules now include all of the public functions from test.helpers, so there is no need to separately require('test.helpers').
* test: Extend {unit,functional}.helpers with global helpersJustin M. Keyes2019-05-18
| | | | | | | | Automatically include all "global helper" util functions in the unit.helpers and functional.helpers and modules. So tests don't need to expicitly do: local global_helpers = require('test.helpers')
* API/nvim_set_keymap: remove mode-shortname aliasesJustin M. Keyes2019-05-12
| | | | | Reduce the API surface-area a bit. No need to have aliases for a mode. ref #9924
* API/nvim_set_keymap: minor cleanupJustin M. Keyes2019-05-12
| | | | ref #9924
* API: nvim_set_keymap, nvim_del_keymap #9924Yilin Yang2019-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #9136 - Treat empty {rhs} like <Nop> - getchar.c: Pull "repl. MapArg termcodes" into func The "preprocessing code" surrounding the replace_termcodes calls needs to invoke replace_termcodes, and also check if RHS is equal to "<Nop>". To reduce code duplication, factor this out into a helper function. Also add an rhs_is_noop flag to MapArguments; buf_do_map_explicit expects an empty {rhs} string for "<Nop>", but also needs to distinguish that from something like ":map lhs<cr>" where no {rhs} was provided. - getchar.c: Use allocated buffer for rhs in MapArgs Since the MAXMAPLEN limit does not apply to the RHS of a mapping (or else an RHS that calls a really long autoload function from a plugin would be incorrectly rejected as being too long), use an allocated buffer for RHS rather than a static buffer of length MAXMAPLEN + 1. - Mappings LHS and RHS can contain literal space characters, newlines, etc. - getchar.c: replace_termcodes in str_to_mapargs It makes sense to do this; str_to_mapargs is, intuitively, supposed to take a "raw" command string and parse it into a totally "do_map-ready" struct. - api/vim.c: Update lhs, rhs len after replace_termcodes Fixes a bug in which replace_termcodes changes the length of lhs or rhs, but the later search through the mappings/abbreviations hashtables still uses the old length value. This would cause the search to fail erroneously and throw 'E31: No such mapping' errors or 'E24: No such abbreviation' errors. - getchar: Create new map_arguments struct So that a string of map arguments can be parsed into a more useful, more portable data structure. - getchar.c: Add buf_do_map function Exactly the same as the old do_map, but replace the hardcoded references to the global `buf_T* curbuf` with a function parameter so that we can invoke it from nvim_buf_set_keymap. - Remove gettext calls in do_map error handling
* UI/nvim_ui_attach(): add `override` optionJustin M. Keyes2019-05-09
| | | | | | | | | | | | | | | | | | | | Before now, Nvim always degrades UI capabilities to the lowest-common denominator. For example, if any connected UI has `ext_messages=false` then `ext_messages=true` requested by any other connected UI is ignored. Now `nvim_ui_attach()` supports `override=true`, which flips the behavior: if any UI requests an `ext_*` UI capability then the capability is enabled (and the legacy behavior is disabled). Legacy UIs will be broken while a `override=true` UI is connected, but it's useful for debugging: you can type into the TUI and observe the UI events from another connected (UI) client. And the legacy UI will "recover" after the `override=true` UI disconnects. Example using pynvim: >>> n.ui_attach(2048, 2048, rgb=True, override=True, ext_multigrid=True, ext_messages=True, ext_popupmenu=True) >>> while True: n.next_message();
* API: fix cursor position when lines are added #9961hashinclude2019-05-07
| | | | Restore code removed in #9674.
* 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.