aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
Commit message (Collapse)AuthorAge
* vim-patch:8.2.3489: ml_get error after search with rangezeertzjq2022-04-01
| | | | | | Problem: ml_get error after search with range. Solution: Limit the line number to the buffer line count. https://github.com/vim/vim/commit/35a319b77f897744eec1155b736e9372c9c5575f
* fix(tabpage): correct check for failure to close windowzeertzjq2022-03-27
| | | | Avoid closing window 999 times.
* 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
* refactor: remove cpo-& behavior (#17745)zeertzjq2022-03-23
| | | | cpo-& has been removed, but its behavior was accidentally made the default behavior. That should be removed instead.
* vim-patch:8.2.1078: highlight and match functionality together in one file ↵Lewis Russell2022-03-23
| | | | | | | | | (#17805) Problem: Highlight and match functionality together in one file. Solution: Move match functionality to a separate file. (Yegappan Lakshmanan, closes vim/vim#6352) https://github.com/vim/vim/commit/06cf97e714fd8bf9b35ff5f8a6f2302c79acdd03
* vim-patch:8.1.1742: still some match functions in evalfunc.cLewis Russell2022-03-20
| | | | | | | Problem: Still some match functions in evalfunc.c. Solution: Move them to highlight.c. https://github.com/vim/vim/commit/7dfb016d25e3e3e1f4411026dda21d1536f21acc
* Merge pull request #17719 from dundargoc/doxygen/ex_docmdbfredl2022-03-18
|\ | | | | refactor(ex_docmd): convert function comments to doxygen format
| * refactor(ex_docmd): convert function comments to doxygen formatDundar Göc2022-03-16
| |
* | 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>
* | chore: fix typos (#17670)dundargoc2022-03-17
|/ | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:8.2.1413: previous tab page not usable from an Ex commandSean Dewar2022-03-14
| | | | | | | | | | | | | Problem: Previous tab page not usable from an Ex command. Solution: Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan, closes vim/vim#6677) https://github.com/vim/vim/commit/94f4ffa7704921a3634e56b878e6dc362bc3d508 Do not rename old_curtab to prev_tp in win_new_tabpage, this can be confused with the previous tabpage (`:tabprevious`). Cherry-pick ex_errmsg from v8.2.1280. https://github.com/vim/vim/commit/8930caaa1a283092aca81fdbc3fcf15c7eadb197
* 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.2.3779: using freed memory when defining a user command ↵Sean Dewar2022-03-12
| | | | | | | | | recursively (#17688) Problem: Using freed memory when defining a user command from a user command. Solution: Do not use the command pointer after executing the command. (closes vim/vim#9318) https://github.com/vim/vim/commit/205f29c3e9b895dbaa4f738046da455a93c3812a
* refactor(ops): use op_yank_reg() instead of op_yank() when deletingzeertzjq2022-03-09
| | | | Needed for Vim patch 8.1.0999.
* 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.
* feat(lua): show proper verbose output for lua configurationshadmansaleh2022-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `:verbose` didn't work properly with lua configs (For example: options or keymaps are set from lua, just say that they were set from lua, doesn't say where they were set at. This fixes that issue. Now `:verbose` will provide filename and line no when option/keymap is set from lua. Changes: - compiles lua/vim/keymap.lua as vim/keymap.lua - When souring a lua file current_sctx.sc_sid is set to SID_LUA - Moved finding scripts SID out of `do_source()` to `get_current_script_id()`. So it can be reused for lua files. - Added new function `nlua_get_sctx` that extracts current lua scripts name and line no with debug library. And creates a sctx for it. NOTE: This function ignores C functions and blacklist which currently contains only vim/_meta.lua so vim.o/opt wrappers aren't targeted. - Added function `nlua_set_sctx` that changes provided sctx to current lua scripts sctx if a lua file is being executed. - Added tests in tests/functional/lua/verbose_spec.lua - add primary support for additional types (:autocmd, :function, :syntax) to lua verbose Note: These can't yet be directly set from lua but once that's possible :verbose should work for them hopefully :D - add :verbose support for nvim_exec & nvim_command within lua Currently auto commands/commands/functions ... can only be defined by nvim_exec/nvim_command this adds support for them. Means if those Are defined within lua with vim.cmd/nvim_exec :verbose will show their location . Though note it'll show the line no on which nvim_exec call was made.
* feat(lua): add <f-args> to user commands callback (#17522)Javier Lopez2022-02-27
| | | | | Works similar to ex <f-args>. It only splits the arguments if the command has more than one posible argument. In cases were the command can only have 1 argument opts.fargs = { opts.args }
* Merge pull request #17403 from zeertzjq/vim-8.1.1955zeertzjq2022-02-21
|\ | | | | vim-patch:8.1.{1846,1955},8.2.0156
| * vim-patch:8.2.0156: various typos in source files and testszeertzjq2022-02-14
| | | | | | | | | | | | Problem: Various typos in source files and tests. Solution: Fix the typos. (Emir Sari, closes vim/vim#5532) https://github.com/vim/vim/commit/4b96df5a017a04141c4e901b1fc5704a3ca48099
* | vim-patch:8.2.3659: integer overflow with large line numberzeertzjq2022-02-18
| | | | | | | | | | | | | | | | | | Problem: Integer overflow with large line number. Solution: Check for overflow. (closes vim/vim#9202) https://github.com/vim/vim/commit/03725c5795ae5b8c14da4a39cd0ce723c6dd4304 Put E1247 in globals.h as E1240 is also there. Do not make getdigits() abort.
* | Merge pull request #17363 from zeertzjq/dirchangedprezeertzjq2022-02-17
|\ \ | | | | | | feat(events): add DirChangedPre
| * | feat(events): add DirChangedPrezeertzjq2022-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Nvim, like DirChanged, this also triggers when switching windows. This marks Vim patch 8.2.4335 as ported. vim-patch:8.2.4335: no autocommand event triggered before changing directory Problem: No autocommand event triggered before changing directory. (Ronnie Magatti) Solution: Add DirChangedPre. (closes vim/vim#9721) https://github.com/vim/vim/commit/28e8f73ae2d90009fd62cd60f97c2643ba44de68
* | | fix(api): validate command names in nvim_add_user_command (#17406)Gregory Anders2022-02-15
| |/ |/| | | | | This uses the same validation used when defining commands with `:command`.
* | fix: close floating windows when calling win_close()Rom Grk2022-02-10
|/
* Merge pull request #16818 from zeertzjq/vim-8.2.3454zeertzjq2022-02-03
|\ | | | | vim-patch:8.2.{3454,3455,3497,3540,3581,3678}: some "p" and "gp" patches
| * vim-patch:8.2.3581: reading character past end of linezeertzjq2022-01-29
| | | | | | | | | | | | Problem: Reading character past end of line. Solution: Correct the cursor column. https://github.com/vim/vim/commit/0b5b06cb4777d1401fdf83e7d48d287662236e7e
* | vim-patch:8.2.4283: using a variable for the return value is not neededzeertzjq2022-02-02
| | | | | | | | | | | | | | | | | | Problem: Using a variable for the return value is not needed. Solution: Return the value directly. (closes vim/vim#9687) https://github.com/vim/vim/commit/73257149d759a8e6ddbe555d2b5aa37b6cb8db8b Also move down variable declarations in changedir_func(). vim_chdirfile() doesn't need change.
* | vim-patch:8.2.3947: unnecessary check for NULL pointerzeertzjq2022-02-02
| | | | | | | | | | | | | | | | Problem: Unnecessary check for NULL pointer. Solution: Remove the check. (closes vim/vim#9434) https://github.com/vim/vim/commit/f38aad85cf8e4e930c96cb843bc136949c8dbd29 Reorder the two if branches to match upstream.
* | 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.2.3433: :delcommand does not take a -buffer optionSean Dewar2022-01-30
| |/ | | | | | | | | | | Problem: :delcommand does not take a -buffer option. Solution: Add the -buffer option. https://github.com/vim/vim/commit/bdcba24d8597abd5af509c2fb9206e64e713c711
* | Merge pull request #17068 from VVKot/vim-8.2.3933Sean Dewar2022-01-31
|\ \ | | | | | | vim-patch:8.2.{3933,3973,3978,4013,4032,4048}
| * | vim-patch:8.2.3933: after ":cd" fails ":cd -" is incorrectVVKot2022-01-31
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: After ":cd" fails ":cd -" is incorrect. Solution: Set the previous directory only after successfully changing directory. (Richard Doty, closes vim/vim#9419, closes vim/vim#8983) https://github.com/vim/vim/commit/3d0abad5bf4fe125e219f1b56c4e8200cb900e2a Adjust the test's error message check due to missing patch vim-patch:8.2.3973: tiny build fails Problem: Tiny build fails. Solution: Adjust #ifdefs https://github.com/vim/vim/commit/0f7a5e758c5d8be2d8f1ab4a145d1636a36d18b2 vim-patch:8.2.3978: build error when using dynamycally loaded Python 3 Problem: Build error when using dynamycally loaded Python 3. Solution: Adjust #ifdef. https://github.com/vim/vim/commit/6b1a99dfe33cf5a1d7f82febd81face85ac1b8a6 vim-patch:8.2.4013: build failure without the spell feature Problem: Build failure without the spell feature. Solution: Adjust #ifdefs. https://github.com/vim/vim/commit/e60b3c47d701e73ecbadb1b9a12bf82010cadae8 vim-patch:8.2.4032: ATTRIBUTE_NORETURN is not needed Problem: ATTRIBUTE_NORETURN is not needed. Solution: Use NORETURN(). (Ozaki Kiichi, closes vim/vim#9487) https://github.com/vim/vim/commit/e12406526a24768e6121450112eb2f9f92445ac5 vim-patch:8.2.4048: gcc complains about use of "%p" in printf Problem: gcc complains about use of "%p" in printf. Solution: Add (void *) typecast. (Dominique Pellé, closes vim/vim#9494) https://github.com/vim/vim/commit/c14f667626ba677a767d474324306e39096dc43e
* / vim-patch:8.2.3475: expression register set by not executed put command (#17211)zeertzjq2022-01-31
|/
* Merge pull request #16829 from zeertzjq/vim-8.2.2887zeertzjq2022-01-29
|\ | | | | vim-patch:8.2.{2887,3414,3999}: fullcommand() follow-up patches
| * vim-patch:8.2.3999: redundant check for NUL bytezeertzjq2022-01-05
| | | | | | | | | | | | Problem: Redundant check for NUL byte. Solution: Remove the check for a NUL byte. (closes vim/vim#9471) https://github.com/vim/vim/commit/c024ed9233feac4c8da7394a62bb50474803514f
| * vim-patch:8.2.3414: fullcommand() gives wrong name with buffer-local user ↵zeertzjq2022-01-05
| | | | | | | | | | | | | | | | | | | | command Problem: fullcommand() gives the wrong name if there is a buffer-local user command. (Naohiro Ono) Solution: Use a separate function to get the user command name. (closes vim/vim#8840) https://github.com/vim/vim/commit/80c88eac5a81dd9f1a96fc80cb8aab6c84fe7b86
| * vim-patch:8.2.2887: crash when passing null string to fullcommand()zeertzjq2022-01-05
| | | | | | | | | | | | Problem: Crash when passing null string to fullcommand(). Solution: Check for NULL pointer. (closes vim/vim#8256) https://github.com/vim/vim/commit/4c8e8c6e19b75d632b042aa0ba0a2ab769b2162e
* | Merge pull request #17145 from zeertzjq/vim-8.2.0128bfredl2022-01-27
|\ \ | | | | | | vim-patch:8.2.0128: cannot list options one per line
| * | vim-patch:8.2.0128: cannot list options one per linezeertzjq2022-01-20
| | | | | | | | | | | | | | | | | | Problem: Cannot list options one per line. Solution: Use ":set!" to list one option per line. https://github.com/vim/vim/commit/6b915c0c0ee7ef82f8d3d310a4345e098cb929b0
* | | Merge pull request #17156 from zeertzjq/vim-8.2.3584bfredl2022-01-23
|\ \ \ | | | | | | | | vim-patch:8.2.{3584,3586,3587}: :command "-keepscript" argument
| * | | vim-patch:8.2.3584: "verbose set efm" reports location of the :compiler commandzeertzjq2022-01-21
| |/ / | | | | | | | | | | | | | | | | | | | | | Problem: "verbose set efm" reports the location of the :compiler command. (Gary Johnson) Solution: Add the "-keepscript" argument to :command and use it when defining CompilerSet. https://github.com/vim/vim/commit/58ef8a31d7087d495ab1582be5b7a22796ac2451
* / / refactor: remove CSI unescaping and clean up related names and commentszeertzjq2022-01-21
|/ /
* | refactor: source ftplugin.vim separately from filetype.vim (#17129)Gregory Anders2022-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-on to #17040. The real benefit of #17040 was ensuring that the ftplugin FileType autocommand was defined first and thus always fired first. A side effect of the implementation in #17040 was that setting variables that modified the state of filetype detection (such as g:did_load_filetypes or g:do_filetype_lua) could no longer be set in the user's init file. Filetype detection can also no longer be prevented from loading by using `:filetype off`. This PR addresses both of those side effects by unconditionally sourcing ftplugin.vim and indent.vim before the user's init file (which ensures that these autocommands run first) and sourcing filetype.vim *after* the user's init file (thus allowing it to be blocked or modified).
* | Merge pull request #16848 from dundargoc/refactor/prevent-overflow-by-castingbfredl2022-01-08
|\ \ | |/ |/| refactor: avoid overflow by explicitly casting operand to a wider type
| * chore(fixup): bfredl size_tDundar Göc2022-01-01
| |
| * refactor: avoid overflow by explicitly casting operand to a wider typeDundar Göc2021-12-31
| |
* | feat: filetype.lua (#16600)Gregory Anders2022-01-04
|/ | | | Adds a new vim.filetype module that provides support for filetype detection in Lua.
* Merge pull request #16752 from gpanders/lua-user-commandsBjörn Linse2021-12-28
|\ | | | | feat(api): implement nvim_{add,del}_user_command
| * feat(api): implement nvim_{add,del}_user_commandGregory Anders2021-12-28
| | | | | | | | | | Add support for adding and removing custom user commands with the Nvim API.