aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
Commit message (Collapse)AuthorAge
...
* 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
|
* Merge #15994 feat(:source, nvim_exec): script-local scopeJustin M. Keyes2021-10-17
|\
| * feat(:source, nvim_exec): defer script item creation until s:var accessSean Dewar2021-10-14
| | | | | | | | | | | | | | | | For anonymous scripts, defer the creation of script items until an attempt to access a script-local variable is made. This dramatically reduces the number of script items created when using lots of vim.cmd and nvim_exec especially. This will mean <SID> usage fails until a script-local variable access is first made.
| * feat(:source, nvim_exec): support script-local variablesSean Dewar2021-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on #13143 (and #11507) with changes: - Omit script_type_E. Use sn_name == NULL to determine anon items. - Keep SID_STR. Used by anon :source for .lua files (no item). - Show SID in get_scriptname output (:verbose set). - Factor item creation into new_script_item. - Leave sc_seq = 0 (anon scripts don't re-use the same item when re-sourced). - Add tests for anon :source. Co-authored-by: Vikram Pal <vikrampal659@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* | refactor: reduce number of unique char castsDundar Göc2021-10-13
|/
* refactor: reduce number of unique char casts (#15995)dundargoc2021-10-12
|
* Refactor/uncrustify (#15790)dundargoc2021-09-29
| | | | | | | | | | | | | * refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
* refactor: format with uncrustify #15778dundargoc2021-09-25
| | | * fixup: force exactly one whitespace between type and variable
* fix(PVS V507): false positiveJustin M. Keyes2021-09-24
| | | | | | | | | | https://pvs-studio.com/en/docs/warnings/v507/ "Pointer to local array 'sourcing_name_buf' is stored outside the scope of this array. Such a pointer will become invalid." False positive: `sourcing_name = save_sourcing_name` before returning from this scope.
* fix(startup): init.lua: set $MYVIMRC to absolute path #15748Justin M. Keyes2021-09-21
| | | | | | - main.c: remove os_setenv("MYVIMRC",…), it is already done by do_source(). - This also sets $MYVIMRC to a full (absolute) path. - code cleanup.
* refactor: format with uncrustify #15726dundargoc2021-09-20
|
* refactor(runtime): always use DIP_START when searching for runtime filesBjörn Linse2021-09-18
| | | | | | | | Now remove the addition of "start/*" packages in 'packpath' as explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming very long when using a lot of plugins as packages. To get the effective search path as a list, use |nvim_list_runtime_paths()|
* fix(:source): copy curbuf lines to memory before sourcing #15111Sean Dewar2021-09-15
| | | | | | | | | It's possible for weirdness to happen if curbuf is modified while sourcing from it via :source (with no arguments). For example: - Deleting lines from or wiping curbuf can cause internal error E315 to be thrown from ml_get. - Changing the curbuf to another buffer while sourcing can cause lines from the new curbuf to then be sourced instead.
* fix(:source, nvim_exec): handle Vimscript line continuations #14809Sean Dewar2021-09-14
| | | | | | | | | | | Problem: Anonymous :source (no args) and nvim_exec() don't support Vimscript line continuations. Solution: Factor out the concat logic into concat_continued_line() and a CONCAT_CONTINUED_LINES macro for simple concatenations where lines are fetched individually. Closes #14807
* vim-patch:8.1.1195: Vim script debugger functionality needs cleanupSean Dewar2021-09-13
| | | | | | | | | | | Problem: Vim script debugger functionality needs cleanup. Solution: Move debugger code to a separate file. Add more tests. (Yegappan Lakshmanan, closes vim/vim#4285) https://github.com/vim/vim/commit/eead75c5e8e1f965548c55ee3a9388b2cb3afc36 Good to have for eval_expr_restore in v8.2.3417. Doesn't actually add any tests.
* refactor: replace TRUE/FALSE with true/falseDundar Göc2021-08-12
|
* refactor: replace TRUE/FALSE with true/falseDundar Göc2021-07-30
|
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* fix(source): Source giving E484 & parsing error at line 1 for lua filesshadmansaleh2021-06-21
| | | | | | | | | | | It's happening because do_source is only expected to return FAIL when it was unable to open file . But `nlua_exec_file` returns fail for parsing and execution error too . Those errors are emitted through `nlua_error`. So now return value of nlua_exec_file is ignored like do_cmdline. It now only returns fail when it was unable to open file that check is done before calling nlua_exec_file or do_cmdline. Errors in nlua_exec_file are still directly emitted through nlua_error like before.
* BugFix: Fix inconsistent verbose messageshadmansaleh2021-06-21
| | | | | | | When a keymap is set from lua currently verbose message says it's set from line 1. That's incorrect because we don't really know when it was set. So until proper :verbose support isn't added for sourceing lua it shouldn't say where it was set at.
* fixup(runtime): Fix lua runtime files not listedshadmansaleh2021-06-13
| | | | | | | | | lua runtime files weren't listed in :scriptname & profiler. This fixes that. * Add tests * Small doc tweeks
* refactor(source): Move lua file detection to do_sourceshadmansaleh2021-06-11
| | | | | | So now :source can run lua files too :) * feat: Add support for :[ranged]source for lua files
* feat(runtime): Allow lua to be used in compilershadmansaleh2021-06-11
|
* clang/'Logic error': has_profiling() may not set forceitJan Edmund Lazo2021-06-02
|
* Merge pull request #14403 from seandewar/vim-8.2.1933Jan Edmund Lazo2021-05-09
|\ | | | | vim-patch:8.2.{0174,1933,1935,1946,2286,2287}
| * eval: port v:collateSean Dewar2021-04-20
| | | | | | | | Cherry-picked from patch v8.2.0988. Required for patch v8.2.1933.
* | get_str_line: Replace grow_array usageFabian Viöl2021-05-03
| | | | | | | | | | A single xmemdupz is sufficient, as it is already zero-terminating the string
* | get_str_line: Simplify growarray usageFabian Viöl2021-04-30
| |
* | get_str_line: Use heap instead of stackFabian Viöl2021-04-29
|/ | | | | | | | | | | | | | The stack allocated buffer does introduce an arbitrary limit, to the length of the line. Previously, if the line was too long, it might be catched by a stack smash canary or resulted into a crash. This is not guaranteed though, and thus could result into undefined behavior. To mitigate this, an dynamic allocated buffer is replacing the stack allocated buffer, with the initial capacity of the copied line.
* vim-patch:8.2.0069: ETYPE_ is used for two different enumsJan Edmund Lazo2021-04-11
| | | | | | Problem: ETYPE_ is used for two different enums. Solution: Rename one to use EXPR_. https://github.com/vim/vim/commit/87396072c5c468f0c129e4ec7cd944ac897b7752
* vim-patch:8.2.0044: expression type is used inconsistentlyJan Edmund Lazo2021-04-11
| | | | | | | Problem: Expression type is used inconsistently. Solution: Add "ETYPE_IS" and "ETYPE_ISNOT" as separate enum values. Rename "TYPE_" to "ETYPE_" to avoid confusion. https://github.com/vim/vim/commit/07a3db89b8953bd0964895badb3b662f7514bc10
* vim-patch:8.0.1511: some code for the debugger watch expression is clumsyJan Edmund Lazo2021-04-08
| | | | | | Problem: Some code for the debugger watch expression is clumsy. Solution: Clean up the code. https://github.com/vim/vim/commit/3198870137df64214317151726648af8e56f1729
* vim-patch:8.0.1505: debugger can't break on a conditionJan Edmund Lazo2021-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Debugger can't break on a condition. (Charles Campbell) Solution: Add ":breakadd expr". (Christian Brabandt, closes vim/vim#859) https://github.com/vim/vim/commit/c6f9f739d32084923c3031cbf6f581f8c8bf7fd2 Do not port "has_watchexpr()" to avoid dead code. "has_watchexpr()" always returns 0 because "debug_expr" is always 0. Restore "eval_expr()" as a wrapper to allocate "typval_T" for "eval0()". Remove it in later patches. Include "typval_compare()" changes from patch v8.1.0958, partially ported in 8b60368c1b9e23f0695557da170d416d71f7e6a3. Close https://github.com/neovim/neovim/pull/12373 N/A patches for version.c: vim-patch:8.2.2720: GTK menu tooltip moves the cursor Problem: GTK menu tooltip moves the cursor. Solution: Position the cursor after displaying the tooltip. Do not show the tooltip when editing the command line. https://github.com/vim/vim/commit/01ac0a1f664c5b1ffd5c9ef196d4b47edf2fd494
* clang/'Logic error': cmd_source_buffer() requires nonnull paramJan Edmund Lazo2021-04-02
|
* vim-patch:8.2.2236: 'scroll' option can change when setting the statuslineJan Edmund Lazo2021-03-02
| | | | | | | | Problem: 'scroll' option can change when setting the statusline or tabline but the option context is not updated. Solution: Update the script context when the scroll option is changed as a side effect. (Christian Brabandt, closes vim/vim#7533) https://github.com/vim/vim/commit/746670604a60cb0356b56c112ffb6d297c679099
* [RFC] ":source" sources from current buffer if filename is omitted (#11444)Vikram Pal2021-02-18
| | | Fix https://github.com/neovim/neovim/issues/8722
* vim-patch:8.1.0341: :argadd in empty buffer changes the buffer nameJan Edmund Lazo2021-02-10
| | | | | | | Problem: :argadd in empty buffer changes the buffer name. (Pavol Juhas) Solution: Don't re-use the current buffer when not going to edit the file. (closes vim/vim#3397) Do re-use the current buffer for :next. https://github.com/vim/vim/commit/32bbd00949c585ea1c9da13197279a175097eddd
* eval: use char* for set_internal_string_var()Jan Edmund Lazo2021-02-07
| | | | | | "name" param was cast to (const char *). All calls to set_internal_string_var() cast from (char *) to (char_u *). Remove these useless casts.
* vim-patch:8.2.2430: :vimgrep expands wildcards twice (#13853)Jan Edmund Lazo2021-01-31
| | | | | Problem: :vimgrep expands wildcards twice. Solution: Do not expand wildcards a second time. https://github.com/vim/vim/commit/f8c6a1718007432812184c28495e8d27ee6c0395
* vim-patch:8.1.1261: no error for quickfix commands with negative rangeerw72021-01-01
| | | | | | | | | | | | | | | Problem: No error for quickfix commands with negative range. Solution: Add ADDR_UNSIGNED and use it for quickfix commands. Make assert_fails() show the command if the error doesn't match. https://github.com/vim/vim/commit/25190db225d63e185e77e043e694ef455b3cf304 N/A patches for version.c: vim-patch:8.2.0113: "make cmdidxs" fails Problem: "make cmdidxs" fails. Solution: Allow address for ":cquit". Add --not-a-term to avoid a delay. https://github.com/vim/vim/commit/9b24dfcb9f676e7f7a09a9062f0d05b2104a87eb
* vim-patch:8.2.2231: when "--remote file" is used "file" is not reloadedJan Edmund Lazo2020-12-27
| | | | | | | | | | | Problem: When "--remote file" is used "file" is not reloaded. Solution: When a :drop command is used for a file that is already displayed in a window and it has not been changed, check if it needs to be reloaded. (closes vim/vim#7560) https://github.com/vim/vim/commit/e4862a0fe62261754daf476866ef2aa8586b716c Remove unused "focus" parameter from "buf_check_timestamp()". It was meant for removed GUI code.
* vim-patch:8.0.1525: using :wqa exits even if a job runs in a terminal windowJan Edmund Lazo2020-12-01
| | | | | | | Problem: Using :wqa exits even if a job runs in a terminal window. (Jason Felice) Solution: Check if a terminal has a running job. (closes vim/vim#2654) https://github.com/vim/vim/commit/7a76092a51fc5446426a4bfd9eb6503ec61bf9e9
* fixup! vim-patch:8.0.0858: check if job terminal is running #10908Jan Edmund Lazo2020-12-01
|
* Merge pull request #13379 from bfredl/runtimeBjörn Linse2020-11-25
|\ | | | | runtime: extract 'runtimepath' and 'packpath' logic to its own file
| * runtime: extract 'runtimepath' and 'packpath' logic to its own fileBjörn Linse2020-11-25
| | | | | | | | No code changes, except for added ILOG for the calculated startup path
* | Add eap->skip checks to script_host_{execute_file,do_range}James McCoy2020-11-22
|/ | | | | | As a safety measure, return immediately from these functions if eap->skip is set. This is set when VimL is being parsed, to skip past dead code, and should not be executed.
* startup: load files from &packpath . '/start/{pluginname}'Björn Linse2020-11-19
| | | | | | | | | | | Quoting the existing docs: Packages are loaded. These are plugins, as above [&runtimepath], but found in the "start" directory of each entry in 'packpath'. Every plugin directory found is added in 'runtimepath' and then the plugins are sourced. Also tj didn't think I could do it.
* startup: handle autoload and lua packages during startupBjörn Linse2020-11-02
| | | | ¡NO HAY BANDA!
* vim-patch:8.1.1795: no syntax HL after splitting windows with :bufdoJan Edmund Lazo2020-10-17
| | | | | | | | Problem: No syntax HL after splitting windows with :bufdo. (Yasuhiro Matsumoto) Solution: Trigger Syntax autocommands in buffers that are active. (closes vim/vim#4761) https://github.com/vim/vim/commit/c7f1e4002184903f4e12e429dd5c6ab731932f86