aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into floattitleJosh Rahm2022-09-12
|\
| * refactor: replace char_u with charDundar Göc2022-09-09
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor(typval): change FC_CFUNC abstraction into FC_LUAREFbfredl2022-09-07
| | | | | | | | | | | | | | | | | | | | | | | | "cfuncs" was only ever used to wrap luarefs. As vim8script is finished and will not be developed further, support for "cfuncs" for other usecases are not planned. This abstraction was immediately broken anyway in order to get luarefs out of userfuncs again. Even if a new kind of userfunc needs to be invented in the future, likely just extending the FC_... flag union directy, instead of invoking unnecessary heap object and c function pointer indirection, will be a more straightforward design pattern.
| * refactor: replace char_u with charDundar Göc2022-09-06
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * feat(extmarks,ts,spell): full support for spellingThomas Vigouroux2022-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added 'spell' option to extmarks: Extmarks with this set will have the region spellchecked. - Added 'noplainbuffer' option to 'spelloptions': This is used to tell Neovim not to spellcheck the buffer. The old behaviour was to spell check the whole buffer unless :syntax was set. - Added spelling support to the treesitter highlighter: @spell captures in highlights.scm are used to define regions which should be spell checked. - Added support for navigating spell errors for extmarks: Works for both ephemeral and static extmarks - Added '_on_spell_nav' callback for decoration providers: Since ephemeral callbacks are only drawn for the visible screen, providers must implement this callback to instruct Neovim which regions in the buffer need can be spell checked. The callback takes a start position and an end position. Note: this callback is subject to change hence the _ prefix. - Added spell captures for built-in support languages Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
| * Merge pull request #20039 from zeertzjq/cmod-tabbfredl2022-09-06
| |\ | | | | | | fix(api)!: correctly deal with number before :tab
| | * fix(api)!: correctly deal with number before :tabzeertzjq2022-09-02
| | | | | | | | | | | | | | | | | | Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which is the same as the number passed before :tab modifier instead of the number plus 1, and "tab" value is -1 if :tab modifier is not used.
| * | feat(api): add "move" to nvim_input_mousezeertzjq2022-09-04
| |/
| * feat(api): add support for :horizontal modifierzeertzjq2022-09-01
| |
| * Merge pull request #20023 from bfredl/hlarenabfredl2022-09-01
| |\ | | | | | | refactor(highlight): make hlattrs2dict always use pre-allocated dict
| | * 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.
| * | Merge pull request #16396 from bfredl/luaeventbfredl2022-08-31
| |\ \ | | |/ | |/| feat(lua): vim.ui_attach to get ui events from lua
| | * feat(lua): vim.ui_attach to get ui events from luabfredl2022-08-31
| | | | | | | | | | | | Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
| * | 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
| |/
| * 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.
| * 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
* / feat(floattitle): add ability to title floating windowsJosh Rahm2022-08-22
|/ | | | | | | | | | | | | | This is accomplished with adding a few new parameters to th e float config: * title: The title as a string * title_pos: The position of the title is one of: * kTitleLeft * kTitleCenter * kTitleRight The title does support statusline-esque highlighting semantics.
* 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
* fix(api): nvim_exec and nvim_cmd restore msg_col when capturing output (#19789)zeertzjq2022-08-16
| | | | This matches the code in execute_common(), preventing messages after the API call from being printed at the wrong column.
* fix(winbar): do not always assume cursor is valid. fixes #19458bfredl2022-08-13
|
* refactor: remove some unused includes (#19747)zeertzjq2022-08-13
| | | | | - Remove autocmd.h from fileio.h - Remove normal.h from main.h - Move bufinfo_T from undo_defs.h to undo.c
* 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.
* fix(signs): priority of extmark signs (#19718)Lewis Russell2022-08-11
|
* refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq2022-08-11
| | | | | | | vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
* fix(api): `vim.cmd.make` crashes when argument count isn't 1 (#19701)Famiu Haque2022-08-10
| | | Closes #19696
* vim-patch:8.1.1210: support for user commands is spread out (#19653)zeertzjq2022-08-06
| | | | | | | Problem: Support for user commands is spread out. No good reason to make user commands optional. Solution: Move user command support to usercmd.c. Always enable the user_commands feature. https://github.com/vim/vim/commit/ac9fb18020d7e8bf16d02d45fbb02cf47328aaf7
* fix(api): fix nvim_buf_set_text heap-use-after-free (#19644)zeertzjq2022-08-06
| | | | The line returned but ml_get_buf() may be freed by another call to ml_get_buf(), so it is necessary to make a copy.
* feat(lua): print source locations of lua callbacks (#19597)ii142022-08-03
| | | Co-authored-by: ii14 <ii14@users.noreply.github.com>
* Merge pull request #19540 from lewis6991/cmd_refactorLewis Russell2022-08-03
|\
| * refactor(cmd): unify execute_cmd with do_one_cmdLewis Russell2022-08-02
| |
* | docs: fix typos (#19588)dundargoc2022-08-03
|/ | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: notomo <notomo.motono@gmail.com>
* test: improve mapping tests and docs (#19619)zeertzjq2022-08-02
|
* feat(api): add replace_keycodes to nvim_set_keymap (#19598)ii142022-08-01
|
* docs: fix typos (#19024)dundargoc2022-07-31
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
* refactor: fix clang and PVS warnings (#19569)zeertzjq2022-07-29
| | | | The last commit didn't actually disable V1028 because of a typo. Fix the typo so it is actually disabled.
* perf(api): optimize nvim_cmd (#19513)Lewis Russell2022-07-27
| | | | | | | | | | | | | | | | | | | | | | Reduce the amount of string allocations and length calculations. With the following benchmark: ```lua total = 0 for _ = 1, loops do local start = now() vim.api.nvim_cmd({cmd = 'let', args = {'a', '=', '1'}}, {}) total = total + (now() - start) end print('nvim_cmd', total / loops) ``` ``` hyperfine 'nvim --clean test.lua +source +q' ``` Before: 234.5ms After: 173.8ms
* vim-patch:8.2.2254: Vim9: bool option type is numberzeertzjq2022-07-25
| | | | | | | Problem: Vim9: bool option type is number. Solution: Have get_option_value() return a different value for bool and number options. (closes vim/vim#7583) https://github.com/vim/vim/commit/dd1f426bd617ac6a775f2e7795ff0b159e3fa315
* fix(api): make nvim_cmd mods.silent work correctly (#19489)notomo2022-07-25
|