Commit Graph

21689 Commits

Author SHA1 Message Date
dundargoc
19da1071dc
ci(clint): remove clint.py line length check #18574
uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-15 12:01:29 -07:00
bfredl
717560d221
Merge pull request #18581 from famiu/refactor/ui/vertsplit
refactor(ui)!: link `VertSplit` to `Normal` by default
2022-05-15 20:01:17 +02:00
Famiu Haque
bbf58e6bbc refactor(ui)!: link VertSplit to Normal by default
Avoids using `gui=reverse` on `VertSplit` and makes window separators
look much nicer by default.
2022-05-15 22:37:35 +06:00
dundargoc
a098e304b0
ci: enable tests on drafts as well #18566
previous: https://github.com/neovim/neovim/pull/14123

CI tests were disabled on drafts #18566 to manage the
large number of incoming jobs. While this did help, it had the drawback
of making the purpose of the ready-for-review a bit fuzzier. It went
from a clear "my PR is ready" signal to maintainers to somewhere between
"my PR is ready but I need the tests to confirm" to "please don't merge
yet, I just need to see the test results". Worse is that the specific
case of wanting to see the test results but not wanting it merged is
that this needs to be actively conveyed to the maintainers with a [DNM]
or a comment to not merge the PR yet. All of this causes weird
workarounds and noises which I believe isn't necessary.

The reason why I don't think this workaround is needed anymore is that
our CI now aborts a job if a new job from the same pull requests is
created, which makes the "10 simultaneous jobs per PR" situations that
triggered this not possible.
2022-05-15 08:18:38 -07:00
dundargoc
793496aecc
fix PVS warnings (#18459)
* fix(PVS/V547): remove ifs that are always true or false

* fix(PVS/V560): remove partial conditions that are always true

* fix(PVS/V1044): suppress warning about loop break conditions

* fix(PVS/V1063): suppress "modulo by 1 operation is meaningless"

* fix(PVS/V568): suppress "operator evaluates the size of a pointer"

Also mark vim-patch:8.2.4958 as ported.
2022-05-15 21:04:56 +08:00
dundargoc
4c7462fdb3
build: enable EXITFREE on Debug builds (#17783)
This makes it more convenient to find memory leaks since you don't need
to remember to set the EXITFREE flag every time you use valgrind or a
sanitizer.
2022-05-15 11:41:17 +02:00
dundargoc
b1b5802009
build(gen_vimdoc): eliminate non-constant global variables (#17781) 2022-05-15 11:23:56 +02:00
dundargoc
0a66c4a72a
docs(nvim_set_keymap): specify that optional arguments defaults to false (#18177)
Closes: https://github.com/neovim/neovim/issues/16919
2022-05-15 16:44:48 +08:00
Christian Clason
bc45b5be1c
vim-patch:partial: 30ab04e16e1e (#18568)
Update runtime files, new color schemes
30ab04e16e

Skip: doc/* (in-progress rewrite of the user manual on creating vim(9)script plugins)
2022-05-15 10:25:02 +02:00
dundargoc
0adc66171a
refactor(uncrustify): enable formatting for regexp and indent files (#18549)
The formatting for these files were originally disabled as to signal
that "we don't own these files", meaning we intentionally want to
minimize the amount of work put in these files as the return will be
very little. This unfortunately conflicts with other refactoring efforts
that happen to touch these files, and it's easier to simply enable
formatting.
2022-05-14 20:35:39 +02:00
Marco Hinz
83da441d16
Merge pull request #18537 from dundargoc/ci/clint
ci(clint): remove check for include order
2022-05-14 19:09:33 +02:00
Dundar Goc
3bd7246f5a ci(clint): remove check for include order
Uncrustify and clang-format are already both excellent at ordering
includes; this isn't something we need to check for ourselves. Also
remove the section on include order in the dev-style documentation.
2022-05-14 15:09:02 +02:00
Dundar Goc
adf967331f ci(clint): fix all pyright warnings 2022-05-14 15:09:02 +02:00
zeertzjq
d547e21f9e
Merge pull request #18567 from zeertzjq/vim-8.2.4951
vim-patch:8.2.{4951,4953}: with 'si' inserting char after completion goes wrong
2022-05-14 20:48:05 +08:00
zeertzjq
dca0412d37 vim-patch:8.2.4953: with 'si' inserting '}' after completion goes wrong
Problem:    With 'smartindent' inserting '}' after completion goes wrong.
Solution:   Check the cursor is in indent.  (closes vim/vim#10420)
2e444bbef0
2022-05-14 20:05:39 +08:00
zeertzjq
24eb1af475 vim-patch:8.2.4951: smart indenting done when not enabled
Problem:    Smart indenting done when not enabled.
Solution:   Check option values before setting can_si. (closes vim/vim#10420)
de5cf28781
2022-05-14 20:05:39 +08:00
bfredl
99f3e74fc2
Merge pull request #18542 from famiu/feat/api/nvim_cmd/kvec_t
refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline string
2022-05-14 11:20:13 +02:00
Famiu Haque
566f8f80d6 refactor(api/nvim_cmd): use kvec_t for constructing cmdline string
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-14 10:25:52 +06:00
Roj
9e4286294f
build(nvim.desktop): central Kurdish translation #17065
Co-authored-by: Sarchia <74000088+Sarchia@users.noreply.github.com>
2022-05-13 11:58:22 -07:00
Arsham Shirvani
f6ba7d69be
fix(man.vim): q in "$MANPAGER mode" does not quit #18443
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
    nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")

Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.

Fixes #18281
Ref #17791

Helped-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-05-13 07:49:08 -07:00
Christian Clason
eb4b337d9e
vim-patch:partial:3f32a5f1601a (#18555)
Update runtime files and translations
3f32a5f160

skip eval.txt (requires 8.2.4883)
2022-05-13 15:20:58 +02:00
zeertzjq
c196119acb
vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947)
Problem:    Search highlight disappears in the Visual area.
Solution:   Combine the search attributes. (closes vim/vim#8134)
2d5f385cee
2022-05-13 21:20:15 +08:00
dundargoc
2875d45e79
ci(commitlint): ignore "fixup" commits #18556 2022-05-13 05:37:33 -07:00
kevinhwang91
a33caf9b45 perf(_editor): no need to stop inside vim.defer_fn
uv_run:
1. remove timer handle from heap
2. will start again if repeat is not 0
2022-05-13 14:16:47 +08:00
zeertzjq
030417d80b
revert: "feat(mappings): do not simplify the rhs of a mapping" (#18553)
This reverts commit 7ac5359143.
This fix can cause more problems than it solves.
2022-05-13 11:31:17 +08:00
yamatsum
233c41cb8c
feat(defaults): search selection by * and # in visual mode (#18538) 2022-05-13 08:28:10 +08:00
Justin M. Keyes
b96037e42d
ci: remove remnants of gperf #18550
gperf was removed in 36613b888b
yay!
2022-05-12 16:55:27 -07:00
dundargoc
0d5d9e90ab
fix(windows): stdpath("state") => "nvim-data" #18546
This was missed in https://github.com/neovim/neovim/pull/15583
2022-05-12 16:54:44 -07:00
Sean Dewar
aaeffba684
vim-patch:8.2.4943: changing 'switchbuf' may have no effect (#18545)
Problem:    Changing 'switchbuf' may have no effect.
Solution:   Handle 'switchbuf' in didset_string_options(). (Sean Dewar,
            closes vim/vim#10406)
39c46b4378

Guess it doesn't hurt to cherry-pick didset_string_options from v8.1.2045
(but in option.c, for now).
2022-05-13 00:41:20 +01:00
bfredl
af9c1e572d
Merge pull request #18489 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-13 00:14:46 +02:00
bfredl
e2d3e73748
Merge pull request #18544 from bfredl/hashyhash
refactor(eval): use Hashy McHashFace instead of gperf
2022-05-12 21:24:33 +02:00
bfredl
36613b888b refactor(eval): use Hashy McHashFace instead of gperf
this removes gperf as a build dependency
2022-05-12 20:01:04 +02:00
Fredrik Ekre
a9d25e9472
fix(lsp): perform client side filtering of code actions (#18392)
Implement filtering of actions based on the kind when passing the 'only'
parameter to code_action(). Action kinds are hierachical with a '.' as
the separator, and the filter thus allows, for example, both 'quickfix'
and 'quickfix.foo' when requestiong only 'quickfix'.

Fix https://github.com/neovim/neovim/pull/18221#issuecomment-1110179121
2022-05-12 18:48:02 +02:00
zeertzjq
de5ccf2348
Merge pull request #18540 from zeertzjq/vim-8.2.4919
vim-patch:8.2.{4919,4921}: can add invalid bytes with :spellgood
2022-05-12 23:48:58 +08:00
zeertzjq
0c8e48c78d
chore(editorconfig): remove "charset" (#18541)
Hardcoding a charset causes trouble when porting Vim patches.
I previously tried to unset "charset" for certain file extensions, but
vim-patch.sh can generate more files, and automatically detecting file
encoding is more correct anyway.
2022-05-12 23:48:42 +08:00
zeertzjq
a200ce0d85
vim-patch:8.2.4941: '[ and '] marks may be wrong after undo (#18539)
Problem:    '[ and '] marks may be wrong after undo.
Solution:   Adjust the '[ and '] marks if needed. (closes vim/vim#10407, closes vim/vim#1281)
82444cefa3
2022-05-12 23:38:26 +08:00
zeertzjq
8c0510af71 vim-patch:8.2.4921: spell test fails because of new illegal byte check
Problem:    Spell test fails because of new illegal byte check.
Solution:   Remove the test.
fe978c2b6b
2022-05-12 23:09:41 +08:00
zeertzjq
274f260806 vim-patch:8.2.4919: can add invalid bytes with :spellgood
Problem:    Can add invalid bytes with :spellgood.
Solution:   Check for a valid word string.
7c824682d2
2022-05-12 23:07:35 +08:00
Marco Hinz
8fba428bc6
fix(cmd): make :-tabmove work with modifiers (#18447)
`:tabmove` takes either an argument (`:tabmove -`) or an address (`:-tabmove`).

The code assumed that `:tabmove` is the first command on the cmdline, but that
is not the case when using additional modifiers like `:silent`.

Make the addr parsing more robust by searching the command first, then going
back to check for a potential address `-`.
2022-05-12 16:43:20 +02:00
Ivan
78a1e6bc00 feat(defaults): session data in $XDG_STATE_HOME #15583
See: 4f2884e16d

- Move session persistent data to $XDG_STATE_HOME Change 'directory',
  'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to
  $XDG_STATE_HOME/nvim.
- Move logs to $XDG_STATE_HOME, too.
- Add stdpath('log') support.

Fixes: #14805
2022-05-12 07:13:45 -07:00
dundargoc
a1b663cce8
build(lua2dox): add parenthesis around parameter types in documentation (#18532)
This will check if the string after the variable in a @param is either
"number", "string", "table", "boolean" and "function" and if so add a
parenthesis around it. This will help separate the variable type with
the following text. Had all our functions been annotated with emmylua
then a more robust solution might have been preferable (such as always
assuming the third string is parameter type without making any checks).
I believe however this is a clear improvement over the current situation
and will suffice for now.
2022-05-12 08:02:46 -06:00
Famiu Haque
2bbd588e73
feat(lua): vim.cmd() with kwargs acts like nvim_cmd() #18523 2022-05-12 06:34:38 -07:00
Clément Bœsch
963cfa7020
fix(terminal): invalid pointer comparison #18453
At the moment of comparison, the pointer save_curwin can be invalid (as
suggested by the comment) because it has been free'd. Worst, the new
curwin could have been re-allocated to that same pointer, altering the
execution flow unpredictably.

While there are many other potential similar cases to fix in the
codebase, the presented scenario is not hypothetical and does happen in
practice (while spawning new windows from fzf for instance).

There are numerous other instances of curwin comparisons in the
codebase, and they may need further investigation.

closes #16941
2022-05-12 05:53:08 -07:00
zeertzjq
3a91adabda
refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)
Most code in keymap.h is for keycode definitions, while most code in
keymap.c is for the parsing and conversion of keycodes.

The name "keymap" may also make people think these two files are for
mappings, while in fact keycodes are used even when no mappings are
involved, so "keycodes" should be a better file name than "keymap".
2022-05-12 20:19:29 +08:00
kylo252
a2d4b862f1
ci(bsd): conditional runs for faster builds #18439
(undocumented) sourcehut feature for conditionally running consequent tasks.

ref:
https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C3cd90a91b7ce113bb3c5f07898c77543%40hacktivista.com%3E
https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/worker/tasks.go#L196-198
2022-05-11 18:26:07 -07:00
Sean Dewar
c24b442e31
fix(runtime/genvimvim): omit s[ubstitute] from vimCommand #18480
It's special cased by the vimSubst syntax group, and isn't present in Vim's
vimCommand group.

For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the
`s` is parsed as vimCommand rather than as vimUserFunc since
`contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update.

Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc.
Vim also has that problem, so it should ideally be fixed upstream.

We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but
it doesn't work in some cases, like when there's a `:` before the command. Also,
Vim matches only `g` in vimCommand for some reason, which doesn't produce any
highlight for `:global/foo/bar` (with Nvim you at least get some highlights on
the `global` bit despite the leading `:`).

Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems
to have no problems finding it.
2022-05-11 17:08:25 -07:00
Andrey Mishchenko
60b1e314ed
docs: nvim_buf_[get|set]_[text|lines] (#18404)
- Use consistent formatting for args docs.
- Clarify inclusivity/exclusivity in `nvim_buf_[get|set]_text`.
2022-05-11 17:05:56 -07:00
Andrey Mishchenko
7900a8b713
docs(api): how to check if window is floating #18503 2022-05-11 16:49:19 -07:00
Dundar Goc
85aae12a6d refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-11 23:19:57 +02:00
Famiu Haque
cf68f0a512
fix(api): make nvim_cmd work correctly with empty arguments list (#18527)
Closes #18526.
2022-05-11 10:51:53 -06:00