aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
Commit message (Collapse)AuthorAge
...
* extmarks/bufhl: reimplement using new marktree data structureBjörn Linse2020-01-16
| | | | | | | | | | | | | | | | | | | | Add new "splice" interface for tracking buffer changes at the byte level. This will later be reused for byte-resolution buffer updates. (Implementation has been started, but using undocumented "_on_bytes" option now as interface hasn't been finalized). Use this interface to improve many edge cases of extmark adjustment. Changed tests indicate previously incorrect behavior. Adding tests for more edge cases will be follow-up work (overlaps on_bytes tests) Don't consider creation/deletion of marks an undoable event by itself. This behavior was never documented, and imposes complexity for little gain. Add nvim__buf_add_decoration temporary API for direct access to the new implementation. This should be refactored into a proper API for decorations, probably involving a huge dict. fixes #11598
* API: include invalid buffer/window/tabpage in error message (#11712)Daniel Hahler2020-01-14
|
* API: fix crash on copy_object(kObjectTypeWindow) #11651Ghjuvan Lacambre2020-01-02
| | | Closes #11646
* doc + extmarks tweaks #11421Justin M. Keyes2019-11-25
| | | | - nvim_buf_get_extmarks: rename "amount" => "limit" - rename `set_extmark_index_from_obj`
* extmark: rename ExtendedMark => ExtmarkJustin M. Keyes2019-11-11
|
* extmark: review changesBjörn Linse2019-11-11
|
* nsmarks: initial committimeyyy2019-11-11
|
* namespace: add ns_initialized funcTimothy C Eichler2019-11-11
|
* vim-patch:8.1.0362: cannot get the script line number when executing a functionerw72019-09-04
| | | | | | | Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761
* api: make try_end clean-up after an exception properly. Fixes #10809Björn Linse2019-09-02
| | | | | | Otherwise `force_abort` will cause an emsg() higher on the stack to be converted to an exception, even though it is outside any try/catch.
* 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: break lines at CR, CRLF #10877Justin M. Keyes2019-08-29
| | | | | | Some terminals helpfully translate \n to \r. fix #10872 ref #10223
* API: nvim_pasteJustin M. Keyes2019-08-27
|
* api: allow nvim_buf_attach from lua using callbacksBjörn Linse2019-06-04
|
* 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
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* ui: implement ext_messagesBjörn Linse2019-02-10
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* api: add nvim_create_buf to create a new empty buffer.Björn Linse2019-02-09
| | | | | | | | | | | | Loading existing files into a buffer is non-trivial and requires a window. Creating an unnamed emtpy buffer is trivial and safe though, thus worth a special case. Change nvim_buf_set_option to use aucmd_prepbuf. This is necessary to allow some options to be set on a not yet displayed buffer, such as 'buftype' option. vim-patch:7.4.1858: Add BLN_NEW to enforce buflist_new creating new buffer
* dict_set_var: check value before checking its containerJustin M. Keyes2019-01-14
| | | | | | | - When setting a fixed/locked/readonly var, it is more relevant to report on the key, not its container dict. If its container dict (v:) is readonly, that does not mean the key itself is readonly. - Allow modifying a "fixed" var. "fixed" only prevents deletion.
* func_attr.h: FUNC_ATTR_PRINTFMichael Hoffmann2018-09-23
|
* 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.
* refactor: buf_collect_lines (#8509)Justin M. Keyes2018-06-09
| | | Move redundant common logic into a function.
* api: list information about all channels/jobs.Björn Linse2018-05-23
| | | | | Fire autocmd when channel opens or its info changes. Add a way for API clients can describe themselves.
* API: nvim_get_commands(): always return keysJustin M. Keyes2018-05-11
| | | | | | - Always return all keys, with at least NIL value. - Require `opts` param to be {"builtin":false} - Validate `opts` param
* API: nvim_get_commands()Nimit Bhardwaj2018-05-11
|
* Merge #8329 'API: Make nvim_set_option() update `:verbose set …`'Justin M. Keyes2018-05-11
|\
| * api: Make nvim_set_option() update `:verbose set ...`b-r-o-c-k2018-05-03
| | | | | | | | | | | | Make `:verbose set ...` show when an option was last modified by an API client or Lua script/chunk. In the case of an API client, the channel ID is displayed.
* | docJustin M. Keyes2018-05-09
|/
* *: Replace did_throw checks with current_exception checksZyX2018-03-25
| | | Removes obsolete did_throw after that.
* *: Make sure that !did_throw implies !current_exceptionZyX2018-03-25
| | | | Fixes #7876
* build/MSVC: fix "C4003: not enough actual parameters for macro"Justin M. Keyes2018-03-18
| | | | | | For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because: https://github.com/neovim/neovim/pull/8142#discussion_r175262436 > this variant will trigger array overrun warnings from various static analyzers.
* ui: refactor ui optionsBjörn Linse2018-02-13
|
* *: Provide list length when allocating listsZyX2018-01-14
|
* *: Remove most calls to tv_list_item_allocZyX2017-12-24
| | | | Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the only reason why function did not receive `static` modifier.
* *: Hide list implementation in other files as wellZyX2017-12-10
|
* *: Start hiding list implementationZyX2017-12-10
| | | | Most of files, except for eval.c and eval/* were only processed by perl.
* Merge #7593 'PVS static analysis fixes'Justin M. Keyes2017-11-22
|\
| * helpers.c: statically assert integer falls within rangePeter Kalauskas2017-11-22
|/
* ext_cmdline: add support for highlightingBjörn Linse2017-10-26
|
* ext_cmdline: added cmdline levelDongdong Zhou2017-10-26
| | | | add cchar_to_string
* api/helpers: Fix typoZyX2017-08-06
|
* api/helpers: Clarify try_start() usageZyX2017-08-06
|
* *: Fix clint errorsZyX2017-07-18
|
* api helpers: Also save and restore did_emsgZyX2017-07-18
|
* api helpers: Save/restore more values in try_enter/try_leaveZyX2017-07-16
| | | | This fixes memory leak reported by ASAN. This also somehow fixes test40, though I have no idea why except that that test yields memory leak report.
* Merge branch 'master' into colored-cmdlineZyX2017-07-15
|\
| * dict_get_value(): name the missing key (#6952)Matthieu Coudron2017-07-03
| |
* | ex_getln: Save and restore try stateZyX2017-07-01
|/ | | | | | | | | | | | | | | | Problem: when processing cycle such as :for pat in [' \ze*', ' \zs*'] : try : let l = matchlist('x x', pat) : $put ='E888 NOT detected for ' . pat : catch : $put ='E888 detected for ' . pat : endtry :endfor `:let l = …` throwing an error causes this error to be caught after color_cmdline attempts to get callback for highlighting next line (the one with `$put = 'E888 NOT…`). Saving/restoring state prevents this from happening.