0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

18569 Commits

Author SHA1 Message Date
Yegappan Lakshmanan
f3b68d4759
patch 9.0.1959: Vim9: methods parameters and types are covariant
Problem:  Vim9: methods parameters and types are covariant
Solution: Support contra-variant type check for object method arguments
          (similar to Dart).

closes: #12965
closes: #13221

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1959
2023-09-29 22:50:02 +02:00
Yee Cheng Chin
900894b09a
patch 9.0.1958: cannot complete option values
Problem:  cannot complete option values
Solution: Add completion functions for several options

Add cmdline tab-completion for setting string options

Add tab-completion for setting string options on the cmdline using
`:set=` (along with `:set+=` and `:set-=`).

The existing tab completion for setting options currently only works
when nothing is typed yet, and it only fills in with the existing value,
e.g. when the user does `:set diffopt=<Tab>` it will be completed to
`set diffopt=internal,filler,closeoff` and nothing else. This isn't too
useful as a user usually wants auto-complete to suggest all the possible
values, such as 'iblank', or 'algorithm:patience'.

For set= and set+=, this adds a new optional callback function for each
option that can be invoked when doing completion. This allows for each
option to have control over how completion works. For example, in
'diffopt', it will suggest the default enumeration, but if `algorithm:`
is selected, it will further suggest different algorithm types like
'meyers' and 'patience'. When using set=, the existing option value will
be filled in as the first choice to preserve the existing behavior. When
using set+= this won't happen as it doesn't make sense.

For flag list options (e.g. 'mouse' and 'guioptions'), completion will
take into account existing typed values (and in the case of set+=, the
existing option value) to make sure it doesn't suggest duplicates.

For set-=, there is a new `ExpandSettingSubtract` function which will
handle flag list and comma-separated options smartly, by only suggesting
values that currently exist in the option.

Note that Vim has some existing code that adds special handling for
'filetype', 'syntax', and misc dir options like 'backupdir'. This change
preserves them as they already work, instead of converting to the new
callback API for each option.

closes: #13182

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
v9.0.1958
2023-09-29 20:42:32 +02:00
Gregory Anders
3695d0e41b
patch 9.0.1957: termcap options should change when setting keyprotocol
Problem:  termcap options should change on keyprotocol setting
Solution: Apply termcap entries when 'keyprotocol' changes

When the 'keyprotocol' option was set after startup (including in a
user's .vimrc) the termcap entries associated with the matching protocol
were not applied. Thus, setting the option has no affect.

When 'keyprotocol' is changed it should also update the termcap entries.

closes: #13211

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gregory Anders <greg@gpanders.com>
v9.0.1957
2023-09-29 20:17:20 +02:00
zeertzjq
28a23602e8
patch 9.0.1956: Custom completion skips orig cmdline if it invokes glob()
Problem:  Custom cmdline completion skips original cmdline when pressing
          Ctrl-P at first match if completion function invokes glob().
Solution: Move orig_save into struct expand_T.

closes: #13216

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1956
2023-09-29 19:58:35 +02:00
Ernie Rael
ee865f37ac
patch 9.0.1955: Vim9: lockvar issues with objects/classes
Problem:  Vim9: lockvar issues with objects/classes
Solution: fix `get_lhs()` object/class access and avoid `SEGV`,
          make error messages more accurate.

- `get_lval()` detects/returns object/class access
- `compile_lock_unlock()` generate code for bare static and obj_arg access
- `do_lock_var()` check lval for `ll_object`/`ll_class` and fail if so.

Details:
- Add `ll_object`/`ll_class`/`ll_oi` to `lval_T`.
- Add `lockunlock_T` to `isn_T` for `is_arg` to specify handling of `lval_root` in `get_lval()`.
- In `get_lval()`, fill in `ll_object`/`ll_class`/`ll_oi` as needed; when no `[idx] or .key`, check lval_root on the way out.
- In `do_lock_var()` check for `ll_object`/`ll_class`; also bullet proof ll_dict case
  and give `Dictionay required` if problem. (not needed to avoid lockvar crash anymore)
- In `compile_lock_unlock()` compile for the class variable and func arg cases.

closes: #13174

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
v9.0.1955
2023-09-29 19:53:55 +02:00
Ken Takata
112431f217
patch 9.0.1954: CI: change netrw label in labeller bot
Problem:  CI: change netrw label in labeller bot
Solution: Rename it to 'plugin-netrw'

closes: #13217

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1954
2023-09-29 19:48:09 +02:00
Ken Takata
789b8854d2
patch 9.0.1953: Misplaced comment in errors.h
Problem:  Misplaced comment in errors.h
Solution: Move it up

closes: #13218

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1953
2023-09-29 19:45:42 +02:00
Yegappan Lakshmanan
5a05d374d3
patch 9.0.1952: Vim9: unused static field
Problem:  Vim9: unused static field
Solution: remove it and simplify code

closes: #13220

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1952
2023-09-29 19:44:25 +02:00
Christian Brabandt
02902b547b
runtime(doc): text-objects: document how escaped delimiters are handled
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-29 00:10:04 +02:00
Yegappan Lakshmanan
b90e3bc491
patch 9.0.1951: Vim9: hard to debug vim9_class errors from CI
Problem:  Vim9: hard to debug vim9_class errors from CI
Solution: Include the line number in assert_xxx() calls.  Include the
          entire error message in the tests.  Fix the indentation in the
          test file.  Add tags for new error codes.

closes: #13206

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1951
2023-09-28 23:16:35 +02:00
Yegappan Lakshmanan
413f83990f
patch 9.0.1950: Vim9: error codes spread out
Problem:  Vim9: error codes spread out
Solution: group them together and reserve 100
          more for future use

Reserve 100 error codes for future enhancements to the Vim9 class
support

closes: #13207

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1950
2023-09-28 22:46:37 +02:00
Yegappan Lakshmanan
f057aca1cc
patch 9.0.1949: Vim9: allows reserved keywords as members
Problem:  Vim9: allows reserved keywords as members
Solution: Disallow reserved keywords, disallow
          duplicate object and class variables

closes: #13209

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1949
2023-09-28 22:28:15 +02:00
h-east
db38552dcd
patch 9.0.1948: Vim9: object variable "this." should only be used in constructor
Problem:  Vim9: object variable "this." should only be used in
          constructor
Solution: Disallow to this in normal object methods (other than
          constructors)

closes: #13152
closes: #13212

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
v9.0.1948
2023-09-28 22:18:19 +02:00
Ken Takata
03ca4002c1
patch 9.0.1947: Bash Expansion test fails on Windows/MacOS
Problem:  Bash Expansion test fails on Windows/MacOS
Solution: Disable Test_glob_extended_bash for now

This test doesn't work on Windows even if bash can be executed, since
the globstar functionality has only been enabled in Unix builds of Vim
(Commit 9eb1ce531527a7177d16373b0f8689bbcd3d5f73, patch 9.0.1946).

closes: #13205

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1947
2023-09-28 21:59:58 +02:00
Christian Brabandt
e845b38dab
runtime(doc): regenerate xxd manpage
Commit f6fc255e8d9c46a0e51e (v9.0.1834) updated xxd.1 but the xxd.man
page wasn't re-generated. So let's just regenerate it now.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 23:33:39 +02:00
Christian Brabandt
9eb1ce5315
patch 9.0.1946: filename expansion using ** in bash may fail
Problem:  filename expansion using ** in bash may fail
Solution: Try to enable the globstar setting

Starting with bash 4.0 it supports extended globbing using the globstar
shell option. This makes matching recursively below a certain directory
using the ** pattern work as expected nowadays.  However, we need to
explicitly enable this using the 'shopt -s globstar' bash command.

So let's check the bash environment variable $BASH_VERSINFO (which is
supported since bash 3.0 and conditionally enable the globstar option,
if the major version is at least 4. For older bashs, this at least
shouldn't cause errors (unless one is using really ancient bash 2.X or
something).

closes: #13002
closes: #13144

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1946
2023-09-27 19:08:25 +02:00
Yegappan Lakshmanan
2dede3dbfa
patch 9.0.1945: Vim9: missing support for ro-vars in interface
Problem:  Vim9: missing support for ro-vars in interface
Solution: Support only read-only object variables in an interface,
          add additional checks when parsing class definitions.

closes: #13183
cloess: #13184
cloess: #13185.
closes: #13188

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1945
2023-09-27 19:02:01 +02:00
zeertzjq
5277cfaf8a
runtime(doc): mention mouse scrolling in scrollbind-quickadj (#13190)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 19:00:12 +02:00
Josef Litoš
54f70cf078
runtime(swayconfig): Update syntax file (#13192)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:58:15 +02:00
Josef Litoš
02774f99ce
runtime(i3config): update i3config syntax (#13191)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:57:24 +02:00
Jakson Alves de Aquino
3474594239
runtime(rmd) Update ftplugin and syntax files (#13193)
ftplugin/rmd.vim:

  - Set 'commentstring' dynamically according to code region.

syntax/rmd.vim:

  - Include syntax highlighting of fenced languages dynamically.
  - Add conceal char for line break.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:56:02 +02:00
Yegappan Lakshmanan
a76fbe6e00
patch 9.0.1944: Vim9: function instruction pointer invalidated
Problem:  Vim9: function instruction pointer invalidated
Solution: Use the funcref index instead of the instruction pointer

closes: #13178
closes: #13196

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1944
2023-09-27 18:53:10 +02:00
Ivan Pešić
91adcbdcc1
translation(sr): Update Serbian messages translation
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 18:48:42 +02:00
Philip H
f109bf93c9
patch 9.0.1943: CI not run with clang-17
Problem:  CI not run with clang-17
Solution: Update CI to use clang-17

closes: #12745

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
v9.0.1943
2023-09-25 21:05:00 +02:00
Yegappan Lakshmanan
c1946267f2
patch 9.0.1942: Vim9: execution stack invalidated with null object
Problem:  Vim9: execution stack invalidated with null object
Solution: Check for a null object before adjusting the execution stack

closes: #13186

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1942
2023-09-25 21:00:46 +02:00
Eisuke Kawashima
54e1f56cf2
runtime(sh): only invoke bash help in ftplugin if it has been detected to be bash (#13171)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-25 19:40:45 +01:00
Yegappan Lakshmanan
3aa114463f
patch 9.0.1941: Memory leak detected
Problem:  Memory leak detected (after 9.0.1928)
Solution: Free arg_objm in get_lambda_tv()

closes: #13181

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1941
2023-09-25 12:13:17 +02:00
Yegappan Lakshmanan
e1b95f5252
runtime(doc): Update help tags (#13180)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-25 08:19:48 +01:00
Christian Brabandt
ec8deb092c
patch 9.0.1940: wrong upstream version in libvterm README
Problem:  wrong upstream version in libvterm README
Solution: correct version to 839

related: #12746

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1940
2023-09-24 23:43:38 +02:00
Yegappan Lakshmanan
b80ae6cec3
patch 9.0.1939: still a problem when processing LSP RPC requests
Problem:  still a problem when processing LSP RPC requests
Solution: When processing async LSP RPC requests, compare sequence
          numbers only in response messages

A LSP request message can be sent to the language server either
synchronously (ch_evalexpr) or asynchronously (ch_sendexpr). In both
cases, when looking for response messages by using the sequence number,
LSP requests messages from the language server with the same sequence
number should not be used. Patch 9.0.1927 fixed this issue for
synchronous requests. This PR fixes the issue for asynchronous requests
and adds additional tests.

closes: #13158

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1939
2023-09-24 23:38:46 +02:00
Yegappan Lakshmanan
ceffca683b
runtime(todo): Update Vim9 class items (#13148)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:36:56 +02:00
Yegappan Lakshmanan
c3b315f496
runtime(doc): Vim9: Consistenly use class/object variable and class/object method in help (#13149)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:36:17 +02:00
zeertzjq
abc808112e
patch 9.0.1938: multispace wrong when scrolling horizontally
Problem:  multispace wrong when scrolling horizontally
Solution: Update position in "multispace" or "leadmultispace" also in
          skipped chars. Reorder conditions to be more consistent.

closes: #13145
closes: #13147

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1938
2023-09-24 23:32:18 +02:00
zeertzjq
46a0582ffa
patch 9.0.1937: missing test for mouse click + 'virtedit'
Problem:  missing test for mouse click + 'virtedit'
Solution: Add test for clicking after eol with 'virtualedit' and wrapped
          line

closes: #13157

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1937
2023-09-24 23:30:03 +02:00
Isao Sato
e6fca0e822
patch 9.0.1936: test: using wrong expected message in test_crypt
Problem:  test: using wrong expected message in test_crypt
Solution: make use of single quotes

closes: #13151

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Isao Sato <svardew@gmail.com>
v9.0.1936
2023-09-24 23:27:25 +02:00
RestorerZ
7fe8f43f49
patch 9.0.1935: Vim9: not consistent error messages
Problem:  Vim9: not consistent error messages
Solution: Make error messages more consistent. Use "variable" for
          (object/class) member

closes: #13155

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
v9.0.1935
2023-09-24 23:21:24 +02:00
zeertzjq
46bdae036a
patch 9.0.1934: :bwipe fails after switching window from aucmd_win.
Problem:  :bwipe fails after switching window from aucmd_win.
Solution: Decrement b_nwindows after switching back to aucmd_win.

closes: #13160

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1934
2023-09-24 23:17:14 +02:00
zeertzjq
edcba96c00
patch 9.0.1933: Can change the type of a v: variable using if_lua
Problem:  Can change the type of a v: variable using if_lua.
Solution: Add additional handling of v: variables like :let.

closes: #13161

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1933
2023-09-24 23:13:51 +02:00
Yegappan Lakshmanan
7398f367d5
patch 9.0.1932: Vim9: error when using null object constructor
Problem:  Vim9: error when using null object constructor
Solution: Check for a null object only when calling an object method

closes: #13154
closes: #13163

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1932
2023-09-24 23:09:10 +02:00
Dominique Pellé
960822a11f
runtime(doc): grammar fixes in doc (#13164)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:07:39 +02:00
Yegappan Lakshmanan
7c948644fb
runtime(doc): Update the version9.txt with a template for version 9.1 enhancements (#13165)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:07:03 +02:00
a5ob7r
790f9a890c
runtime(doc): Add a missing '<' to the help of strutf16len() (#13168)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 23:05:47 +02:00
Dominique Pellé
ca0ffc0d63
patch 9.0.1931: make test_compilers fails on ubuntu
Problem:  make test_compilers fails on ubuntu
Solution: set LC_ALL=C

fix: make test_compiler failed on xubuntu 22.04.3

Problem: 'make test_compiler' failed on Linux xubuntu 22.04.3 but
         succeeded on e.g. macOS. To reproduce:
```
$ ./configure --with-features=huge --enable-gui=no --enable-perlinterp=yes
$ make -j12
$ cd vim/src/testdir
$ make test_compiler
...snip...
Found errors in Test_compiler():
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 24: command did not fail: clist
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 30: Pattern '\\n \\d\\+ Xfoo.pl:3: Global symbol "$foo" requires explicit package name' does not match '\n19 Xfoo.pl:3: Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?)'
make: *** [Makefile:70: test_compiler] Error 1
```
Solution: set `LC_ALL` to "C" in `Test_compiler()`

closes: #13173

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
v9.0.1931
2023-09-24 22:57:41 +02:00
Remy Bos
8ffcb47a43
runtime(tutor): fix typo in tutor.nl (#13175)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24 22:54:30 +02:00
Dominique Pellé
4927bc7d27
patch 9.0.1930: compiler warnings with clang-17
Problem:  compiler warnings with clang-17
Solution: Fix function prototypes and function pointer

fix: clang compilation warnings with -Wstrict-prototypes

Change fixes this kind of compilation warnings with clang:
```
proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
   13 | int python3_version();
      |                    ^
      |                     void
```

closes: #13166

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
v9.0.1930
2023-09-24 16:16:06 +02:00
Dominique Pellé
99c3849a92
patch 9.0.1929: runtime tests fail with tiny vim
Problem:  runtime tests fail with tiny vim
Solution: check for tiny vim, run runtime tests in CI
          even for tiny version

closes: #13169
closes: #13170

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
v9.0.1929
2023-09-24 16:09:31 +02:00
h-east
b895b0fabc
patch 9.0.1928: Vim9: constructor type checking bug
Problem:  Vim9: constructor type checking bug
Solution: Fix class constructor regression

closes: #13102
closes: #13113

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
v9.0.1928
2023-09-24 15:46:31 +02:00
Christian Brabandt
ceee7a808c
patch 9.0.1927: patch 1916 (fixed terminal size) not optimal
Problem:  patch 1916 (fixed terminal size) not optimal
Solution: Add defines to make it easier changeable later

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1927
2023-09-21 16:57:42 +02:00
Ernie Rael
696270bcae
patch 9.0.1926: Vim9: not enough info in error message
Problem:  Vim9: not enough info in error message
Solution: Add class name, change member to variable, quote names

closes: #13136

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
v9.0.1926
2023-09-21 16:42:28 +02:00
Yee Cheng Chin
02c51b1dd8
patch 9.0.1925: if_python: still undefined behaviour with function pointer
Problem:  if_python: still undefined behaviour with function pointer
Solution: fix remaining problems

Fix remaining issues in the if_python code in casting incompatible
function pointers leading to Clang 17 giving runtime errors during
UBSAN.

closes: #13140

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
v9.0.1925
2023-09-21 16:40:12 +02:00