aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
Commit message (Collapse)AuthorAge
...
| * | fix(event-loop): call vpeekc() directly first to check for characterzeertzjq2022-02-03
| |/ | | | | | | Expand mappings first by calling `vpeekc()` directly.
* | vim-patch:8.2.2363: curpos() does not accept a string argument as beforezeertzjq2022-02-06
| | | | | | | | | | | | | | Problem: curpos() does not accept a string argument as before. solution: Make a string argument work again. (Yegappan Lakshmanan, closes vim/vim#7690 https://github.com/vim/vim/commit/9ebcf231bdccc1673cc92b20f5190fc577ad29d0
* | 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.1727: a popup created with "cursorline" will ignore "firstline"zeertzjq2022-02-06
| | | | | | | | | | | | | | | | | | | | | | Problem: A popup created with "cursorline" will ignore "firstline". Solution: When both "cursorline" and "firstline" are present put the cursor on "firstline". (closes vim/vim#7000) Add the "winid" argument to getcurpos(). https://github.com/vim/vim/commit/99ca9c4868bb1669706b9e3de9a9218bd11cc459 Skip popup window related code. Cherry-pick all of Test_getcurpos_setpos() from patch 8.2.0610.
* | vim-patch:8.2.0233: crash when using garbagecollect() in between rand()Sean Dewar2022-02-05
| | | | | | | | | | | | | | | | | | | | | | Problem: Crash when using garbagecollect() in between rand(). Solution: Redesign the rand() and srand() implementation. (Yasuhiro Matsumoto, closes vim/vim#5587, closes vim/vim#5588) https://github.com/vim/vim/commit/4f645c54efe33d7a11e314676e503118761f08a7 Omit test_srand_seed. Unmacroify SHUFFLE_XOSHIRO128STARSTAR and SPLITMIX32 while we're at it (leave ROTL alone as it's fairly innocent).
* | vim-patch:8.1.2356: rand() does not use the best algorithmSean Dewar2022-02-05
| | | | | | | | | | | | | | Problem: rand() does not use the best algorithm. Solution: use xoshiro128** instead of xorshift. (Kaito Udagawa, closes vim/vim#5279) https://github.com/vim/vim/commit/f8c1f9200c4b50969a8191a4fe0b0d09edb38979
* | vim-patch:8.1.2343: using time() for srand() is not very randomSean Dewar2022-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using time() for srand() is not very random. Solution: use /dev/urandom if available https://github.com/vim/vim/commit/07e4a197953d12902fb97beb48830a5323a52280 Use os_open and os_close. time_settime is N/A, so some parts of the test are disabled. There's maybe a very, very, very, very small chance the /dev/urandom test fails, but it shouldn't matter. :P
* | vim-patch:8.1.2342: random number generator in Vim script is slowSean Dewar2022-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Random number generator in Vim script is slow. Solution: Add rand() and srand(). (Yasuhiro Matsumoto, closes vim/vim#1277) https://github.com/vim/vim/commit/06b0b4bc27077013e9b4b48fd1d9b33e543ccf99 Add missing method call usage to builtin.txt. vim_time and test_settime is N/A. Add a modeline to test_random.vim. Use typval_T* over listitem_T* vars so we don't need to use TV_LIST_ITEM_TV all over the place... Remove NULL list checks (tv_list_len covers this).
* | Merge pull request #17272 from zeertzjq/vim-8.1.0846zeertzjq2022-02-04
|\ \ | | | | | | vim-patch:8.1.{0846,0878,0884,2358},8.2.{0305,0352,0687,3797}
| * | vim-patch:8.1.0846: not easy to recognize the system Vim runs onzeertzjq2022-02-04
| |/ | | | | | | | | | | | | | | | | Problem: Not easy to recognize the system Vim runs on. Solution: Add more items to the features list. (Ozaki Kiichi, closes vim/vim#3855) https://github.com/vim/vim/commit/39536dd557e847e80572044c2be319db5886abe3 Some doc changes have already been applied. Some others are N/A. "moon" was removed in patch 8.2.0427 so I did not add it.
* | fix(api/nvim_win_call): share common win_execute logicSean Dewar2022-02-03
| | | | | | | | | | | | | | | | | | | | We have to be sure that the bugs fixed in the previous patches also apply to nvim_win_call. Checking v8.1.2124 and v8.2.4026 is especially important as these patches were only applied to win_execute, but nvim_win_call is also affected by the same bugs. A lot of win_execute's logic can be shared with nvim_win_call, so factor it out into a common macro to reduce the possibility of this happening again.
* | vim-patch:8.2.4026: ml_get error with specific win_execute() commandSean Dewar2022-02-03
| | | | | | | | | | | | Problem: ml_get error with specific win_execute() command. (Sean Dewar) Solution: Check cursor and Visual area are OK. https://github.com/vim/vim/commit/e664a327014f4aa8baf8549a34a4caab2f3116a3
* | 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.
* feat(provider)!: remove support for python2 and python3.[3-5]Björn Linse2022-01-29
| | | | | | These versions of python has reached End-of-life. getting rid of python2 support removes a lot of logic to support two incompatible python versions in the same version.
* vim-patch:8.2.4052: not easy to resize a window from a plugin (#17028)Daniel Steinberg2022-01-29
|
* refactor: add `static` to some functions in `funcs.c` (#17030)Daniel Steinberg2022-01-29
|
* Merge pull request #15910 from glacambre/silent_stdioopenbfredl2022-01-24
|\ | | | | feat(--headless): do not print anything when stdioopen() has been used
| * feat(--headless): add on_print callback to stdioopenglacambre2022-01-24
| | | | | | | | | | | | | | This commit adds an on_print callback to stdioopen's dictionary argument which lets the caller specify a function called each time neovim will try to output something to stdout (e.g. on "echo" or "echoerr" in --headless mode).
* | vim-patch:8.2.3956: duplicate assignmentDundar Göc2022-01-01
| | | | | | | | | | | | Problem: Duplicate assignment. Solution: Remove the second assignment. (closes vim/vim#9442) https://github.com/vim/vim/commit/4b1478093eb8b8bebc94b1f596e0afc25db4d189
* | 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`.
* | Merge pull request #16728 from dundargoc/refactor/remove-unused-macrosBjörn Linse2021-12-30
|\ \ | | | | | | refactor: remove unused macros
| * | refactor: remove unused macrosDundar Göc2021-12-30
| | | | | | | | | | | | Closes #13505
* | | vim-patch:8.2.3882: more duplicated code in f_getreginfo()zeertzjq2021-12-24
| | | | | | | | | | | | | | | | | | Problem: More duplicated code in f_getreginfo(). Solution: Also use getreg_get_regname(). (closes vim/vim#9398) https://github.com/vim/vim/commit/d3f00f54bf955bd01767db3a0af25866bc112ec7
* | | vim-patch:8.2.3879: getreg() and getregtype() contain dead codezeertzjq2021-12-24
| | | | | | | | | | | | | | | | | | | | | Problem: getreg() and getregtype() contain dead code. Solution: Remove the needless check. (closes vim/vim#9392) Also refactor to put common code in a shared function. https://github.com/vim/vim/commit/51e64b2789eb7e60f7c5892a43426ab4ec1a54aa
* | | refactor: remove some chdir-related unnecessary calls and checkszeertzjq2021-12-20
|/ / | | | | | | | | | | | | xmalloc() always retuns a valid pointer. Calling os_chdir() with the same directory as the current one doesn't do anything other than wasting time.
* / feat(autocmd): add Recording autocmdsThomas Vigouroux2021-12-18
|/ | | | | | | | | | | | | | feat(eval): add reg_recorded() This function is used the get the last recorded register. style(Recording): rename handler to match suggestions fix(RecordingLeave): send autocommand earlier This makes the autocommand fire just before setting reg_recorded to reg_recording, this way we clearly show that we are actually just before actually quitting the recording mode.
* 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 line_breakcheck family of functions to os/input.cBjörn Linse2021-12-09
|
* Merge pull request #16194 from seandewar/vim-8.1.1925Jan Edmund Lazo2021-12-07
|\ | | | | vim-patch:7.4.1777,8.1.{1925,1995,2011,2012,2013,2166},8.2.{0532,0871,1168,1241,3576}
| * vim-patch:7.4.1777Sean Dewar2021-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Newly added features can escape the sandbox. Solution: Add checks for restricted and secure. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/3849992b16011e36a5cb5be4b127f843389b96fd timer_start is missing check_secure. The timer callback can, for example, call a function defined from outside the sandbox that does stuff that would be disallowed from inside the sandbox. This is usually not allowed. Cherry-pick eval.txt change from: https://github.com/vim/vim/commit/68e6560b84f196c82e27a72669684d5506a3a837 Required for v8.1.2013.
* | refactor: fix indent in decode.c (#16543)zeertzjq2021-12-06
| |
* | lint (#16526)Jan Edmund Lazo2021-12-05
| |
* | refactor: upgrade uncrustify config version to 0.74.0Dundar Göc2021-11-23
|/ | | | | Disable formatting for assert.h since there's a bug that results in a segmentation fault in uncrustify.
* Merge pull request #16362 from zeertzjq/vim-8.2.3617Jan Edmund Lazo2021-11-21
|\ | | | | vim-patch:8.2.{3468,3617,3618,3622}: some other CWD related patches
| * vim-patch:8.2.3618: getcwd() is unclear about how 'autochdir' is usedzeertzjq2021-11-19
| | | | | | | | | | | | | | Problem: getcwd() is unclear about how 'autochdir' is used. Solution: Update the help for getcwd(). Without any arguments always return the actual current directory. (closes vim/vim#9142) https://github.com/vim/vim/commit/851c7a699ae00bdc14a4db874cf722b7b7393b53
* | vim-patch:8.2.3638: getcompletion() always passes zero as position (#16387)ii142021-11-21
| | | | | | | | | | | | | | | | Problem: getcompletion() always passes zero as position to custom completion function. Solution: Pass the pattern length. (closes vim/vim#9173) https://github.com/vim/vim/commit/4785fe02bba14c4e0aede0fa425ca790a1cb98d7 Co-authored-by: ii14 <ii14@users.noreply.github.com>
* | refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* | fix(eval): fixup for empty modifier in fnamemodify (#16368)Christian Clason2021-11-19
|/ | | | | | | | | | | * fix(eval): fixup for empty modifier in fnamemodify https://github.com/neovim/neovim/commit/1dbbaf89bf5d3bcd1edac3af9938c2e2dd18f816 erroneously removed a check for empty modifier and a PVS fix. Restore that check and fix. Fixes #16367 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: reduce number of explicit char casts (#16077)dundargoc2021-11-16
| | | * refactor: reduce number of explicit char casts
* refactor(macroman): get rid of MB_COPY_CHAR macroBjörn Linse2021-11-14
| | | | clean up docs for MB_PTR_ADV and MB_PTR_BACK
* refactor(macros): delete multibyte macros which just are aliasesBjörn Linse2021-11-14
|
* refactor(multibyte): eliminate mb_ptr2len alias for utfc_ptr2lenBjörn Linse2021-11-14
|
* vim-patch:8.1.0779: argument for message functions is inconsistentJames McCoy2021-11-01
| | | | | | Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* refactor: uncrustify #16090dundargoc2021-10-29
|
* fix(eval): fix has('wsl') #16153erw72021-10-29
| | | | | | | | Problem: has('wsl') is decided at build-time. Solution: Check os_uname(). Fixes #12642, #16143
* refactor(api): break out vim_to_object/object_to_vim to own fileBjörn Linse2021-10-29
|
* fix(eval): checking for a non-empty string is too strict (#15987)Fabian2021-10-28
| | | | | | Cherry-pick check_for_nonempty_string() from patch vim-8.2.2133 and apply it on the bases of https://github.com/neovim/neovim/pull/13489 https://github.com/vim/vim/commit/2a9d5d386bea8455b37c1accebc45683ec51d6fb
* Merge pull request #16111 from dundargoc/vim-patch/commentsJan Edmund Lazo2021-10-23
|\ | | | | vim-patch:8.1.2368,8.1.2378,8.1.2379,8.1.2380,8.1.2387,8.1.2388,8.1.2392,8.1.2394,8.1.2395,8.1.2396