aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
Commit message (Collapse)AuthorAge
* fix(api): get virtual text with multiple hl properly (#25307)zeertzjq2023-09-22
|
* fix(api): disallow win_set_buf from changing cmdwin's old curbuf (#24745)Sean Dewar2023-08-17
| | | | A command typed in the cmdwin and executed with `<CR>` is expected to be executed in the context of the old curwin/buf, so it shouldn't be changed.
* feat(api): allow win_hide to close cmdwin or non-previous windowsSean Dewar2023-07-26
| | | | | | | This aligns its behaviour better with `nvim_win_close`. Note that `:hide` is actually incapable of closing the cmdwin, unlike `:close` and `:quit`, so this is a bit of a difference in behaviour.
* feat(api): allow win_close in cmdwin to close wins except previousSean Dewar2023-07-26
| | | | | | | | | | | Disallow closing the previous window from `nvim_win_close`, as this will cause issues. Again, no telling how safe this is. It also requires exposing old_curwin. :/ Also note that it's possible for the `&cmdheight` to change if, for example, there are 2 tabpages and `nvim_win_close` is used to close the last window in the other tabpage while `&stal` is 1. This is addressed in a later commit.
* feat(api): allow open_win/win_set_buf in the cmdwin in some casesSean Dewar2023-07-26
| | | | | | | | | | | | | | | | | | | | | | Problem: As discussed on Matrix, there was some interest in having `nvim_open_win` again be able to open floats in the cmdwin (e.g: displaying a hover doc related to what's in the cmdwin). After #23228, this was disallowed. Solution: Allow `nvim_open_win` in the cmdwin as long as `!enter` and `buffer != curbuf` (the former can cause all sorts of issues, and the latter can crash Nvim after closing cmdwin). Also allow `nvim_win_set_buf` in a similar fashion. Note that we're not *entirely* sure if this is 100% safe (cmdwin is a global-state-using-main-loop-calling beast), but this seems to work OK..? Also: - Check the buffer argument of `nvim_open_win` earlier, and abort if it's invalid (it used to still open a window in this case). - Untranslate `e_cmdwin` errors in the API (other errors in the API are not translated: although not detailed in the API contract yet, errors are supposed to be stable).
* feat(api)!: change return type of nvim_win_text_height to Dict (#24365)zeertzjq2023-07-16
|
* feat(api): add nvim_win_text_height (#24236)zeertzjq2023-07-11
| | | | It uses the same code as "scroll_delta" of "win_viewport" UI event to calculate text height, but is more flexible.
* test: added tests for set_height with winminheight=0 and a winbarFolke Lemaitre2023-06-01
|
* 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>
* fix(api): set correct curbuf when temporarily changing curwin (#21371)zeertzjq2022-12-10
| | | This is the same code change as https://github.com/vim/vim/commit/6c87bbb4e45515e70ac1728cabd1451063bf427d
* fix(float): make closing float in another tab return to correct windowzeertzjq2022-12-02
|
* fix(api): nvim_win_set_cursor redraw cursorcolumn for non-current window ↵Jlll12022-11-17
| | | | | | (#21072) fix #19063 this fixes the cursorcolumn not being redrawn for non-current windows in `nvim_win_set_cursor()`
* test(api): migrate screenchar() test in in window API to screen testbfredl2022-10-05
| | | | This produces actual output in case of regressions.
* docs: fix typos (#18269)dundargoc2022-06-04
| | | | | | | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Dan Sully <dan+github@sully.org> Co-authored-by: saher <msaher.shair@gmail.com> Co-authored-by: Stephan Seitz <stephan.seitz@fau.de> Co-authored-by: Benedikt Müller <d12bb@posteo.de> Co-authored-by: Andrey Mishchenko <mishchea@gmail.com> Co-authored-by: Famiu Haque <famiuhaque@protonmail.com> Co-authored-by: Oliver Marriott <hello@omarriott.com>
* refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque2022-05-15
| | | | | Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
* fix(api): nvim_win_set_cursor() redraw for cursorline and statuslinezeertzjq2022-02-15
|
* feat(api): add nvim_get_option_valueGregory Anders2021-12-04
|
* fix(api): fix crash after set_option_value_for() #15390gmntroll2021-09-25
| | | | | | | | | | | | | | | | | | | | | Problem: This crashes Nvim: tabedit call nvim_win_set_option(1000, 'statusline', 'status') split wincmd J wincmd j Solution: - Change `no_display` parameter value to be the same as in matching `restore_win_noblock` call. In case of different values `topframe` isn't restored to `curtab->tp_topframe`. - Call `restore_win_noblock` if `switch_win_noblock` returns `FAIL` (`switch_win` must always have matching `restore_win`) - Change `switch_win`/`restore_win` to `_noblock` versions to allow autocommands. fixes #14097 fixes #13577
* fix(window.c): win_close from other tabpage #15454notomo2021-08-22
| | | Fix #15313
* test: update tests to work with 'hidden'Gregory Anders2021-08-18
|
* api: include border in nvim_win_get_configCorey Williamson2021-06-10
|
* api(nvim_open_win): add "noautocmd" optionSean Dewar2021-06-01
| | | | | | This option, when set, stops nvim_open_win() from potentially firing buffer-related autocmd events (BufEnter, BufLeave and BufWinEnter in the case of nvim_open_win()).
* api: add vim.api.nvim_win_hideCorey Williamson2021-03-09
|
* 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.
* API: include invalid buffer/window/tabpage in error message (#11712)Daniel Hahler2020-01-14
|
* 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.
* 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.
* 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
|
* api: add nvim_win_close() to close window by idBjörn Linse2019-03-03
|
* API: Implement nvim_win_set_buf() #9100Justin M. Keyes2018-11-25
| | | | closes #9100
* API: Avoid overrun when formatting error-messageJustin M. Keyes2018-09-05
| | | | | | | msgpack_rpc_to_object (called by handle_request .. msgpack_rpc_to_array) always NUL-terminates API Strings. But handle_request .. msgpack_rpc_get_handler_for operates on a raw msgpack_object, before preparation.
* API: nvim_win_set_cursor: set curswant #8613David Hotham2018-06-25
| | | Fixes #8591
* functests: Fix testsZyX2017-05-08
|
* api: Do not translate error messages.Justin M. Keyes2017-04-24
| | | | | | | | | | Also re-word some error messages: - "Key does not exist: %s" - "Invalid channel: %<PRIu64>" - "Request array size must be 4 (request) or 3 (notification)" - "String cannot contain newlines" References #6150
* api: Make sure dict_set_var doesn’t edit read-only valuesZyX2017-02-23
| | | Fixes #6147
* test/api: Specify handling of VimL errors, v:errmsg.Justin M. Keyes2016-10-24
| | | | TODO: Also spec behavior of Press-Enter prompt for these API functions.
* api: Support getting the number of a window/tabpageJames McCoy2016-10-04
| | | | | | | | | | | In order to provide better compatibility with the classic bindings, the API needs to provide the ability to query the number (really index) of the window/tabpage. This is needed for neovim/python-client#87, as discussed in neovim/neovim#1898. Signed-off-by: James McCoy <jamessan@jamessan.com>
* api: Establish API naming convention. (#5344)Justin M. Keyes2016-09-17
| | | | | | | | | | | | | | | | | | | | | old name: new name: -------------------------------------------------- nvim_name_to_color nvim_get_color_by_name nvim_get_current_buffer nvim_get_current_buf nvim_get_current_window nvim_get_current_win nvim_get_buffers nvim_list_bufs nvim_get_tabpages nvim_list_tabpages nvim_get_windows nvim_list_wins nvim_set_current_buffer nvim_set_current_buf nvim_set_current_window nvim_set_current_win nvim_change_directory nvim_set_current_dir nvim_tabpage_get_window nvim_tabpage_get_win nvim_tabpage_get_windows nvim_tabpage_list_wins nvim_win_get_buffer nvim_win_get_buf nvim_report_error nvim_err_writeln Helped-by: Björn Linse <bjorn.linse@gmail.com> Helped-by: ZyX <kp-pav@yandex.ru> Helped-by: James McCoy <jamessan@jamessan.com>
* api: make nvim[_obj]_set_var and _del_var not return the old valueBjörn Linse2016-09-15
|
* functests: Check logs in lua codeZyX2016-06-10
| | | | | | It is otherwise impossible to determine which test failed sanitizer/valgrind check. test/functional/helpers.lua module return was changed so that tests which do not provide after_each function to get new check will automatically fail.
* api: Replace set_var(name, NIL) with del_var(name)ZyX2016-04-18
|
* test/functional: clean up according to luacheck (part 2)Marco Hinz2015-11-23
|
* test: Fix race condition in window_spec.luaThiago de Arruda2015-02-16
| | | | | Without waiting for the 'gg' command to be processed, its possible that the following assertion will fail.
* Fix broken functional test.John Szakmeister2014-11-25
| | | | | | In Lua, all math is floating point. We need to coerce the result of a division into a integer with the `{get,set}_height` and `{get,set}_width` window_spec functional tests.
* test/api: add test for set_cursor always updating the screenBjörn Linse2014-11-01
|
* test: Use lua to perform sanity API checksThiago de Arruda2014-10-16
Sanity API checks made by the python-client in the api-python travis target were converted to lua and will now live in this repository. This will simplify performing breaking changes to the API as it won't be necessary to send parallel PRs the python-client.