aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
Commit message (Collapse)AuthorAge
...
* fix(api): avoid integer truncationAndreas Schneider2023-04-21
| | | | | | | | | | | | | | | | | | | | | | gsrc/nvim/api/vim.c: In function ‘nvim_eval_statusline’: gsrc/nvim/api/vim.c:2268:55: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-tru ncation=] 2268 | snprintf(user_group, sizeof(user_group), "User%d", sp->userhl); | ^~ gsrc/nvim/api/vim.c:2268:50: note: directive argument in the range [1, 2147483647] 2268 | snprintf(user_group, sizeof(user_group), "User%d", sp->userhl); | ^~~~~~~~ In file included from /usr/include/stdio.h:906, from gsrc/nvim/api/vim.c:9: In function ‘snprintf’, inlined from ‘nvim_eval_statusline’ at gsrc/nvim/api/vim.c:2268:9: /usr/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 6 and 15 bytes into a destination of size 6 54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~
* build: update uncrustify to 0.76Lewis Russell2023-04-19
|
* fix(api): extmark highlight groups not always included in details (#23179)luukvbaal2023-04-18
| | | | Problem: Erroneous for loop condition. Solution: Remove for loop condition.
* Merge pull request #22968 from luukvbaal/evalstcbfredl2023-04-14
|\ | | | | fix(api): update "w_scwidth" in nvim_eval_statusline()
| * fix(api): update "w_scwidth" in nvim_eval_statusline()Luuk van Baal2023-04-09
| | | | | | | | | | | | Problem: `w_scwidth` may be outdated in `nvim_eval_status()`, causing `build_stl_str_hl()` to return an empty `%s` sign segment. Solution: Update `w_scwidth` for `'statuscolumn'` evaluation.
* | vim-patch:8.2.1080: Vim9: no line break allowed in a for loopzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: no line break allowed in a for loop. Solution: Skip line breaks in for command. https://github.com/vim/vim/commit/b7a78f7a6713f07d2fcad0b27dea22925c7b1cdf Omit *_break_count and skip_for_lines(): Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | vim-patch:8.2.1047: Vim9: script cannot use line continuation like :def functionzeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: script cannot use line continuation like in a :def function. Solution: Pass the getline function pointer to the eval() functions. Use it for addition and multiplication operators. https://github.com/vim/vim/commit/5409f5d8c95007216ae1190565a7a8ee9ebd7100 Omit source_nextline() and eval_next_non_blank(): Vim9 script only. N/A patches for version.c: vim-patch:8.2.1048: build failure without the eval feature Problem: Build failure without the eval feature. Solution: Add dummy typedef. https://github.com/vim/vim/commit/9d40c63c7dc8c3eb3886c58dcd334bc7f37eceba vim-patch:8.2.1052: build failure with older compilers Problem: Build failure with older compilers. Solution: Move declaration to start of block. https://github.com/vim/vim/commit/7acde51832f383f9a6d2e740cd0420b433ea841a Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | vim-patch:8.2.{0695,0725,0734,0753,0818,0819,0822} (#23075)zeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.2.0695: Vim9: cannot define a function inside a function Problem: Vim9: cannot define a function inside a function. Solution: Initial support for :def inside :def. https://github.com/vim/vim/commit/04b12697838b232b8b17c553ccc74cf1f1bdb81c vim-patch:8.2.0725: Vim9: cannot call a function declared later in Vim9 script Problem: Vim9: cannot call a function declared later in Vim9 script. Solution: Make two passes through the script file. https://github.com/vim/vim/commit/09689a02840be40fa7bb10b1921fb5bc5b2908f1 vim-patch:8.2.0734: Vim9: leaking memory when using :finish Problem: Vim9: leaking memory when using :finish. Solution: Do not check for next line in third pass. https://github.com/vim/vim/commit/04816717dfea6e2469ff4c9d40f68b59aaf03724 vim-patch:8.2.0753: Vim9: expressions are evaluated in the discovery phase Problem: Vim9: expressions are evaluated in the discovery phase. Solution: Bail out if an expression is not a constant. Require a type for declared constants. https://github.com/vim/vim/commit/32e351179eacfc84f64cd5029e221582d400bb38 vim-patch:8.2.0818: Vim9: using a discovery phase doesn't work well Problem: Vim9: using a discovery phase doesn't work well. Solution: Remove the discovery phase, instead compile a function only when it is used. Add :defcompile to compile def functions earlier. https://github.com/vim/vim/commit/822ba24743af9ee1b5e7f656a7a61a38f3638bca vim-patch:8.2.0819: compiler warning for unused variable Problem: Compiler warning for unused variable. Solution: Remove the variable. https://github.com/vim/vim/commit/f40e51a880a95f94dbbbecc9476559506c2cc345 vim-patch:8.2.0822: Vim9: code left over from discovery phase Problem: Vim9: code left over from discovery phase. Solution: Remove the dead code. https://github.com/vim/vim/commit/2eec37926db6d31beb36f162ac00357a30c093c8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | Merge pull request #22865 from MunifTanjim/issue-20370bfredl2023-04-10
|\ \ | |/ |/| fix(api): do not re-apply win_config.style when missing
| * fix(api): do not re-apply win_config.style when missingMunif Tanjim2023-04-10
| |
* | Merge pull request #22873 from bfredl/keyset2bfredl2023-04-08
|\ \ | | | | | | refactor(api): make typed dicts appear as real types in the source code
| * | refactor(api): make typed dicts appear as types in the source codebfredl2023-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problem: can we have Serde? solution: we have Serde at home This by itself is just a change of notation, that could be quickly merged to avoid messy merge conflicts, but upcoming changes are planned: - keysets no longer need to be defined in one single file. `keysets.h` is just the initial automatic conversion of the previous `keysets.lua`. keysets just used in a single api/{scope}.h can be moved to that file, later on. - Typed dicts will have more specific types than Object. this will enable most of the existing manual typechecking boilerplate to be eliminated. We will need some annotation for missing value, i e a boolean will need to be represented as a TriState (none/false/true) in some cases. - Eventually: optional parameters in form of a `Dict opts` final parameter will get added in some form to metadata. this will require a discussion/desicion about type forward compatibility.
* | | refactor: remove redundant castsii142023-04-07
|/ /
* | refactor: remove redundant const char * castsii142023-04-07
| |
* | Merge pull request #22907 from luukvbaal/evalstcbfredl2023-04-07
|\ \ | | | | | | feat(api): set statuscolumn line number in nvim_eval_statusline()
| * | feat(api): set statuscolumn line number in nvim_eval_statusline()Luuk van Baal2023-04-07
| | | | | | | | | | | | | | | | | | Having the user set `v:lnum` before calling `nvim_eval_statusline()` is unnecesarily fragile. Redraws inbetween setting `v:lnum` and the `nvim_eval_statusline()` call will overwrite `v:lnum`.
* | | refactor: remove use of reserved c++ keywordsii142023-04-06
| | | | | | | | | | | | | | | | | | libnvim couldn't be easily used in C++ due to the use of reserved keywords. Additionally, add explicit casts to *alloc function calls used in inline functions, as C++ doesn't allow implicit casts from void pointers.
* | | Merge pull request #22910 from bfredl/nonormalbfredl2023-04-06
|\ \ \ | |/ / |/| | fix(highlight): use winhl=Foo:Bar even when Bar is empty
| * | fix(highlight): use winhl=Foo:Bar even when Bar is emptybfredl2023-04-06
| | | | | | | | | | | | fixes #22906
* | | refactor: make error message definitions constii142023-04-05
| | | | | | | | | | | | message.c functions now take const char * as a format. Error message definitions can be made const.
* | | refactor: rename local API alias from a to apiLewis Russell2023-04-05
|/ / | | | | | | | | | | | | | | Problem: Codebase inconsistently binds vim.api onto a or api. Solution: Use api everywhere. a as an identifier is too short to have at the module level.
* | feat(api): evaluate 'statuscolumn' with nvim_eval_statusline()Luuk van Baal2023-04-05
| |
* | fix(api): avoid double hit-enter prompt with nvim_err_writeln (#22879)zeertzjq2023-04-04
|/
* Merge pull request #22778 from luukvbaal/getextbfredl2023-04-02
|\ | | | | feat(extmarks): extend nvim_buf_get_extmarks()
| * feat(extmarks): extend nvim_buf_get_extmarks()Luuk van Baal2023-04-01
| | | | | | | | | | | | | | Problem: Can not get all extmarks in a buffer. Properties are missing from the details array. Solution: Allow getting all extmarks in a buffer by supplying a -1 "ns_id". Add missing properties to the details array.
* | fix(api): return both link and attributes with nvim_get_hl (#22824)Sindre T. Strøm2023-03-31
| | | | | | | | | | Problem: No way to get the actual highlight attributes for a linked group through |nvim_get_hl()| (not the attributes from the link target). Solution: Return the actual attributes as well as the link target name.
* | fix(filetype): avoid recursive FileType autocmds (#22813)Lewis Russell2023-03-29
| |
* | fix(api): Use local LastSet structure in nvim_get_option_info (#22741)Michal Liszcz2023-03-29
|/ | | | | | | | | | fix(api): use local LastSet structure in nvim_get_option_info * nvim_get_option_info is deprecated. It is always using the global LastSet information as reported in #15232. * nvim_get_option_info2 is added. The new function additionally accepts an 'opts' table {scope, buf, win} allowing to specify the option scope and query local options from another buffer or window.
* Merge pull request #22762 from bfredl/hl2ctermbfredl2023-03-25
|\ | | | | fix(api): make nvim_get_hl return 'cterm' attrs properly
| * fix(api): make nvim_get_hl return 'cterm' attrs properlybfredl2023-03-23
| |
* | feat(api): nvim_exec2(), deprecate nvim_exec() #19032Evgeni Chasnovski2023-03-25
|/ | | | | | | Problem: The signature of nvim_exec() is not extensible per ":help api-contract". Solution: Introduce nvim_exec2() and deprecate nvim_exec().
* feat(api): add nvim_get_hl (#22693)Null Chilly2023-03-23
| | | | | Problem: no way of getting all highlight group definitions in a namespace. Solution: add `nvim_get_hl()`, deprecate `nvim_get_hl_by_name()` and `nvim_get_hl_by_id()`.
* fix(api): vim.filetype.get_option() (#22753)Lewis Russell2023-03-22
| | | | - Fix a bug in the cache - Set some buffer options on the dummy buffer
* refactor: do more in TRY_WRAPLewis Russell2023-03-22
|
* feat: add `vim.filetype.get_option()`Lewis Russell2023-03-20
|
* feat(api): add filetype option nvim_get_option_valueLewis Russell2023-03-20
| | | | | - Also adjust the expr-mapping behaviour so normal commands and text changes are allowed in internal dummy buffers.
* refactor(extmarks): some minor internal API changesbfredl2023-03-16
| | | | | | | | | extranges and a bunch of other improvements are coming for 0.10 This gets in some minor surrounding API changes to avoid rebase conflicts until then. - decorations will be able to be specific to windows - adjust deletion API to fit with extranges
* docs(api): link to nvim_set_hl_ns from nvim_set_hl (#22678)ii142023-03-16
|
* feat(ui): add scroll_delta to win_viewport event #19270Matthias Deiml2023-03-12
| | | | | | | | | | scroll_delta contains how much the top line of a window moved since the last time win_viewport was emitted. It is expected to be used to implement smooth scrolling. For this purpose it only counts "virtual" or "displayed" so folds should count as one line. Because of this it adds extra information that cannot be computed from the topline parameter. Fixes #19227
* vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)zeertzjq2023-03-11
| | | | | | | | | | | Problem: Autoload script sourced twice if sourced directly. Solution: Do not source an autoload script again. (issue vim/vim#6644) https://github.com/vim/vim/commit/daa2f36573db3e1df7eb1fdbc3a09a2815644048 Cherry-pick ret_sid changes from patch 8.2.0149. Use do_in_runtimepath() as that's what source_runtime() calls in Nvim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(api): set script context when setting usercmd or option (#22624)zeertzjq2023-03-11
|
* fix(buffer_updates): save and restore current window cursor (#16732)zeertzjq2023-03-09
| | | | | | | | When a buffer update callback is called, textlock is active so buffer text cannot be changed, but cursor can still be moved. This can cause problems when the buffer update is in the middle of an operator, like the one mentioned in #16729. The solution is to save cursor position and restore it afterwards, like how cursor is saved and restored when evaluating an <expr> mapping.
* fix(extmarks): don't leak memory on error (#22507)zeertzjq2023-03-05
|
* Merge pull request #22454 from bfredl/lspredrawbfredl2023-02-28
|\ | | | | perf(lsp): only redraw the windows containing LSP tokens
| * perf(lsp): only redraw the windows containing LSP tokensbfredl2023-02-28
| | | | | | | | | | | | | | | | redraw! redraws the entire screen instead of just the windows with the buffer which were actually changed. I considered trying to calculating the range for the delta but it looks tricky. Could a follow-up.
* | feat(ui): restore has('gui_running')Justin M. Keyes2023-02-27
| | | | | | | | | | | | | | | | | | | | Problem: has('gui_running') is still common in the wild and our answer has changed over time, causing frustration. https://github.com/vimpostor/vim-tpipeline/commit/95a6ccbe9f33bc42dd4cee45731d8bc3fbcd92d1 Solution: Use stdin_tty/stdout_tty to decide if a UI is (not) a GUI.
* | feat(api): more fields in nvim_list_uisJustin M. Keyes2023-02-27
|/ | | | | | | | Problem: nvim_list_uis does not report all ":help ui-option" fields. Solution: Store ":help ui-option" fields on the `UI` object and update ui_array.
* docs: naming conventions, guidelinesJustin M. Keyes2023-02-22
| | | | close #21063
* docs: fix typos (#22353)zeertzjq2023-02-22
|
* docs: fix typos (#21961)dundargoc2023-02-20
| | | Co-authored-by: Ben Morgan <cassava@iexu.de>