Commit Graph

27802 Commits

Author SHA1 Message Date
dundargoc
9ad239690f ci: various fixes
- adjust reviewers
- add workflow as cache key
- install attr only when tesitng
- fix s390x workflow by checking out the merge PR instead of master
2023-11-03 22:16:45 +01:00
bfredl
310896f6aa
Merge pull request #25874 from bfredl/lets_rock
refactor(grid): implement rightleftcmd as a post-processing step
2023-11-03 14:25:15 +01:00
bfredl
44f0480a22 refactor(grid): implement rightleftcmd as a post-processing step
Previously, 'rightleftcmd' was implemented by having all code which
would affect msg_col or output screen cells be conditional on `cmdmsg_rl`.
This change removes all that and instead implements rightleft as a
mirroring post-processing step.
2023-11-03 11:35:42 +01:00
Christian Clason
d4dc1355ed vim-patch:1858e2b22ad1
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)

1858e2b22a

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-03 10:04:55 +01:00
Christian Clason
80cf1ee2c5 vim-patch:2b89afd5eb63
runtime(debversions): Add noble (24.04 LTS) as Ubuntu release name (vim/vim#13472)

2b89afd5eb

Co-authored-by: James McCoy <jamessan@jamessan.com>
2023-11-03 10:04:55 +01:00
zeertzjq
4c32927084
test(ui/embed_spec): make sure server is started (#25880) 2023-11-03 08:19:04 +08:00
dundargoc
5a2543c159
docs: small fixes (#25831)
Co-authored-by: Peter Aronoff <peter@aronoff.org>
2023-11-03 07:22:02 +08:00
Gregory Anders
c1a05f6112
build: make the vimdoc generation depend on the nvim target (#25876)
The gen_vimdoc.py script uses the nvim executable, so the executable
must be built before running the script.
2023-11-02 12:34:16 -07:00
Gregory Anders
e0d97d264f
build: use built nvim artifact to generate eval files (#25875)
In cases where the generated files depend on changes to Nvim itself,
generating the files with an older version of Nvim will fail because
those changes are not present in the older version.

For example, if a new option is added then the generator script should
be run with the version of Nvim that contains the new option, or else
the generation will fail.

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-11-02 11:12:38 -07:00
bfredl
363e029e7a
Merge pull request #25859 from luukvbaal/extmarkdel
refactor(extmarks): extmark_del() with MarkTreeIter
2023-11-02 10:55:56 +01:00
Luuk van Baal
14c7bf3916 refactor(extmarks): extmark_del() with MarkTreeIter 2023-11-01 23:20:38 +01:00
dundargoc
20dd9f3a26 ci: add optional CI that can be triggered manually
These are meant for expensive or situational tests that may not be
suitable to run each time, but can occasionally be useful.

Currently only add testing for s390x. The job is enabled by adding the
ci-s390x label in github.
2023-11-01 11:17:35 +01:00
dundargoc
1997ef134a build: set char to always be signed
Sticking to the same convention makes it easier to reason about the code
and reduces complexity.
2023-11-01 08:20:24 +01:00
zeertzjq
d7359a8742
fix(startup): trigger UIEnter for the correct channel (#25860) 2023-11-01 12:16:37 +08:00
George Harker
4e6096a67f
feat(server): allow embed with listen (#25709)
connection from any channel or stdio will unblock
remote_ui_wait_for_attach.  Wait on stdio only if
only —embed specified, if both —embed and
—listen then wait on any channel.
2023-11-01 11:04:53 +08:00
Gregory Anders
746a153bc1
fix(base64): only check padding if leftover index is set (#25854) 2023-10-31 10:13:45 -05:00
Gregory Anders
224f303ee5
feat(stdlib): add vim.base64 module (#25843)
Add base64 encode() and decode() functions to a vim.base64 module.
2023-10-31 09:15:32 -05:00
Evgeni Chasnovski
adbe7f3683
fix(lsp): call on_list() even for single location (#25830)
Problem: Currently there is no way of customizing behavior of
  `declaration`, `definition`, `typeDefinition`, and `implementation`
  methods in `vim.lsp.buf` when LSP server returns `Location`. Instead,
  cursor jumps to that location directly.

Solution: Normalize LSP response to be `Location[]` for those four cases.
2023-10-31 13:18:44 +01:00
bfredl
c1a93285d2
Merge pull request #25850 from famiu/refactor/option/string
refactor(options): remove `os_doskip`
2023-10-31 12:24:16 +01:00
Famiu Haque
5e8d4ee0db refactor(options): remove os_doskip
Problem: `os_doskip` seems to be unnecessary since everything that sets it to true also returns an error, and `errmsg` being non-`NULL` already skips most of the processing.

Solution: Remove `os_doskip`.
2023-10-31 13:36:06 +06:00
zeertzjq
d4c2fc6ff6
fix(terminal): keep focus when scrolling number column of another window (#25848) 2023-10-31 15:23:20 +08:00
zeertzjq
c881092ffe
fix(terminal): don't lose focus on <MouseMove> (#25845) 2023-10-31 12:05:37 +08:00
bfredl
6d1a2f2c3c
Merge pull request #25674 from famiu/refactor/options/unify_string_options
refactor(options): unify `set_option` and `set_string_option`
2023-10-30 20:06:57 +01:00
dependabot[bot]
788bc12a6f
ci: bump korthout/backport-action from 1 to 2 2023-10-30 18:23:11 +01:00
Famiu Haque
e19cc9c9b7 refactor(options)!: unify set_option and set_string_option
While the interfaces for setting number and boolean options are now unified by #25394, there is still a separate `set_string_option` function that is used for setting a string option. This PR removes that function and merges it with set_option.

BREAKING CHANGE: `v:option_old` is now the old global value for all global-local options, instead of just string global-local options. Local value for a global-local number/boolean option is now unset when the option is set (e.g. using `:set` or `nvim_set_option_value`) without a scope, which means they now behave the same way as string options.

Ref: #25672
2023-10-30 21:38:02 +06:00
Maria José Solano
0fe0cf5ada
fix(lsp): do not cancel snippet when selecting placeholder (#25835) 2023-10-30 12:58:28 +01:00
dundargoc
8405649f92 build: use neovim/libvterm instead of neovim/deps for libvterm
Using a mirror makes it easier to test patches as well as reducing
maintenance when a new version is released.
2023-10-29 12:14:19 +01:00
dundargoc
2dc9ceb99c
docs: small fixes (#25585)
Co-authored-by: tmummert <doczook@gmx.de>
Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
2023-10-29 16:02:32 +08:00
Raphael
0da27e9bde
fix(api): load buffer first on nvim_buf_set_lines (#25823)
Fix #22670
Fix #8659
2023-10-29 15:44:52 +08:00
zeertzjq
82b1a389ba
fix(terminal): avoid Insert mode in Terminal buffer (#25820) 2023-10-29 09:32:03 +08:00
Christian Clason
a5629abce2 vim-patch:a390e984db20
runtime(sh): add shDblParen to shLoopList for bash (vim/vim#13445)

add shDblParen to shLoopList to correctly highlight
arithmetic expressions for Bash and Ksh

This should allow code such as:

```bash
declare -i i j
for i in foo bar
do ((j = 1 << j))
done
```

a390e984db

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-10-29 01:37:07 +02:00
Christian Clason
c34e816608 vim-patch:9.0.2079: Not all Dart files detected
Problem:  Not all Dart files detected
Solution: Add shebang filetype detection for Dart

closes: vim/vim#13449

c1c177a47b

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-10-29 01:36:51 +02:00
zeertzjq
a2a1a65b98
vim-patch:8ebdbc9e6d80 (#25816)
runtime(doc): all secure options should note this restriction in the documentation (vim/vim#13448)

Problem:  Not all secure options document their status
Solution: Describe secure context :set restrictions in each help entry

8ebdbc9e6d

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-29 06:15:13 +08:00
luukvbaal
f2fb05238a
vim-patch:9.0.2081: smoothscroll may result in wrong cursor position (#25815)
Problem:  With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'.
          Resulting in incorrect calculation of the cursor position.
Solution: Reset "w_skipcol" when unsetting 'wrap'.

fixes:  vim/vim#12970
closes: vim/vim#13439

1bf1bf569b
2023-10-29 06:05:29 +08:00
dundargoc
4f526b9fd8 build: use neovim/libtermkey instead of neovim/deps for libtermkey
Using a mirror makes it easier to test patches as well as reducing
maintenance when a new version is released.
2023-10-28 22:32:52 +02:00
bfredl
c5f2472661
Merge pull request #25812 from famiu/test/api/option_value/modified
test: add test coverage for #25741
2023-10-28 21:47:40 +02:00
Famiu Haque
43a7945f1b test: add test coverage for #25741 2023-10-28 22:51:07 +06:00
dundargoc
7a5effb0f9 build: bump required minimum libvterm version to 0.3.3
Also add detection for libvterm patch version.
2023-10-28 10:46:58 +02:00
zeertzjq
ac353e87ae
vim-patch:9.0.2075: TextChangedI may not always trigger (#25808)
Problem:  TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
          append/change operations, and when
          opening a new line,

fixes: vim/vim#13367
closes: vim/vim#13375

4bca4897a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 10:42:18 +08:00
zeertzjq
f97248db75
vim-patch:9.0.2070: [security] disallow setting env in restricted mode (#25807)
Problem:  [security] disallow setting env in restricted mode
Solution: Setting environment variables in restricted mode could
          potentially be used to execute shell commands. Disallow this.

restricted mode: disable allow setting of environment variables

Setting environment variables in restricted mode, may have some unwanted
consequences. So, for example by setting $GCONV_PATH in restricted mode
and then calling the iconv() function, one may be able to execute some
unwanted payload, because the `iconv_open()` function internally uses
the `$GCONV_PATH` variable to find its conversion data.

So let's disable setting environment variables, even so this is no
complete protection, since we are not clearing the existing environment.
I tried a few ways but wasn't successful :(

One could also argue to disable the iconv() function completely in
restricted mode, but who knows what other API functions can be
influenced by setting some other unrelated environment variables.
So let's leave it as it is currently.

closes: vim/vim#13394
See: https://huntr.com/bounties/b0a2eda1-459c-4e36-98e6-0cc7d7faccfe/

6b89dd6a72

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 10:06:43 +08:00
zeertzjq
d2e7cc68e9
Merge pull request #25806 from zeertzjq/vim-9.0.2074
vim-patch:9.0.{2074,2077}: Completion menu may be wrong
2023-10-28 06:44:08 +08:00
Christian Clason
9455f6b17c vim-patch:650dcfc8d12e
runtime(netrw): don't echo empty lines (vim/vim#13431)

650dcfc8d1

Co-authored-by: nwounkn <nwounkn@gmail.com>
2023-10-28 00:24:40 +02:00
zeertzjq
063a78fda2 vim-patch:9.0.2077: CI fails because of trailing whitespace in test
Problem:  CI fails because of trailing whitespace in test
Solution: Remove it

87ca5e86fa

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 06:17:08 +08:00
zeertzjq
0b23207c73 vim-patch:9.0.2074: Completion menu may be wrong
Problem:  Completion menu may be wrong
Solution: Check for the original direction of the completion menu,
          add more tests, make it work with 'noselect'

completion: move in right direction when  filling completion_info()

When moving through the insert completion menu and switching directions,
we need to make sure we start at the correct position in the list and
move correctly forward/backwards through it, so that we do not skip
entries and the selected item points to the correct entry in the list
of completion entries generated by the completion_info() function.

The general case is this:

1) CTRL-X CTRL-N, we will traverse the list starting from
   compl_first_match and then go forwards (using the cp->next pointer)
   through the list (skipping the very first entry, which has the
   CP_ORIGINAL_TEXT flag set (since that is the empty/non-selected entry

2) CTRL-X CTRL-P, we will traverse the list starting from
   compl_first_match (which now points to the last entry). The previous
   entry will have the CP_ORIGINAL_TEXT flag set, so we need to start
   traversing the list from the second prev pointer.

There are in fact 2 special cases after starting the completion menu
with CTRL-X:

3)  CTRL-N and then going backwards by pressing CTRL-P again.
    compl_first_match will point to the same entry as in step 1 above,
    but since compl_dir_foward() has been switched by pressing CTRL-P
    to backwards we need to pretend to be in still in case 1 and still
    traverse the list in forward direction using the cp_next pointer

4)  CTRL-P and then going forwards by pressing CTRL-N again.
    compl_first_match will point to the same entry as in step 2 above,
    but since compl_dir_foward() has been switched by pressing CTRL-N
    to forwards we need to pretend to be in still in case 2 and still
    traverse the list in backward direction using the cp_prev pointer

For the 'noselect' case however, this is slightly different again. When
going backwards, we only need to go one cp_prev pointer back. And
resting of the direction works again slightly different. So we need to
take the noselect option into account when deciding in which direction
to iterate through the list of matches.

related: vim/vim#13402
related: vim/vim#12971
closes: vim/vim#13408

daef8c7437

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-28 06:16:55 +08:00
Jongwook Choi
add1b10b79
fix(diagnostic): virtual_text prefix function should have index and total (#25801)
The prefix option of the diagnostic virtual text can be a function,
but previously it was only a function of diagnostic.

This function should also have additional parameters index and total,
more consistently and similarily as in the prefix function for
`vim.diagnostic.open_float()`.

These additional parameters will be useful when there are too many
number of diagnostics in a single line.
2023-10-27 08:17:46 -05:00
Christian Clason
4fcdfa5ad0 vim-patch:7b7cda67a124
runtime(debian): update debian related runtime files (vim/vim#13423)

* Update Debian runtime files

Add mantic as a supported Ubuntu release and move buster/kinetic to
unsupported.

Add syntax highlighting for deb822sources filetype.

Add debsources ftplugin to set relevant comment options.

Move common version information to shared/debversions.vim

Closes vim/vim#11934

* Add myself as codeowner for Debian-related runtime files

---------

7b7cda67a1

Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-10-27 10:06:52 +02:00
Christian Clason
5753e5e7eb vim-patch:9.0.2071: objdump files not recognized
Problem:  objdump files not recognized
Solution: detect *.objdump files, add a filetype plugin

Added the objdump file/text format

closes: vim/vim#13425

10407df7a9

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2023-10-27 10:03:09 +02:00
zeertzjq
9dc440400c
vim-patch:9.0.2068: [security] overflow in :history (#25794)
Problem:  [security] overflow in :history
Solution: Check that value fits into int

The get_list_range() function, used to parse numbers for the :history
and :clist command internally uses long variables to store the numbers.
However function arguments are integer pointers, which can then
overflow.

Check that the return value from the vim_str2nr() function is not larger
than INT_MAX and if yes, bail out with an error. I guess nobody uses a
cmdline/clist history that needs so many entries... (famous last words).

It is only a moderate vulnerability, so impact should be low.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgm

9198c1f2b1

N/A patch:
vim-patch:9.0.2073: typo in quickfix.c comments

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-27 06:37:52 +08:00
Lajos Koszti
ba6761eafe
fix(lsp): fix omnicomplete in middle of the line (#25787)
Fixes a regression from 5e5f5174e3

Until that commit we had a logic like this:
`local prefix = startbyte and line:sub(startbyte + 1) or line_to_cursor:sub(word_boundary)`

The commit changed the logic and no longer cut off the line at the cursor,  resulting in a prefix that included trailing characters
2023-10-26 22:40:36 +02:00
Maria José Solano
15983cf2c6
fix(lsp): cancel session when leaving snippet region (#25762) 2023-10-26 07:29:05 +02:00