aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nicezeertzjq2022-04-29
| | | | | | | | | Problem: Using \{xxx} for encoding a modifier is not nice. Solution: Use \<*xxx> instead, since it's the same as \<xxx> but producing a different code. https://github.com/vim/vim/commit/fccd93f0917234b962ce07d1df3adf9d7105936f Use this notation in langmap_spec.
* vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifierzeertzjq2022-04-29
| | | | | | | | Problem: GUI tests fail because the test doesn't use a modifier. Solution: Add "\{xxx}" to be able to encode a modifier. https://github.com/vim/vim/commit/ebe9d34aa07037cff2188a8dd424ee1f59cbb0bf Change macros to enums to use them in unit tests.
* vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabledzeertzjq2022-04-29
| | | | | | | | | | | | | Problem: Cannot map <C-H> when modifyOtherKeys is enabled. Solution: Add the <C-H> mapping twice, both with modifier and as 0x08. Use only the first one when modifyOtherKeys has been detected. https://github.com/vim/vim/commit/459fd785e4a8d044147a3f83a5fca8748528aa84 Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of "special" is different between Vim and Nvim. Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs. Omit tests as they send terminal codes. Keep the behavior of API functions.
* refactor: convert macros to all-caps (#17895)dundargoc2022-04-24
| | | Closes https://github.com/neovim/neovim/issues/6297
* refactor: add pure attribute to pure functions (#18165)dundargoc2022-04-24
| | | | This will allow the compilers that support the pure attribute to make further optimizations.
* vim-patch:8.2.4797: getwininfo() may get oudated valueszeertzjq2022-04-21
| | | | | | | | Problem: getwininfo() may get oudated values. Solution: Make sure w_botline is up-to-date. (closes vim/vim#10226) https://github.com/vim/vim/commit/8530b41fd3872c9a1349b083470d565677948518 Correct test order and add a modeline in test_bufwintabinfo.vim.
* vim-patch:8.2.4734: getcharpos() may change a mark position (#18077)zeertzjq2022-04-11
| | | | | Problem: getcharpos() may change a mark position. Solution: Copy the mark position. (closes vim/vim#10148) https://github.com/vim/vim/commit/3caf1cce2b85a8f24195d057f0ad63082543e99e
* vim-patch:8.1.1687: the evalfunc.c file is too big (#17949)Lewis Russell2022-04-03
| | | | | Problem: The evalfunc.c file is too big. Solution: Move testing support to a separate file. https://github.com/vim/vim/commit/ecaa70ea29c269dd0dabd3cd5acdfa0ce42ccd54
* feat(test): use nvim_exec in helpers.source() #16064Justin M. Keyes2022-03-27
| | | | | | | | helpers.source() was a hack to work around the lack of anonymous :source. Its "create tempfile" behavior is not a required part of most tests that use it. Some tests still need the old "create tempfile" behavior either because they test SID behavior, or because of missing nvim_exec features: #16071
* chore: add additional compiler flags (#17815)Lewis Russell2022-03-24
| | | | | | | | | Added: - -Wdouble-promotion - -Wmissing-noreturn - -Wmissing-format-attribute - -Wsuggest-attribute={pure,const,malloc,cold} Resolves: #343
* vim-patch:8.1.1734: the evalfunc.c file is too bigLewis Russell2022-03-20
| | | | | | | Problem: The evalfunc.c file is too big. Solution: Move some functions to other files. https://github.com/vim/vim/commit/29b7d7a9aac591f920edb89241c8cde27378e50b
* feat(api): remove Lua autocommand callbacks when they return true (#17784)Gregory Anders2022-03-19
| | | | This copies the semantics of nvim_buf_attach callbacks, and is a convenient way to create oneshot autocommands gated by some condition.
* vim-patch:8.1.1693: syntax coloring and highlighting is in one big file (#17721)Lewis Russell2022-03-18
| | | | | | | | | | | Problem: Syntax coloring and highlighting is in one big file. Solution: Move the highlighting to a separate file. (Yegappan Lakshmanan, closes vim/vim#4674) https://github.com/vim/vim/commit/f9cc9f209ede9f15959e4c2351e970477c139614 Name the new file highlight_group.c instead. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* Merge pull request #17718 from dundargoc/doxygen/eval_cbfredl2022-03-14
|\ | | | | refactor(eval): convert function comments to doxygen format
| * refactor(eval): convert function comments to doxygen formatDundar Göc2022-03-14
| |
* | vim-patch:8.2.4428: crash when switching tabpage while in the cmdline windowSean Dewar2022-03-14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when switching tabpage while in the cmdline window. Solution: Disallow switching tabpage when in the cmdline window. https://github.com/vim/vim/commit/0f6e28f686dbb59ab3b562408ab9b2234797b9b1 Ensure cmdline window doesn't stop us from closing tabs with EXITFREE. mem_free_all -> win_free_all -> tabpage_close -> ... -> goto_tabpage_tp -> CHECK_CMDWIN can cause an infinite loop if Nvim is exited without using standard methods such as :qa! and friends (e.g: killed via a signal). This issue had caused the ASAN CI's functionaltests to timeout. Cherry-pick Test_cmdwin_tabpage from v8.2.4463. https://github.com/vim/vim/commit/38b85cb4d7216705058708bacbc25ab90cd61595 This bug was already fixed in Nvim. Note that g<Tab> inside cmdwin is already tested for in tabnewentered_spec.lua anyway. E492 is thrown after E11 when using ":norm" in assert_fails for some reason (except after v8.2.1919, which isn't ported yet). As v8.2.1183 isn't ported yet, so we cannot assert E11 directly. Modify the test to check for E11 and E492 seperately; when v8.2.1183 is ported, the assertion for E492 will fail and the changes can be reverted to match upstream. Remove redundant CHECK_CMDWIN from goto_tabpage; it's handled with text_locked() and text_locked_msg() above: vim-patch:8.2.4434: duplicate check for cmdline window Problem: Duplicate check for cmdline window. Solution: Remove the second check. (Sean Dewar, closes vim/vim#9816) https://github.com/vim/vim/commit/16b51d26fe2cc3afb09afd439069220dea74581d
* vim-patch:8.1.0892: failure when closing a window when location list is in useVVKot2022-03-13
| | | | | | | | Problem: Failure when closing a window when location list is in use. Solution: Handle the situation gracefully. Make sure memory for 'switchbuf' is not freed at the wrong time. (Yegappan Lakshmanan, closes vim/vim#3928) https://github.com/vim/vim/commit/eeb1b9c7ed33c152e041a286d79bf3ed00d80e40
* refactor(uncrustify): format all c filesDundar Göc2022-03-10
|
* Merge pull request #17622 from ↵zeertzjq2022-03-09
|\ | | | | | | | | dundargoc/refactor/clang-tidy/remove-redundant-casts refactor/clang tidy/remove redundant casts
| * refactor: remove redundant castsDundar Göc2022-03-06
| |
* | fix: do not pass aucmd to the callback (#17650)TJ DeVries2022-03-08
| |
* | chore(aucmd): remove left-over debug log (#17649)Christian Clason2022-03-08
|/
* refactor: fix clang-tidy bugprone-signed-char-misuse warningsDundar Göc2022-03-04
| | | | | Prefer to declare variables with correct type instead of explicit casts wherever possible.
* fix: anonymous sid not workingshadmansaleh2022-02-28
|
* feat(lua): add api and lua autocmdsTJ DeVries2022-02-27
|
* vim-patch:8.2.2342: "char" functions may return wrong column in Insert modezeertzjq2022-02-12
| | | | | | | Problem: "char" functions return the wront column in Insert mode when the cursor is beyond the end of the line. Solution: Compute the column correctly. (Yegappan Lakshmanan, closes vim/vim#7669) https://github.com/vim/vim/commit/9145846b6aa411e3ab5c0d145b37808654352877
* vim-patch:8.2.0918: duplicate code for evaluating expression argumentSean Dewar2022-02-12
| | | | | | Problem: Duplicate code for evaluating expression argument. Solution: Merge the code and make the use more flexible. https://github.com/vim/vim/commit/a9c010494767e43a51c443cac35ebc80d0831d0b
* vim-patch:8.2.0915: search() cannot skip over matches like searchpair() canSean Dewar2022-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Search() cannot skip over matches like searchpair() can. Solution: Add an optional "skip" argument. (Christian Brabandt, closes vim/vim#861) https://github.com/vim/vim/commit/adc17a5f9d207fd1623fd923457a46efc9214777 Enable skip arg usage in autoload/freebasic.vim evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway: - Port evalarg_T into eval.h and use const char * and Callback fields - Use EVALARG_INIT to initialize - Return bool over OK/FAIL from evalarg functions - Remove check from evalarg_clean as callback_free ignores None callbacks anyway - Move eva_buf field into evalarg_get as a local (not sure what reason it has being in the struct) N/A patches for version.c: vim-patch:8.2.4355: unnecessary call to check_colorcolumn() Problem: Unnecessary call to check_colorcolumn(). Solution: Remove the call. (Sean Dewar, closes vim/vim#9748) https://github.com/vim/vim/commit/0f7ff851cb721bb3c07261adbf82b591229f530d
* vim-patch:8.2.4337: part of condition is always true (#17352)dundargoc2022-02-09
| | | | | Problem: Part of condition is always true. Solution: Remove that part of the condition. (closes vim/vim#9729) https://github.com/vim/vim/commit/78a8404f8b6ad0152614d5fdc3ec277444c1eee5
* vim-patch:8.2.0942: expanding to local dir after homedir keeps "~/"zeertzjq2022-02-07
| | | | | | | Problem: Expanding to local dir after homedir keeps "~/". Solution: Adjust modify_fname(). (Christian Brabandt, closes vim/vim#6205, closes vim/vim#5979) https://github.com/vim/vim/commit/0e390f40e944036fb558a63b91238cfda128d95f
* vim-patch:8.2.0215: wrong file name shorteningzeertzjq2022-02-07
| | | | | | | Problem: Wrong file name shortening. (Ingo Karkat) Solution: Better check for path separator. (Yasuhiro Matsumoto, closes vim/vim#5583, closes vim/vim#5584) https://github.com/vim/vim/commit/a78e9c61a0ded9c5302bc77e889aa1b3d3467f61
* vim-patch:8.2.0208: fnamemodify() does not apply ":~" when followed by ":."zeertzjq2022-02-07
| | | | | | | Problem: Fnamemodify() does not apply ":~" when followed by ":.". Solution: Don't let a failing ":." cause the ":~" to be skipped. (Yasuhiro Matsumoto, closes vim/vim#5577) https://github.com/vim/vim/commit/d816cd94d87afb73c505bf1e5cd5e07522482113
* Merge pull request #16862 from seandewar/vim-8.2.2658Sean Dewar2022-02-06
|\ | | | | vim-patch:8.2.{2658,2661,2736}: for loop over strings
| * feat(eval): port emsg from v8.2.3284Sean Dewar2022-02-05
| | | | | | | | https://github.com/vim/vim/commit/80d7395dcfe96158428da6bb3d28a6eee1244e28
| * vim-patch:8.2.2661: leaking memory when looping over a stringSean Dewar2022-02-05
| | | | | | | | | | | | Problem: Leaking memory when looping over a string. Solution: Free the memory. https://github.com/vim/vim/commit/bb5d87c8504588be9c9d2fecc5b6455a2b2f6201
| * vim-patch:8.2.2658: :for cannot loop over a stringSean Dewar2022-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: :for cannot loop over a string. Solution: Accept a string argument and iterate over its characters. https://github.com/vim/vim/commit/74e54fcb447e5db32f9c2df34c0554bbecdccca2 v8.2.2659 is already ported. N/A patches for version.c: vim-patch:8.2.2736: Vim9: for loop over string is a bit slow Problem: Vim9: for loop over string is a bit slow. Solution: Avoid using strlen(). https://github.com/vim/vim/commit/175a41c13f3e27e30c662f2f418c5a347dbc645d
* | vim-patch:8.2.2324: not easy to get mark en cursor posotion by character countzeertzjq2022-02-06
|/ | | | | | | Problem: Not easy to get mark en cursor posotion by character count. Solution: Add functions that use character index. (Yegappan Lakshmanan, closes vim/vim#7648) https://github.com/vim/vim/commit/6f02b00bb0958f70bc15534e115b4c6dadff0e06
* vim-patch:8.2.4018: ml_get error when win_execute redraws with Visual selectionSean Dewar2022-02-03
| | | | | | | | | | | Problem: ml_get error when win_execute redraws with Visual selection. Solution: Disable Visual area temporarily. (closes vim/vim#9479) https://github.com/vim/vim/commit/18f4740f043b353abe47b7a00131317052457686 {switch_to/restore}_win_for_buf is N/A (marked as such in v8.0.0860; currently only used in Vim's if_py). Add a modeline to test_execute_func.vim.
* [RFC] fix: has('python') error (#17252)Shougo2022-01-31
| | | | | * fix: has('python') error * fix: functional tests
* Merge pull request #17239 from seandewar/vim-8.2.3629Sean Dewar2022-01-31
|\ | | | | vim-patch:8.2.{3433,3629}
| * vim-patch:8.2.3629: command completion in cmdline window uses global commandsSean Dewar2022-01-30
| | | | | | | | | | | | | | Problem: Command completion in cmdline window uses global user commands, not local commands for the window where it was opened from. Solution: Use local commands. (closes vim/vim#9168) https://github.com/vim/vim/commit/a1198124370a366ff02811a43845a631b5c6e7f0
* | vim-patch:8.1.2412: crash when evaluating expression with error (#17109)zeertzjq2022-01-31
|/
* fix(eval): v:lua support for `-` in module namesbb010g2022-01-28
|
* vim-patch:8.2.0175: crash when removing list element in map()Sean Dewar2022-01-18
| | | | | | Problem: Crash when removing list element in map(). Solution: Lock the list. (closes vim/vim#2652) https://github.com/vim/vim/commit/db661fb95dc41b7a9438cf3cd4e77f8410bc81c0
* feat(api): add support for lua function & description in keymapshadmansaleh2022-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behavioral changes: 1. Added support for lua function in keymaps in -------------------------------------------- - nvim_set_keymap Can set lua function as keymap rhs like following: ```lua vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references}) ``` Note: lua function can only be set from lua . If api function being called from viml or over rpc this option isn't available. - nvim_{buf_}get_keymap When called from lua, lua function is returned is `callback` key . But in other cases callback contains number of the function ref. - :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly. - :map commands for displaing rhs . For lua keymaps rhs is displayed as <Lua function ref_no> Note: lua keymap cannot be set through viml command / functions. - mapargs() When dict is false it returns string in `<Lua function ref_no>` format (same format as :map commands). When dict is true it returns ref_no number in `callback` key. - mapcheck() returns string in `<Lua function ref_no>` format (same format as :map commands). 2. Added support for keymap description --------------------------------------- - nvim_{buf_}set_keymap: added `desc` option in opts table . ```lua vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'}) ``` - nvim_{buf_}get_keymap: contains `desc` in returned list. - commands like `:nmap <leader>w` will show description in a new line below rhs. - `maparg()` return dict contains `desc`.
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* refactor(misc1): move out autocmd related functionsBjörn Linse2021-12-09
|
* Merge pull request #16107 from zeertzjq/vim-8.1.1542Jan Edmund Lazo2021-12-06
|\ | | | | vim-patch:8.1.1542,8.2.3549: an OptionSet autocommand does not get enough info
| * vim-patch:8.1.1542: an OptionSet autocommand does not get enough infozeertzjq2021-11-22
| | | | | | | | | | | | | | Problem: An OptionSet autocommand does not get enough info. Solution: Add v:option_command, v:option_oldlocal and v:option_oldglobal. (Latrice Wilgus, closes vim/vim#4118) https://github.com/vim/vim/commit/d7c968794710f338d491072171df48f96612cf72
* | lint (#16526)Jan Edmund Lazo2021-12-05
| |