aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
Commit message (Collapse)AuthorAge
* refactor: iwyu #31637Justin M. Keyes2024-12-23
| | | Result of `make iwyu` (after some "fixups").
* refactor(highlight): make enum of builtin highlights start with 1bfredl2024-11-13
| | | | | This makes it possible to use HLF_ values directly as highlight id:s and avoids +1 adjustments especially around messages.
* refactor(message): propagate highlight id instead of attrsLuuk van Baal2024-11-08
| | | | | | | Problem: Highlight group id is not propagated to the end of the message call stack, where ext_messages are emitted. Solution: Refactor message functions to pass along highlight group id instead of attr id.
* fix(window): respect hide flag of float windows when switching (#30507)glepnir2024-09-28
|
* vim-patch:9.1.0653: Patch v9.1.0648 not completely rightzeertzjq2024-08-03
| | | | | | | | | | | | Problem: Patch v9.1.0648 not completely right (zeertzjq) Solution: Remove always true condition closes: vim/vim#15415 https://github.com/vim/vim/commit/a0b5bc12850f1d87fa51fb7be42df0ea835ccf21 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0648: [security] double-free in dialog_changed()zeertzjq2024-08-03
| | | | | | | | | | | | | | | | | Problem: [security] double-free in dialog_changed() (SuyueGuo) Solution: Only clear pointer b_sfname pointer, if it is different than the b_ffname pointer. Don't try to free b_fname, set it to NULL instead. fixes: vim/vim#15403 Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f https://github.com/vim/vim/commit/b29f4abcd4b3382fa746edd1d0562b7b48c9de60 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor: move shared messages to errors.h #26214Justin M. Keyes2024-06-01
|
* vim-patch:9.0.2180: POSIX function name in exarg causes issues (#28308)zeertzjq2024-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: POSIX function name in exarg struct causes issues on OpenVMS Solution: Rename getline member in exarg struct to ea_getline, remove isinf() workaround for VMS There are compilers that do not treat well POSIX functions - like getline - usage in the structs. Older VMS compilers could digest this... but the newer OpenVMS compilers ( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these structs. This could be limited to getline() that is defined via getdelim() and might not affect all POSIX functions in general - but avoiding POSIX function names usage in the structs is a "safe side" practice without compromising the functionality or the code readability. The previous OpenVMS X86 port used a workaround limiting the compiler capabilities using __CRTL_VER_OVERRIDE=80400000 In order to make the OpenVMS port future proof, this pull request proposes a possible solution. closes: vim/vim#13704 https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
* vim-patch:9.1.0267: File name entered in GUI dialog is ignoredzeertzjq2024-04-06
| | | | | | | | | | Problem: File name entered in GUI dialog is ignored (after v9.1.0265) Solution: Only set file name to "Untitled" if GUI dialog didn't set it. (zeertzjq) closes: vim/vim#14417 https://github.com/vim/vim/commit/c20bdf1107d48a1c14713709d12d429e761132af
* vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)zeertzjq2024-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: console dialog cannot save unnamed buffers Solution: set bufname before save (glepnir). Define dialog_con_gui to test for GUI+Console dialog support, use it to skip the test when the GUI feature has been defined. Note: The dialog_changed() function will also try to call the browse_save_fname() function, when FEAT_BROWSE is defined (which is only defined in a GUI build of Vim). This will eventually lead to a call of do_browse(), which causes an error message if a GUI is not currently running (see the TODO: in do_browse()) and will then lead to a failure in Test_goto_buf_with_onfirm(). Therefore, we must disable the Test_goto_buf_with_onfirm(), when the dialog_con_gui feature is enabled (which basically means dialog feature for GUI and Console builds, in contrast to the dialog_con and dialog_gui feature). (Previously this wasn't a problem, because the test aborted in the YES case for the :confirm :b XgotoConf case and did therefore not run into the browse function call) closes: vim/vim#14398 https://github.com/vim/vim/commit/df46115fc839c8912ed60646e86a412e5180ba1d Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.0195: memleak with ex_drop, NULL dereferencezeertzjq2024-03-22
| | | | | | | | | | | | | Problem: memleak with ex_drop(), NULL dereference (zeertzjq) Solution: revert back to ex_rewind(), use curbuf instead of buf fixes: vim/vim#14246 closes: vim/vim#14251 https://github.com/vim/vim/commit/85a769d466d2009db6a318fd120d9691344664ba Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0192: drop: don't rewind when editing the same filezeertzjq2024-03-22
| | | | | | | | | | | | | | Problem: :drop tries to :rewind the argumentlist, which results in E37 (after v9.1.0046) Solution: instead of calling ex_rewind(), call open_buffer() only when re-using the initial empty buffer fixes: vim/vim#14219 closes: vim/vim#14220 https://github.com/vim/vim/commit/978178823b7c62a0249411f3d1f584f8a3144c5d Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(api/buffer): fix handling of viewport of non-current bufferbfredl2024-03-13
| | | | | | | | | | | A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
* vim-patch:9.1.0156: Make 'wfb' failing to split still report E1513zeertzjq2024-03-11
| | | | | | | | | | | | | | | Problem: may not be clear why failing to split causes an ":Xdo" command to abort if 'wfb' is set. Solution: do not return immediately if win_split fails, so E1513 is still given. Expect both errors in the test. Also fix tests to pass CI. (Sean Dewar) closes: vim/vim#14152 https://github.com/vim/vim/commit/769eb2d0c3614f9ea6fffa82329558f1a4af384f Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
* vim-patch:9.1.0152: Coverity complains about ignoring return valuezeertzjq2024-03-11
| | | | | | | | | | Problem: Coverity complains about ignoring return value of win_split() (after v9.1.150) Solution: Check if win_split() failed, add winfixbuf.res to Makefile https://github.com/vim/vim/commit/af7ae8160041e2d17c56945381e9370e7178e596 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0150: Several minor 'winfixbuf' issuesColin Kennedy2024-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: several minor 'winfixbuf' issues exist, mostly relating to the quickfix list Solution: address them and adjust tests. Retab and reflow a few things too. (Sean Dewar) Things touched include: - Replace the semsgs with gettext'd emsgs. - Handle window switching in ex_listdo properly, so curbuf and curwin are kept in-sync and trigger autocommands; handle those properly. - Don't change the list entry index in qf_jump_edit_buffer if we fail due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used if the list was changed). - Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX` commands **outside** of the list window if 'wfb' is set in curwin. Handle autocommands properly in case they mess with the list. NOTE: previously, it seemed to split if 'wfb' was set, but do nothing and fail if prevwin is *valid*. This behaviour seemed strange, and maybe unintentional? Now it aligns more with what's described for the `:cXX` commands in the original PR description when used outside a list window, I think. - In both functions, only consider prevwin if 'wfb' isn't set for it; fallback to splitting otherwise. - Use win_split to split. Not sure if there was a specific reason for using ex_splitview. win_split is simpler and respects modifiers like :vertical that may have been used. Plus, its return value can be checked for setting opened_window in qf code (technically win_split_ins autocmds could immediately close it or change windows, in which the qf code might close some other window on failure; it's already the case elsewhere, though). closes: vim/vim#14142 https://github.com/vim/vim/commit/4bb505e28cac0389561fff78d8bbe0319c2bcf2f Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
* vim-patch:9.1.0147: Cannot keep a buffer focused in a windowColin Kennedy2024-03-11
| | | | | | | | | | | | | | | Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: vim/vim#6445 closes: vim/vim#13903 https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea N/A patch: vim-patch:58f1e5c0893a
* refactor: rename w_float_config to w_config #27419Will Hopkins2024-02-10
| | | Follows up on rename of `FloatConfig` to `WinConfig` in #27397.
* fix(jumplist): Ctrl+o, Ctrl+i weird behavior when deleting buffers #25461vE5li2024-01-28
| | | | | | | | | | | | | | Problem: - Navigation is not always symmetric: pressing Ctrl+o n times followed by Ctrl+i n times does not always gets me back to where I started. - Invalid buffers are not skipped by Ctrl+i/o, I have to press Ctrl+i/o multiple times to get to the next/previous buffer. Solution: - Remove all entries of a buffer from the jump list when deleting it. - Don't add a new entry to the jump list if the next buffer to be displayed is already in the jump list. Closes #25365
* vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)zeertzjq2024-01-24
| | | | | | | | | | | | | Problem: :drop does not re-use empty buffer (Rocco Mao) Solution: Make :drop re-use an empty buffer (Rocco Mao) fixes: vim/vim#13851 closes: vim/vim#13881 https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
* refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
* refactor: follow style guidedundargoc2023-12-30
|
* refactor: eliminate cyclic includesdundargoc2023-12-20
|
* refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* refactor: follow style guidedundargoc2023-11-19
| | | | | - reduce variable scope - prefer initialization over declaration and assignment
* refactor: follow style guidedundargoc2023-11-13
| | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: remove redundant castsdundargoc2023-11-11
|
* refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* refactor(messages): fold msg_attr into msgbfredl2023-09-27
| | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
* refactor: remove 'shortmess' save/restore panic for ex commandsbfredl2023-09-25
| | | | | | This was only used to avoid the effect of SHM_OVERALL. This can easily be handled in isolation, instead of clearing out all of 'shortmess' which has unwanted side effects and mystifies what really is going on.
* perf(rtp): reduce rtp scans (#24191)Lewis Russell2023-07-13
| | | | | | | | | | | * perf(rtp): reduce rtp scans Problem: Scanning the filesystem is expensive and particularly affects startuptime. Solution: Reduce the amount of redundant directory scans by relying less on glob patterns and handle vim and lua sourcing lower down.
* vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.1.2094: the fileio.c file is too big Lewis Russell2023-04-19
| | | | | | | | | | Problem: The fileio.c file is too big. Solution: Move buf_write() to bufwrite.c. (Yegappan Lakshmanan, closes vim/vim#4990) https://github.com/vim/vim/commit/c079f0fed1c16495d726d616c5362edc04742a0d Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:9.0.1064: code for making 'shortmess' temporarily empty is repeatedzeertzjq2023-04-16
| | | | | | | | | | Problem: Code for making 'shortmess' temporarily empty is repeated. Solution: Add functions for making 'shortmess' empty and restoring it. (Christian Brabandt, closes vim/vim#11709) https://github.com/vim/vim/commit/9aee8ec400fe617f6d82441c46a22d0cef6fa3e6 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor: remove redundant const char * castsii142023-04-07
|
* refactor: add const and remove unnecessary casts (#22841)ii142023-04-01
|
* refactor: reduce scope of locals as per the style guide (#22206)dundargoc2023-02-11
|
* 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
* vim-patch:9.0.1115: code is indented more than needed (#21598)zeertzjq2022-12-31
| | | | | | | | | Problem: Code is indented more than needed. Solution: Use an early return to reduce indenting. (Yegappan Lakshmanan, closes vim/vim#11758) https://github.com/vim/vim/commit/ed0c1d5d4b30d03b26ff08841f6da2ddf44025a7 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* feat(aucmd_win): allow crazy things with hidden buffers (#21250)zeertzjq2022-12-02
| | | | Problem: Crash when doing crazy things with hidden buffers. Solution: Dynamically allocate the list of autocommand windows.
* vim-patch:9.0.0965: using one window for executing autocommands is insufficientzeertzjq2022-11-29
| | | | | | | | | | | | | | | | | | Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands. https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a N/A patches for version.c: vim-patch:9.0.0966: some compilers don't allow a declaration after a label Problem: Some compilers don't allow a declaration after a label. Solution: Move the declaration to the start of the block. (John Marriott) https://github.com/vim/vim/commit/f86490ed4fdab213a28f667abd055c023a73d645 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.
* refactor: replace char_u with charDundar Göc2022-09-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-31
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:9.0.0318: clearing screen causes flicker (#19993)zeertzjq2022-08-30
| | | | | | | Problem: Clearing screen causes flicker. Solution: Do not clear but redraw in more cases. Add () to "wait_return". https://github.com/vim/vim/commit/13608d851a0470ced30921428b3313c023d395d8 Only 2 lines of actual code change.
* vim-patch:8.2.1269: language and locale code spread out (#19964)zeertzjq2022-08-27
| | | | | | | | Problem: Language and locale code spread out. Solution: Move relevant code to src/locale.c. (Yegappan Lakshmanan, closes vim/vim#6509) https://github.com/vim/vim/commit/054f14bbe58fece17f1a74ca63f0b37518f0b4de Also remove redundant <locale.h> includes.