aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
Commit message (Collapse)AuthorAge
...
| * 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.
* vim-patch:8.0.0607 (#6879)Daniel Hahler2017-06-11
| | | | | | | | Problem: When creating a bufref, then using :bwipe and :new it might get the same memory and bufref_valid() returns true. Solution: Add br_fnum to check the buffer number didn't change. https://github.com/vim/vim/commit/45e5fd135da5710f24a1acc142692f120f8b0b78
* get_keymap API (#6236)TJ DeVries2017-05-25
| | | | | | | * Add api function get keymap nvim_get_keymap(mode) nvim_buf_get_keymap(buffer, mode)
* api: add metadata for ui eventsBjörn Linse2017-05-10
|
* api: generate ui eventsBjörn Linse2017-05-10
|
* Merge branch 'master' into luaviml'/luaZyX2017-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_set_error(): renameJustin M. Keyes2017-04-23
| |
| * api/internal: Remove `set` field from Error type.Justin M. Keyes2017-04-23
| |
| * api_clear_error: Skip if error was not set.Justin M. Keyes2017-04-23
| |
| * api_clear_error()Justin M. Keyes2017-04-23
| |
| * api: Do not truncate errors <1 MB. #6237Sander Bosma2017-04-23
| | | | | | | | Closes #5984
| * *: Add comment to all C filesZyX2017-04-19
| |
* | Merge branch 'master' into luaviml'/luaZyX2017-04-08
|\|
| * api: {get,set}_option should {get,set} global value of local options (#6405)Jakob Schnitzer2017-03-30
| | | | | | | | | | - nvim_get_option should return the global default of a local option. - nvim_set_option should set the global default of a local option.
| * eval: Move copy_tv to eval/typvalZyX2017-03-29
| |
| * eval,*: Move get_tv_string to typval.cZyX2017-03-29
| | | | | | | | Function was renamed and changed to return `const char *`.
| * *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | | | | | Also fixes buffer reusage in setmatches() and complete().
| * eval: Split eval.c into smaller filesZyX2017-03-29
| |
* | api: Also shift numbers in api_metadata outputZyX2017-03-27
| | | | | | | | | | | | Fixes problem introduced by “api: Allow kObjectTypeNil to be zero without breaking compatibility”: apparently there are clients which use metadata and there are which aren’t. For the first that commit would not be needed, for the second that commit misses this critical piece.
* | functests: Test for error conditionsZyX2017-03-27
|/ | | | | | | | | | | | | | | | | | | | | | | During testing found the following bugs: 1. msgpack-gen.lua script is completely unprepared for Float values either in return type or in arguments. Specifically: 1. At the time of writing relevant code FLOAT_OBJ did not exist as well as FLOATING_OBJ, but it would be used by msgpack-gen.lua should return type be Float. I added FLOATING_OBJ macros later because did not know that msgpack-gen.lua uses these _OBJ macros, otherwise it would be FLOAT_OBJ. 2. msgpack-gen.lua should use .data.floating in place of .data.float. But it did not expect that .data subattribute may have name different from lowercased type name. 2. vim_replace_termcodes returned its argument as-is if it receives an empty string (as well as _vim_id*() functions did). But if something in returned argument lives in an allocated memory such action will cause double free: once when freeing arguments, then when freeing return value. It did not cause problems yet because msgpack bindings return empty string as {NULL, 0} and nothing was actually allocated. 3. New code in msgpack-gen.lua popped arguments in reversed order, making lua bindings’ signatures be different from API ones.
* api: Make sure dict_set_var doesn’t edit read-only valuesZyX2017-02-23
| | | Fixes #6147
* api: Rename dict_set_value to dict_set_varZyX2017-02-23
| | | | | | | | | | | | | | | | | | Reasonings: 1. It is not used for anything, but scope dictionaries currenly. So there is no need to generalize and split it into dict_set_var (which will contain some scope-dictionary-specific checks) and dict_set_value (which will work for any dictionary). 2. Check for key size is no longer valid for non-scope dictionaries: you *can* use empty keys there. In scope dictionaries also, but you actually are not supposed to store there anything, but variables. Note that actually one may still do let b:[''] = 1 and “bypass” check for variable name. It won’t change what `echo b:` will show, but it may affect code which iterates over scope dictionary keys and sets them to something (if there is such code).
* api/helpers: Remove NULL dereference (#6109)Nikolai Aleksandrovich Pavlov2017-02-14
| | | | Even though all used compilers can swallow this code, it is still undefined behaviour.
* Make Nvim work with latest vim-patch v7.4.2024Marco Hinz2017-02-04
| | | | | | | | v7.4.2024 changed a few function signatures of functions that we use in Neovim-specific code, e.g. the API. Due to that the commit for 7.4.2024 doesn't build on its own, only together with this commit.
* eval: Fix failing testZyX2017-01-07
|
* eval: Make sure that copyID is reset when neededZyX2017-01-07
| | | | | Works by making value pushed on stack represent the exhausted list. Fixes #5901, except for dictionaries which need similar adjustment.
* eval/typval_encode: Use TYPVAL_ENCODE_CONV_EMPTY_DICT for partialsZyX2017-01-06
|
* *: Remove `// fname()` comments near typval_encode includesZyX2017-01-04
|
* tests: Add tests for partials dumpingZyX2017-01-03
| | | | | Also fixed dumping of partials by encode_vim_to_object and added code which is able to work with partials and dictionaries to test/unit/eval/helpers.lua (mostly copied from #5119, except for partials handling).
* eval/typval_encode: Refactor arguments to argument macrosesZyX2017-01-03
| | | Fixed local test failures somewhere in process.
* api/helpers: Fix unused variable error in release buildZyX2017-01-03
|
* eval/typval_encode: Refactor big-big macros into .c.h fileZyX2017-01-03
| | | | | This makes gdb backtraces much more meaningful: specifically I now know at which line it crashes in place of seeing that it crashes at TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS macros invocation.
* eval/typval_encode: Make partial conversions not recursiveZyX2017-01-03
| | | | | | Is known to crash in the current state. Ref #5825.
* vim-patch:7.4.1719Michael Ennen2016-12-12
| | | | | | | | | | Problem: Leaking memory when there is a cycle involving a job and a partial. Solution: Add a copyID to job and channel. Set references in items referred by them. Go through all jobs and channels to find unreferenced items. Also, decrement reference counts when garbage collecting. https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
* vim-patch:7.4.1559Michael Ennen2016-12-12
| | | | | | | Problem: Passing cookie to a callback is clumsy. Solution: Change function() to take arguments and return a partial. https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
* Merge #5752 from justinmk/docJustin M. Keyes2016-12-11
|\ | | | | doc: api_info(), typval_encode.h
| * doc: eval/typval_encode.hJustin M. Keyes2016-10-31
| | | | | | | | Annotate TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS to aid code navigation.
* | lintJames McCoy2016-11-02
| |
* | object_to_vim: Fix buffer/window/tabpage conversion on BE systemsJames McCoy2016-11-02
|/ | | | | | | | | | | Since data.integer is a different (larger) integer type than data.{buffer,window,tabpage}, we cannot abuse the union by using data.integer to access the value for all 4 types. Instead, remove the {buffer,window,tabpage} members and always use the integer member. In order to accomodate this, perform distinct validation and coercion between the Integer type and Buffer/Window/Tabpage types in object_to_vim, msgpack_rpc helpers, and gendispatch.lua.