aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into usermarksusermarksJosh Rahm2023-01-25
|\
| * feat!: make iconv a non-optional depLewis Russell2023-01-23
| |
| * vim-patch:9.0.1233: search() loops forever if "skip" is TRUE for all matches ↵zeertzjq2023-01-23
| | | | | | | | | | | | | | | | | | | | (#21956) Problem: search() loops forever if "skip" is TRUE for all matches. Solution: Keep the position of the first match. https://github.com/vim/vim/commit/3d79f0a4309995956bd8889940cca22f7a15881d Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: use uint8_t for blobs and ga_append() (#21916)zeertzjq2023-01-21
| | | | | | | | | | | | A blob is used as a sequence of bytes and usually accessed individually, not as as a NUL-terminuated string, so uint8_t should be better. Not sure about ga_append(), but using uint8_t leads to fewer casts.
| * refactor: replace char_u with char 25 (#21838)dundargoc2023-01-19
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 ↵zeertzjq2023-01-19
| | | | | | | | | | | | | | | | | | | | (#21883) Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work. https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 23 (#21798)dundargoc2023-01-18
| | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 22 (#21786)dundargoc2023-01-17
| | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 20 (#21714)dundargoc2023-01-13
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with char 19 (#21241)dundargoc2023-01-10
| | | | | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:partial:9.0.1166: code is indented more than necessary (#21716)zeertzjq2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11792) https://github.com/vim/vim/commit/1cfb14aa972ccf3235ac67f07b7db1175b7c5384 Partial port as some highlight.c changes depend on previous patches. Cherry-pick fname_match() change from patch 8.2.4959. Omit internal_func_check_arg_types(): only used for Vim9 script. N/A patches for version.c: vim-patch:9.0.1167: EditorConfig files do not have their own filetype Problem: EditorConfig files do not have their own filetype. Solution: Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779) https://github.com/vim/vim/commit/d41262ed06564cef98a3800e2928e6e0db91abbf Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * refactor: replace char_u with char 18 (#21237)dundargoc2023-01-09
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * Merge pull request #21704 from bfredl/nofreebfredl2023-01-09
| |\ | | | | | | fix(rpc): don't free args on error in rpc_send_event
| | * fix(rpc): don't free args on error in rpc_send_eventbfredl2023-01-09
| | | | | | | | | | | | | | | fixup #21631 fixes #21690
| * | refactor: replace char_u with char 17 - remove STRLCPY (#21235)dundargoc2023-01-09
| |/ | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
| * refactor(api): do not allocate temporaries for internal eventsbfredl2023-01-03
| |
| * feat!: remove hardcopyLewis Russell2023-01-03
| | | | | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
| * vim-patch:9.0.1132: code is indented more than needed (#21626)zeertzjq2023-01-03
| | | | | | | | | | | | | | | | | | | | | | Problem: Code is indented more than needed. Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan, closes vim/vim#11769) https://github.com/vim/vim/commit/dc4daa3a3915fba11ac87d27977240d9a5e0d47d Omit expand_autoload_callback(): only applies to Vim9 script. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * refactor(f_has): remove wrong comment (#21561)zeertzjq2022-12-28
| | | | | | | | Only one of "fork" and "system" should be defined. Also change the line above "win32" to match Vim.
| * fix(options): restore exists() behavior for options (#21510)zeertzjq2022-12-23
| | | | | | | | | | Duplicating get_option_value() logic for an obscure future refactor isn't really worthwhile, and findoption() isn't used anywhere else outside the options code.
| * fix(chansend): sending lines to terminal in reverse order on Windows #19315Enan Ajmain2022-12-08
| | | | | | | | | | | | | | Problem: `chansend()` on Windows sends lines in reverse order. Cause: Using \n instead of \r\n for newlines on Windows. Solution: on Windows, use CRLF newline characters. Fixes #18501
| * vim-patch:9.0.1015: without /dev/urandom srand() seed is too predictable ↵zeertzjq2022-12-06
| | | | | | | | | | | | | | | | | | | | | | (#21303) Problem: Without /dev/urandom srand() seed is too predictable. Solution: Use micro seconds and XOR with process ID. (Yasuhiro Matsumoto, closes vim/vim#11656) https://github.com/vim/vim/commit/f0a9c004825ab686270ee57260652cce25e61049 Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
| * vim-patch:8.1.2001: some source files are too big (#21231)zeertzjq2022-11-29
| | | | | | | | | | | | | | Problem: Some source files are too big. Solution: Move buffer and window related functions to evalbuffer.c and evalwindow.c. (Yegappan Lakshmanan, closes vim/vim#4898) https://github.com/vim/vim/commit/261f346f8154c0ec7094a4a211c653c74e9f7c2e
| * vim-patch:9.0.0733: use of strftime() is not safe (#21228)zeertzjq2022-11-29
| | | | | | | | | | | | | | | | | | | | Problem: Use of strftime() is not safe. Solution: Check the return value of strftime(). Use a larger buffer and correctly pass the available space. (Dominique Pellé, closes vim/vim#11348) https://github.com/vim/vim/commit/84d14ccdb50dc9f362066a2c83bfaf331314e5ea Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
| * refactor: replace char_u with chardundargoc2022-11-28
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * refactor: replace char_u with charDundar Göc2022-11-26
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:8.2.2466: max() and min() can give many error messageszeertzjq2022-11-25
| | | | | | | | | | | | | | | | | | Problem: Max() and min() can give many error messages. Solution: Bail out at the first error. (closes vim/vim#1039, closes vim/vim#7778) https://github.com/vim/vim/commit/ab65fc77c5389f7d3f788bbdc3d931561feab131 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * Merge pull request #20151 from dundargoc/refactor/char_u/13bfredl2022-11-22
| |\ | | | | | | refactor: replace char_u with char 13: remove `STRLEN` part 3
| | * refactor: replace char_u with charDundar Göc2022-11-19
| | | | | | | | | | | | Work on https://github.com/neovim/neovim/issues/459
| * | vim-patch:9.0.0916: getbufline() is inefficient for getting a single linezeertzjq2022-11-22
| |/ | | | | | | | | | | | | | | | | | | | | Problem: getbufline() is inefficient for getting a single line. Solution: Add getbufoneline(). https://github.com/vim/vim/commit/ce30ccc06af7f2c03762e5b18dde37b26ea6ec42 Cherry-pick part of usr_41.txt from patch 8.1.1628. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.5167: get(Fn, 'name') on funcref returns special byte code ↵zeertzjq2022-11-19
| | | | | | | | | | | | | | | | | | | | | | | | (#21112) Problem: get(Fn, 'name') on funcref returns special byte code. Solution: Use the printable name. https://github.com/vim/vim/commit/1ae8c262df7083dfb4b41485508951c50eccc84c Cherry-pick printable_func_name() from patch 8.2.0149. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | | | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
| * vim-patch:9.0.0863: col() and charcol() only work for the current window ↵zeertzjq2022-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | (#21038) Problem: col() and charcol() only work for the current window. Solution: Add an optional winid argument. (Yegappan Lakshmanan, closes vim/vim#11466, closes vim/vim#11461) https://github.com/vim/vim/commit/4c8d2f02b3ce037bbe1d5ee12887e343c6bde88f Cherry-pick test_functions.vim change from patch 8.2.0633. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * Merge pull request #20821 from dundargoc/refactor/clang-tidybfredl2022-11-08
| |\ | | | | | | refactor: fix clang-tidy warnings
| | * refactor: fix clang-tidy warningsdundargoc2022-11-06
| | | | | | | | | | | | | | | | | | | | | | | | Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
| * | feat: ":write ++p" creates parent dirs #20835Victor Blanchard2022-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if they do not exist - Note: `:foo ++…` is usually for options. No existing options have a single-char abbreviation (presumably by design), so it's safe to special-case `++p` here. - Same for `writefile(…, 'foo/bar/baz.txt', 'p')` - `BufWriteCmd` can see the ++p flag via `v:cmdarg`. closes #19884
| * | vim-patch:9.0.0841: deletebufline() does not always return 1 on failure (#20980)zeertzjq2022-11-07
| |/ | | | | | | | | | | Problem: deletebufline() does not always return 1 on failure. Solution: Refactor the code to make it work more predictable. (closes vim/vim#11511) https://github.com/vim/vim/commit/7af3ee2b83545169d78a28ab1cd89aff1127f8b3
| * fix(eval): make error number of charidx() same as Vimzeertzjq2022-11-05
| |
| * vim-patch:8.2.4679: cannot have expandcmd() give an error message for mistakeszeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | Problem: Cannot have expandcmd() give an error message for mistakes. Solution: Add an optional argument to give errors. Fix memory leak when expanding files fails. (Yegappan Lakshmanan, closes vim/vim#10071) https://github.com/vim/vim/commit/2b74b6805b5c8c4836b66df5d949f5ff6a77f8c7 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * vim-patch:8.2.2606: strchars() defaults to counting composing characterszeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | | | | | Problem: strchars() defaults to counting composing characters. Solution: Add strcharlen() which ignores composing characters. https://github.com/vim/vim/commit/70ce8a1561c5396e4c4381f76a005cbb97646f80 Use docs from latest Vim instead. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1624: Vim9: cannot pass "true" to split(), str2nr() and strchars()zeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | Problem: Vim9: cannot pass "true" to split(), str2nr() and strchars(). Solution: Use tv_get_bool_chk(). (closes vim/vim#6884, closes vim/vim#6885, closes vim/vim#6886) https://github.com/vim/vim/commit/3986b94b090ea258109630008611230a599999ab Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1600: Vim9: cannot use "true" with deepcopy()zeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | Problem: Vim9: cannot use "true" with deepcopy(). Solution: Use tv_get_bool_chk(). (closes vim/vim#6867) https://github.com/vim/vim/commit/44b4a246b62e0622550b963bcf3034dce3bcfc0c Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.1751: using 2 where bool is expected may throw an errorzeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using 2 where bool is expected may throw an error. Solution: Make this backwards compatible. https://github.com/vim/vim/commit/bade44e5cad1b08c85d4a8ba08d94a30458dddfb In legacy Vim script get_bool functions do the same thing as get_number functions, so just add aliases using #define. N/A patches for version.c: vim-patch:8.2.1506: Vim9: no error when using a number other than 0 or 1 as bool Problem: Vim9: no error when using a number other than 0 or 1 as bool. Solution: Check the number is 0 or 1. https://github.com/vim/vim/commit/d70840ed68296c1144d743e6335003c81c558c24 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.3919: Vim9: wrong argument for append() results in two errorszeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | | | Problem: Vim9: wrong argument for append() results in two errors. Solution: Check did_emsg. Also for setline(). Adjust the help for appendbufline(). https://github.com/vim/vim/commit/8b6256f6ec075cca40341e61ebc9f538b4902dd1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.2.3252: duplicated code for adding buffer lineszeertzjq2022-11-05
| | | | | | | | | | | | | | | | | | | | Problem: Duplicated code for adding buffer lines. Solution: Move code to a common function. Also move map functions to map.c. (Yegappan Lakshmanan, closes vim/vim#8665) https://github.com/vim/vim/commit/4a15504e911bc90a29d862862f0b7a46d8acd12a Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
| * Enable new diff option linematch (#14537)Jonathon2022-11-04
| | | | | | Co-authored-by: Lewis Russell <me@lewisr.dev>
| * vim-patch:9.0.0824: crash when using win_move_separator() in other tab pagezeertzjq2022-11-02
| | | | | | | | | | | | | | | | Problem: Crash when using win_move_separator() in other tab page. Solution: Check for valid window in current tab page. (closes vim/vim#11479, closes vim/vim#11427) https://github.com/vim/vim/commit/873f41a0187e81a22aa4622fbf938de72a54abba
| * vim-patch:8.2.2343: Vim9: return type of readfile() is any (#20896)zeertzjq2022-11-01
| | | | | | | | | | | | | | | | | | Problem: Vim9: return type of readfile() is any. Solution: Add readblob() so that readfile() can be expected to always return a list of strings. (closes vim/vim#7671) https://github.com/vim/vim/commit/c423ad77ed763c11ba67729bbf63c1cf0915231f Co-authored-by: Bram Moolenaar <Bram@vim.org>