Commit Graph

15726 Commits

Author SHA1 Message Date
zeertzjq
b4c4c232ba fix(fileio.c): don't use uninitialized memory (#22031) 2023-01-28 13:06:45 +08:00
dundargoc
881d4adb59 build: enable ccache by default if available (#22020)
Initial benchmarks show that this gives a nice 50% compile time
reduction for neovim. This shouldn't affect users or CI, but it's a nice
speedup for local development. The C_COMPILER_LAUNCHER target property
is only supported by Makefiles and Ninja generators only, so this won't
give a speedup when using the Xcode and Visual Studio generators even if
ccache is available.
2023-01-28 00:42:13 +01:00
Lewis Russell
aec4b476c5 docs(api): tweak data arg for nvim_create_autocmd (#22008)
Fixes #21964
2023-01-27 11:24:20 +00:00
Lewis Russell
82fb6ce487 Merge pull request #21994 from lewis6991/refactor/option_set 2023-01-27 11:23:44 +00:00
dundargoc
d85ed00a8c build: find unibilium without relying on libfindmacros (#22015)
This will remove the warning about the find module not providing a
version.
2023-01-27 11:53:32 +01:00
Lewis Russell
77a0ce1d9b refactor(option.c): factor out string option special case handling 2023-01-27 10:43:42 +00:00
Lewis Russell
068151f5c6 refactor(option.c): factor out some nextchar checks 2023-01-27 10:43:41 +00:00
Lewis Russell
9b43dcdbff fix(test): unset XDG_CONFIG_HOME when running oldtest
- also fix test_taglist.vim for users running with a tags file created
  in runtime/doc
2023-01-27 09:48:00 +00:00
dundargoc
843c9025ae build: check if libvterm version meets requirement (#22010)
The vterm.h file only specifies major and minor version, but not patch,
meaning that requiring a specific patch number isn't currently possible.
2023-01-26 21:35:06 +01:00
Lewis Russell
3c2bb1b2be refactor(fileio.c): reduce scope of locals 2023-01-26 15:17:23 +00:00
zeertzjq
41aa5ce3eb vim-patch:9.0.1246: code is indented more than necessary (#22006)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11887)

142ed77898

Omit function_using_block_scopes(): only affects Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-26 21:05:34 +08:00
Lewis Russell
8f2d3537b4 refactor(option.c): add do_set_option_value 2023-01-26 10:42:26 +00:00
Lewis Russell
0170219e92 refactor(option.c): move bool prefix check 2023-01-26 10:26:07 +00:00
Lewis Russell
c6907ea895 refactor(option.c): de-nest code in do_set_option 2023-01-26 10:02:01 +00:00
Lewis Russell
e49ae04caf refactor(option.c): factor out opt_idx validation 2023-01-26 10:02:00 +00:00
Lewis Russell
2c601787ab refactor(option.c): factor out option name parsing 2023-01-26 10:02:00 +00:00
Lewis Russell
9a9129c60b refactor(option.c): factor out option prefix parsing 2023-01-26 10:02:00 +00:00
Lewis Russell
0f3fa5a30a refactor(option.c): factor out set op parsing 2023-01-26 10:02:00 +00:00
Lewis Russell
25310af060 refactor(option.c): use skiptowhite_esc 2023-01-26 10:02:00 +00:00
Lewis Russell
334f538267 refactor(option.c): change nextchar to uint8_t 2023-01-26 10:02:00 +00:00
Lewis Russell
ef85238fde refactor(option.c): remove goto 2023-01-26 10:02:00 +00:00
Lewis Russell
a13e97ece5 refactor(option.c): int -> bool 2023-01-26 10:01:59 +00:00
Lewis Russell
bb1efa85aa refactor(option.c): reduce scope or startarg 2023-01-26 09:53:15 +00:00
Lewis Russell
b93bec68bc refactor(option.c): reduce scope or errbuf 2023-01-26 09:53:15 +00:00
Lewis Russell
3ae3e47d54 refactor(option.c): reduce scope or errmsg 2023-01-26 09:53:14 +00:00
Lewis Russell
e368560c80 refactor(option.c): factor out loop code from do_set() 2023-01-26 09:53:13 +00:00
Lewis Russell
18c37c616e refactor(option.c): factor out common skip check 2023-01-26 09:52:22 +00:00
Lewis Russell
9679d058d4 refactor(option.c): simplify do_set_string 2023-01-26 09:51:45 +00:00
Lewis Russell
ca1ad8977c refactor(option.c): add do_set_bool 2023-01-26 09:51:45 +00:00
Lewis Russell
37b44d1772 refactor(option.c): add do_set_num 2023-01-26 09:51:43 +00:00
zeertzjq
ebc80dcded vim-patch:9.0.1242: code for :runtime completion is not consistent
Problem:    Code for :runtime completion is not consistent.
Solution:   Make code for cmdline expansion more consistent. (closes vim/vim#11875)

b0d45ec67f
2023-01-26 11:55:34 +08:00
zeertzjq
f03f6263bb vim-patch:9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes vim/vim#11874)

5c8771bc5a
2023-01-26 11:55:34 +08:00
zeertzjq
6320c91c50 vim-patch:9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes vim/vim#11863)

3770f4c9cd
2023-01-26 11:55:34 +08:00
zeertzjq
6644786db0 vim-patch:9.0.1227: no cmdline completion for :runtime
Problem:    No cmdline completion for :runtime.
Solution:   Add completion for :runtime. (closes vim/vim#11853, closes vim/vim#11447)
            Improve the resulting matches.

a6759381a5
2023-01-26 11:55:32 +08:00
zeertzjq
5ac34cf55d refactor(intro): avoid Coverity warning (#22000)
refactor(intro): avoid coverity warning

Problem:    Coverity warns about overwriting "mesg" leaking memory.
Solution:   Make it clear that "mesg" will not be overwritten.
2023-01-26 09:30:26 +08:00
zeertzjq
116766f243 refactor(options): don't pass negative number to illegal_char() (#21999)
This only changes the error messages for an unexpected Unicode char in
an option to show its first byte instead of some special keycode.

The second argument of vim_strchr() usually doesn't matter, but it may
be better to consistently cast to uint8_t.
2023-01-26 09:12:33 +08:00
zeertzjq
88e906d165 vim-patch:9.0.1245: code is indented more than necessary (#21998)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11879)

032713f829

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-26 08:52:21 +08:00
zeertzjq
f15947866c vim-patch:9.0.1243: :setglobal cannot use script-local function for "expr" option (#21997)
Problem:    :setglobal cannot use script-local function for "expr" option.
Solution:   Use the pointer to the option value properly. (closes vim/vim#11883)

01d4efe2e8
2023-01-26 07:46:51 +08:00
zeertzjq
c94d8e7f13 vim-patch:9.0.1244: cursor displayed in wrong position when leaving Insert mode (#21996)
Problem:    Cursor briefly displayed in a wrong position when pressing Esc in
            Insert mode after autoindent was used.
Solution:   Do not adjust the cursor position for assumed deleted white space
            if text is following.  (closes vim/vim#11877)

0f843ef091

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-26 07:31:32 +08:00
Lewis Russell
e2a9d71521 Merge pull request #21885 from lewis6991/refactor/options
Problems:
    - Scope of local variables in options code is too large.
    - did_set_string_option() is too large (>1000LOC).
    - Setting options for a particular window or buffer requires a changing context (assigning curwin/curbuf).

Solutions:
    - Reduce the scope of local variables.
    - Break up did_set_string_option so it doesn't contain specific logic about each individual option (1038 LOC -> 310 LOC).
    - Begin work on making functions not depend on curbuf or curwin and pass window or buffer handles explicitly.
2023-01-25 13:46:23 +00:00
Lewis Russell
7bee622fdc refactor(optionstr.c): move handling of formatlistpat 2023-01-25 12:17:38 +00:00
Lewis Russell
15499fa856 refactor(optionstr.c): break up did_set_expropt 2023-01-25 12:13:06 +00:00
Lewis Russell
f37ec6026f refactor(optionstr.c): remove some redundant parens 2023-01-25 11:48:55 +00:00
Lewis Russell
b278e0740e refactor(optionstr.c): break up did_option_listflags 2023-01-25 11:48:55 +00:00
Lewis Russell
38ed432164 refactor(optionstr.c): add did_set_string_option_for 2023-01-25 11:48:55 +00:00
Lewis Russell
414e71fa4f refactor(optionstr.c): break up did_set_string_option 52 2023-01-25 11:48:53 +00:00
Lewis Russell
0012ed2bc7 refactor(optionstr.c): break up did_set_string_option 51 2023-01-25 11:48:53 +00:00
Lewis Russell
2654a9e9d8 refactor(optionstr.c): remove some simple did_set_* functions 2 2023-01-25 11:48:53 +00:00
Lewis Russell
e5234d48ed refactor(optionstr.c): remove some simple did_set_* functions 2023-01-25 11:48:53 +00:00
Lewis Russell
c6e7abb583 refactor(optionstr.c): break up did_set_string_option 50 2023-01-25 11:48:53 +00:00