Commit Graph

24612 Commits

Author SHA1 Message Date
dundargoc
38365fa2ef
build: fix dependencies in find modules (#22017)
Find modules should only link to libraries defined in the find module,
and not the main project. This helps the find modules be more self-contained and easier to understand.
2023-01-27 14:16:31 +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
zeertzjq
e02df23b4e
docs: clarify :runtime behavior without [where] again (#22003)
The behavior changed again after #15867, change the docs to describe
latest behavior.
2023-01-26 19:35:06 +08:00
Anton Kriese
3544082f46
test: exepath() returns correct path with cmd.exe, powershell #21928
test(exepath): test if exepath returns correct path with multiple
Windows shells

This test covers the changes from #21175 where exepath() is set to
prefer file extensions in powershell.exe aswell as in cmd.exe.

In both shells, the file with a valid extension should be returned
instead of the extensionless file.
2023-01-26 03:06:29 -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
a0a1125159
Merge pull request #22002 from zeertzjq/vim-9.0.1227
vim-patch:9.0.{1227,1231,1238,1242}: cmdline completion for :runtime
2023-01-26 12:17:51 +08:00
zeertzjq
62f09017e0 test: add test for :runtime completion for .lua 2023-01-26 11:55:34 +08: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
dundargoc
b05100a9ea
build: use cmake to build libvterm on all platform (#21986)
Also remove Libvterm-tbl2inc_c.cmake as it's not required. It's used to
generate files that are already provided by the Libvterm project by
default. It's also not really something we need to concern ourselves
with as it's more of an authoring tool for the Libvterm creator as
mentioned in
https://github.com/neovim/neovim/pull/21986#issuecomment-1403733054.
2023-01-26 00:06:52 +01:00
dundargoc
15394b6855
ci: fix lintc to use external dependencies instead of bundled (#21995)
Use the bundled libvterm dependency as the external package is outdated,
with the hopes of being able to use the external package once its
version meets our required version.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-01-25 20:33:18 +01:00
0xAdk
3c48d3c83f
fix(man.lua): open in current window if it's already a man page (#21987)
This matters when there are multiple man page windows open.
2023-01-25 22:39:25 +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
dundargoc
b8288df99b
build: introduce default build variables (#21991)
There are a number of cmake variables and cache variables that need to
be passed to all dependencies. This is not only cumbersome, but also
fragile as it's easy to miss adding or removing a flag from a dependency
by accident. Introducing a global variable that controls all builds
makes it much easier to handle our dependencies.

Also fixes the currently broken release workflow as we need to pass the
CMAKE_OSX_ARCHITECTURES variable to all dependencies built with cmake.
2023-01-25 14:36:17 +01: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