aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
Commit message (Collapse)AuthorAge
* Merge branch 'master' of https://github.com/neovim/neovim into rahmtmpJosh Rahm2022-08-19
|\
| * 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
* | Merge branch 'master' of https://github.com/neovim/neovim into rahmJosh Rahm2022-08-07
|\|
| * 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
| | |
* | | Merge remote-tracking branch 'upstream/master' into rahmJosh Rahm2022-08-03
|\| |
| * | 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
| |
| * 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.
| * perf(ui): unpack grid_line (screen contents) directlybfredl2022-07-19
| |
| * perf(ui): eliminate spurious memory allocations for hl_attr_define eventbfredl2022-07-18
| |
* | Merge remote-tracking branch 'upstream/master' into rahmJosh Rahm2022-07-18
|\|
| * fix(api): do not switch win/buf if getting option in current win/buf (#19383)zeertzjq2022-07-16
| |
| * feat(api): add `unsilent` to command APIszeertzjq2022-07-03
| |
| * 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`.
| * feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filterFamiu Haque2022-06-28
| | | | | | | | | | | | Also fixes a memory leak in `parse_cmdline`. Closes #18954.
| * refactor: replace char_u #18429dundargoc2022-06-28
| | | | | | Work on https://github.com/neovim/neovim/issues/459
| * fix(inccommand): parse the command to check if it is previewableFamiu Haque2022-06-28
| | | | | | | | | | Free regprog if command isn't previewable Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * fix(api): change default value of 'pattern' in nvim_exec_autocmds (#19115)Gregory Anders2022-06-27
| | | | | | | | | | | | Omitting 'pattern' in nvim_exec_autocmds should be equivalent to omitting the 'fname' argument in :doautoall, which is equivalent to using an empty string as the pattern. Fixes regression introduced in #19091.
| * refactor(api): use FOREACH_ITEM macro in autocmdChristian Clason2022-06-26
| |
| * feat(api): support pattern array for exec_autocmdsChristian Clason2022-06-26
| |
| * Merge pull request #19041 from lewis6991/globallocalbfredl2022-06-25
| |\ | | | | | | fix(api): nvim_set_option_value for global-local options
| | * fix(api): nvim_set_option_value for global-local optionsLewis Russell2022-06-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | global-local window options need to be handled specially. When `win` is given but `scope` is not, then we want to set the local version of the option but not the global one, therefore we need to force `scope='local'`. Note this does not apply to window-local only options (e.g. 'number') Example: nvim_set_option_value('scrolloff', 10, {}) -- global-local window option; set global value nvim_set_option_value('scrolloff', 20, {win=0}) -- global-local window option; set local value nvim_set_option_value('number', true, {}) -- local window option is now equivalent to: nvim_set_option_value('scrolloff', 10, {}) nvim_set_option_value('scrolloff', 20, {win=0, scope='local'}) -- changed from before nvim_set_option_value('number', true, {win=0}) -- unchanged from before Only the global-local option with a `win` provided gets forced to local scope.
| * | fix(api): check for inclusive buffer line index out of bounds correctly (#19056)zeertzjq2022-06-23
| | |
| * | 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().
| * | fix(api): check error after getting win/buf handle (#19052)Gregory Anders2022-06-22
| |/
| * Merge pull request #19039 from bfredl/multicolorbfredl2022-06-22
| |\ | | | | | | perf: get rid of unnecessary allocations in highlight groups