aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
Commit message (Collapse)AuthorAge
* refactor: replace char_u with char 23 (#21798)dundargoc2023-01-18
| | | Work on https://github.com/neovim/neovim/issues/459
* docs: builtin TUI is no longer channel 0 (#21794)zeertzjq2023-01-15
|
* feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
* docs: fix typos (#21427)dundargoc2023-01-04
| | | | | | Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Tomas Nemec <nemi@skaut.cz>
* refactor(tui): use nvim_echo() for verbose terminfobfredl2022-12-20
| | | | | | This is needed for #18375 for the obvious reasons. note: verbose_terminfo_event is only temporarily needed until the full TUI process refactor is merged.
* docs: fix typos (#21328)dundargoc2022-12-12
|
* docs(gen): support language annotation in docstringsChristian Clason2022-12-02
|
* docs: fix typos (#21196)dundargoc2022-11-29
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com>
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* vim-patch:9.0.0844: handling 'statusline' errors is spread out (#20992)luukvbaal2022-11-08
| | | | | | | | Problem: Handling 'statusline' errors is spread out. Solution: Pass the option name to the lower levels so the option can be reset there when an error is encountered. (Luuk van Baal, closes vim/vim#11467) https://github.com/vim/vim/commit/7b224fdf4a29f115567d4fc8629c1cef92d8444a
* docs: fix typos (#20724)dundargoc2022-10-23
| | | Co-authored-by: Marco Lehmann <m99@posteo.de>
* refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc2022-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | * refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
* feat(api): nvim_select_popupmenu_item support cmdline pum (#20652)zeertzjq2022-10-17
|
* fix(api): dynamically allocate line buffer for nvim_out_write (#20537)zeertzjq2022-10-08
|
* fix(docs): invalid :help links #20345Justin M. Keyes2022-09-25
| | | | | Fix those naughty single quotes. closes #20159
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* feat(api): add "move" to nvim_input_mousezeertzjq2022-09-04
|
* refactor(highlight): make hlattrs2dict always use pre-allocated dictbfredl2022-08-31
| | | | | hlattrs2dict used to work with both allocated and unallocated dicts which was quite messy. Now always delegate allocation to caller.
* refactor(mappings)!: mapblock_fill_dict() use API Dictionary (#20020)zeertzjq2022-08-31
| | | | | | | | | | | This introduces the following breaking changes: - nvim_get_keymap now always returns a LuaRef object as "callback" for a Lua mapping regardless of how it is called. The LuaRef object can be called from Lua and Vim script, but is lost over RPC. - maparg() now returns a Funcref instead of a ref number as "callback" for a Lua mapping. The Funcref can be called from Lua and Vim script, but is lost over RPC. This may also make nvim_get_keymap faster, but make maparg() slower.
* fix(api): nvim_set_hl bail out on invalid group name (#20021)zeertzjq2022-08-31
|
* refactor: change FALSE/TRUE to false/trueLewis Russell2022-08-26
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: replace char_u with charDundar Goc2022-08-25
| | | | Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #19906 from bfredl/bigstagebfredl2022-08-24
|\ | | | | perf(api): allow to use an arena for return values
| * refactor(api): provide a temporary copy solution for nvim_call_atomicbfredl2022-08-24
| | | | | | | | | | | | Make the copy_object() family accept an optional arena. More than half of the callsites should be refactored to use an arena later anyway.
| * perf(api): allow to use an arena for return valuesbfredl2022-08-23
| |
* | vim-patch:9.0.0206: redraw flags are not named specifically (#19913)zeertzjq2022-08-23
|/ | | | | Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen(). https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff
* vim-patch:8.1.2045: the option.c file is too big (#19854)zeertzjq2022-08-20
| | | | | | | | | | | Problem: The option.c file is too big. Solution: Split off the code dealing with strings. (Yegappan Lakshmanan, closes vim/vim#4937) https://github.com/vim/vim/commit/dac1347b4d9c1a1aef6aa73fdea08a9d1077d6ea Cherry-pick set_string_option_direct_in_win() from patch 8.1.1405. Cherry-pick shift_line() comment change from patch 8.1.2096. Move 'clipboard' default parsing to didset_string_options(). Reorder option flags to put Nvim-only flags at the end.
* refactor: move statusline code from buffer.c and [draw]screen.c to new filebfredl2022-08-19
| | | | | | | | | problem: code for drawing statusline is arbitrarily spreadout between drawscreen.c, screen.c and buffer.c solution: move it to a new file statusline.c - rename archaic internal name "status match" to public name "wildmenu" - showruler() does not show the ruler. it show anything which displays info about the cursor. Rename it accordingy.
* vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell2022-08-19
| | | | | | | | | | | | | | | Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:8.1.2082: rename popupmnu.* to popupmenu.* (#19829)zeertzjq2022-08-18
| | | | | | | vim-patch:8.1.2082: some files have a weird name to fit in 8.3 characters Problem: Some files have a weird name to fit in 8.3 characters. Solution: Use a nicer names. https://github.com/vim/vim/commit/30e8e73506e4522ef4aebf7d525c0e6ffe8805fd
* feat(ui): allow to set the highlight namespace per windowbfredl2022-08-17
| | | | | - reimplement 'winhl' in terms of highlight namespaces - check for EOF in screen tests (to indicate a likely crash)
* refactor: remove some unused includes (#19820)zeertzjq2022-08-17
| | | Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
* refactor: remove some unused includes (#19740)zeertzjq2022-08-12
| | | | Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers.
* refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)zeertzjq2022-08-12
| | | | This avoids including ex_eval.h in any other header, thus preventing future circular includes.
* test: improve mapping tests and docs (#19619)zeertzjq2022-08-02
|
* feat(api): add replace_keycodes to nvim_set_keymap (#19598)ii142022-08-01
|
* refactor(object): get rid of redundant FIXED_TEMP_ARRAYbfredl2022-07-20
| | | | | use the MAXSIZE_TEMP_ARRAY + ADD_C pattern instead, as exemplified by the changes in this commit.
* vim-patch:8.1.1076: file for Insert mode is much too bigzeertzjq2022-07-20
| | | | | | | | | | | | Problem: File for Insert mode is much too big. Solution: Split off the code for Insert completion. (Yegappan Lakshmanan, closes vim/vim#4044) https://github.com/vim/vim/commit/7591bb39d58ece38a5fef984a08ea9012616c1f9 Cherry-pick ins_compl_len() -> get_compl_len() from patch 8.2.4001. Revert a71c5e9eb98fbb2ca88510269935cdcda37369fc: ctrl_x_mode is no longer a global variable, so l_ctrl_x_mode is no longer needed.
* fix(rpc): break nvim_error_event feedback loop between two nvim instancesbfredl2022-07-19
| | | | | | In case nvim A sends nvim_error_event to nvim B, it would respond with another nvim_error_event due to unknown request name. Fix this by adding dummy request handler for now.
* feat(marks): restore viewport on jump #15831Javier Lopez2022-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** Refactor Previously most functions used to "get" a mark returned a position, changed the line number and sometimes changed even the current buffer. Now functions return a {x}fmark_T making calling context aware whether the mark is in another buffer without arcane casting. A new function is provided for switching to the mark buffer and returning a flag style Enum to convey what happen in the movement. If the cursor changed, line, columns, if it changed buffer, etc. The function to get named mark was split into multiple functions. - mark_get() -> fmark_T - mark_get_global() -> xfmark_T - mark_get_local() -> fmark_T - mark_get_motion() -> fmark_T - mark_get_visual() -> fmark_T Functions that manage the changelist and jumplist were also modified to return mark types. - get_jumplist -> fmark_T - get_changelist -> fmark_T The refactor is also seen mainly on normal.c, where all the mark movement has been siphoned through one function nv_gomark, while the other functions handle getting the mark and setting their movement flags. To handle whether context marks should be left, etc. ** Mark View While doing the refactor the concept of a mark view was also implemented: The view of a mark currently implemented as the number of lines between the mark position on creation and the window topline. This allows for moving not only back to the position of a mark but having the window look similar to when the mark was defined. This is done by carrying and extra element in the fmark_T struct, which can be extended later to also restore horizontal shift. *** User space features 1. There's a new option, jumpoptions+=view enables the mark view restoring automatically when using the jumplist, changelist, alternate-file and mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark] ** Limitations - The view information is not saved in shada. - Calls to get_mark should copy the value in the pointer since we are using pos_to_mark() to wrap and provide a homogeneous interfaces. This was also a limitation in the previous state of things.
* refactor(highlight)!: rename attributes to match Vim (#19159)zeertzjq2022-06-30
| | | | | | | | | Ref: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417 Rename: - `underlineline` to `underdouble` - `underdot` to `underdotted` - `underdash` to `underdashed` `underdouble` also now takes higher precedence than `undercurl`.
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: move some mapping-related code to a separate file (#19061)zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | This marks the following Vim patches as ported: vim-patch:8.1.1785: map functionality mixed with character input Problem: Map functionality mixed with character input. Solution: Move the map functionality to a separate file. (Yegappan Lakshmanan, closes vim/vim#4740) Graduate the +localmap feature. https://github.com/vim/vim/commit/b66bab381c8ba71fd6e92327d1d34c6f8a65f2a7 vim-patch:8.2.3643: header for source file is outdated Problem: Header for source file is outdated. Solution: Make the header more accurate. (closes vim/vim#9186) https://github.com/vim/vim/commit/a3f83feb63eae5464a620ae793c002eb45f7a838 Also cherry-pick a change for <unique> mappings from patch 8.2.0807. Rename map_clear_mode() to do_mapclear().
* perf(highlight): don't allocate duplicates for color namesbfredl2022-06-21
|
* fix(terminal): coverity USE_AFTER_FREE #18978Justin M. Keyes2022-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity reports use after free: *** CID 352784: Memory - illegal accesses (USE_AFTER_FREE) /src/nvim/buffer.c: 1508 in set_curbuf() 1502 if (old_tw != curbuf->b_p_tw) { 1503 check_colorcolumn(curwin); 1504 } 1505 } 1506 1507 if (bufref_valid(&prevbufref) && prevbuf->terminal != NULL) { >>> CID 352784: Memory - illegal accesses (USE_AFTER_FREE) >>> Calling "terminal_check_size" dereferences freed pointer "prevbuf->terminal". 1508 terminal_check_size(prevbuf->terminal); 1509 } 1510 } 1511 1512 /// Enter a new current buffer. 1513 /// Old curbuf must have been abandoned already! This also means "curbuf" may Solution: Change terminal_destroy and terminal_close to set caller storage to NULL, similar to XFREE_CLEAR. This aligns with the pattern found already in: terminal_destroy e897ccad3eb1e term_delayed_free 3e59c1e20d605
* 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
* refactor(api): move command related API to separate filebfredl2022-06-12
|
* refactor(api): move option code to own filebfredl2022-06-12
|
* fix(messages): add color when showing nvim_echo in :messages historybfredl2022-06-11
|
* feat(api): nvim__get_runtime do_sourcebfredl2022-06-11
|