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

18677 Commits

Author SHA1 Message Date
Yegappan Lakshmanan
1087b8c29a
patch 9.0.2000: Vim9: use-after-free in deep call stack
Problem:  Vim9: use-after-free in deep call stack
Solution: Get the objct pointer from execution stack

closes: #13296

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.2000
2023-10-07 22:03:18 +02:00
dkearns
2a281ccca0
runtime(sh): Update ftplugin (#13213)
Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:59:42 +02:00
Ernie Rael
e6c9aa5e6a
patch 9.0.1999: Vim9: some error messages can be improved
Problem:  Vim9: some error messages can be improved
Solution: Mention the defining class for variable access error message

closes: #13272

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: Ernie Rael <errael@raelity.com>
v9.0.1999
2023-10-06 19:55:52 +02:00
tristhaus
85f4521808
patch 9.0.1998: xxd: cannot reverse a bit dump
Problem:  xxd: cannot reverse a bit dump
Solution: implement reversing the bit dump using -b -r

closes: #13286

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: tristhaus <tristhaus@yahoo.de>
v9.0.1998
2023-10-06 19:51:13 +02:00
dundargoc
580c1fcb4a
patch 9.0.1997: Some unused code in move.c and string.c
Problem:  Some unused code in move.c and string.c
Solution: Remove it

closes: #13288

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
v9.0.1997
2023-10-06 19:41:14 +02:00
zeertzjq
27e12c7669
runtime(doc): remove E1520 tag (#13289)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:34:04 +02:00
Ken Takata
fa145f2009
patch 9.0.1996: Cannot build with python312
Problem:  Cannot build with python312
Solution: Define wrapper types and functions for python 3.12

Py_SIZE() uses PyLong_Type and PyBool_Type starting from Python 3.12.
We need to define our own Py_SIZE() to replace Py{Bool,Long}_Type with
py3_Py{Bool,Long}_Type.
We also need to redefine PyTuple_GET_SIZE() and PyList_GET_SIZE(), because
they use Py_SIZE().

closes: #13281
closes: #13290

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1996
2023-10-06 19:27:13 +02:00
Yegappan Lakshmanan
26e8f7b0ab
runtime(doc): Update vim9class help (#13292)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-06 19:24:10 +02:00
zeertzjq
a991ce9c08
patch 9.0.1995: Invalid memory access with empty 'foldexpr'
Problem:  Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.

closes: #13293

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1995
2023-10-06 19:18:12 +02:00
RestorerZ
ac9c6d5c78
patch 9.0.1994: inconsistent feature description
Problem:  inconsistent feature description
Solution: delete old mentioned feature sets small and big

The may however still be mentioned for historical reasons. e.g. The
last Amiga built version is for Vim6.2 and is still a big version.

closes: #13273

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: RestorerZ <restorer@mail2k.ru>
v9.0.1994
2023-10-05 22:25:12 +02:00
Christian Brabandt
9960ebcace
patch 9.0.1993: warning about unused function definition
Problem:  warning about unused function definition
Solution: add ifdefs

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1993
2023-10-05 22:17:09 +02:00
Christian Brabandt
20d161ace3
patch 9.0.1992: [security] segfault in exmode
Problem:  segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1992
2023-10-05 22:10:10 +02:00
Yee Cheng Chin
290b887e8c
patch 9.0.1991: no cmdline completion for setting the font
Problem:  no cmdline completion for setting the font
Solution: enable it on Win32 and GTK builds

Add guifont cmdline completion (for Windows and GTK)

For Windows, auto-complete will only suggest monospace fonts as that's
the only types allowed. Will also suggest font options after the colon,
including suggesting the current font size for convenience, and misc
charset and quality options like `cANSI` and `qCLEARTYPE`.

For GTK, auto-complete will suggest only monospace fonts for `guifont`
but will include all fonts for `guifontwide`. The completion code
doesn't currently suggest the current font size, as the GTK guifont
format does not have a clear delimiter (':' for other platforms).

closes: #13264

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
v9.0.1991
2023-10-05 20:54:21 +02:00
Christ van Willegen
ea746f9e86
patch 9.0.1990: strange error number
Problem:  strange error number
Solution: change error number,
          add doc tag for E1507

closes: #13270

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
v9.0.1990
2023-10-05 20:48:36 +02:00
KSR-Yasuda
0e95841004
runtime(netrw): diff (df) may open the wrong window (#13275)
closes: #11359

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:37:15 +02:00
KSR-Yasuda
f449825ae2
runtime(netrw): Update .netrwbook immediately on bookmark change (#13276)
closes: #9738

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:34:17 +02:00
K.Takata
9b259f520e
translation(it): revert permission changes for xxd manpages again (#13277)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:30:08 +02:00
Ernie Rael
d615a3122a
patch 9.0.1989: Vim9: double error message given
Problem:  Vim9: double error message given
Solution: Only give second error message, if ther
          wasn't one given before

closes: #13278

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
v9.0.1989
2023-10-05 20:28:16 +02:00
Yegappan Lakshmanan
d2f4800099
patch 9.0.1988: Vim9: potential use-after-free for class members
Problem:  Vim9: potential use-after-free for class members
Solution: Use the class-related grow array for storing the
          member type instead of using a temporary type
          list grow array

Use the type list grow array associated with the class than using a
temporary type list grow array to allocate the class member type.

For simple types, a predefined type is used. For complex types, the type
is dynamically allocated from a grow array. For class variables, the
type grow array in the class should be used. So that the lifetime of the
type is same as the lifetime of the class.

closes: #13279

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1988
2023-10-05 20:24:18 +02:00
Ken Takata
da5da654de
patch 9.0.1987: win32: font-size calculation can be improved
Problem:  win32: font-size calculation can be improved
Solution: calculate font size before the window size

Support calculating the new size even if a bitmap font is used.
Calculate the new font size before actually change the Window size.

closes: #13280
related: #11812, #13252

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1987
2023-10-05 20:20:58 +02:00
Ivan Pešić
c661e11e9c
translation(sr): Update Serbian messages translation (#13282)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:17:28 +02:00
Yegappan Lakshmanan
b5a0719cb7
patch 9.0.1986: Vim9: accepting type-annotations
Problem:  Vim9: accepting type-annotations
Solution: Reject type annotations outside of declarations.

closes: #13267
closes: #13283

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1986
2023-10-05 20:16:06 +02:00
dundargoc
b6d01f131c
runtime(just): Correct filetype detection pattern and style (#13284)
See https://github.com/vim/vim/pull/13271#discussion_r1347279686 and
https://github.com/NoahTheDuke/vim-just/blob/main/ftdetect/just.vim.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-05 20:11:55 +02:00
dundargoc
9a00e7c7cf
patch 9.0.1985: CI: codecov is intrusive
Problem:  CI: codecov is intrusive
Solution: disable codecov comments

The codecov report is incredibly intrusive, and getting a notification
for every PR to vim that codecov codecoved is annoying. If anyone is
interested in the report the information is readily available by
clicking on the job.

closes: #13285

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
v9.0.1985
2023-10-05 20:07:11 +02:00
Christian Brabandt
85ff0c1912
patch 9.0.1984: CI: Test_open_delay*() fails on FreeBSD 14
Problem:  CI: Test_open_delay*() fails on FreeBSD 14
Solution: Skip it on BSD

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1984
2023-10-04 21:58:24 +02:00
zeertzjq
8e5f26ec6a
patch 9.0.1983: scrolling inactive window not possible with cursorbind
Problem:  Scrolling non-current window using mouse is inconsistent
          depending on 'scrollbind'/'scrolloff' and different from GUI
          vertical scrollbar when 'cursorbind' is set.
Solution: Don't move cursor in non-current windows for 'cursorbind' if
          cursor in the current window didn't move.

closes: #13219
closes: #13210

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1983
2023-10-04 21:45:33 +02:00
yasuda
4dbb2669e9
runtime(netrw): error when trying to :bd unloaded buffer
closes: #13215
closes: #13082

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 20:52:44 +02:00
Ernie Rael
64885645e7
patch 9.0.1982: vim9: clean up from v9.0.1955
Problem:  vim9: clean up from v9.0.1955
Solution: Fix a few remaining issues, improve error message

- Use `cl_exec`, the executing class, to check permissions in `get_lval()`.
- Handle lockvar of script variable from class.
- Add 'in class "Xxx"' to e_cannot_access_private_variable_str.

closes: #13222

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
v9.0.1982
2023-10-04 20:16:22 +02:00
zeertzjq
0583491277
patch 9.0.1981: not being able to scroll up in diff mode
Problem:  Cannot scroll up in diff mode with many filler lines and zero
          'scrolloff'.
Solution: Invalidate w_cline_row before calling comp_botline().

closes: #13256

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1981
2023-10-04 20:12:37 +02:00
Ken Takata
119fdd9293
patch 9.0.1980: win32: issues with stable python ABI
Problem:  win32: issues with stable python ABI
Solution: if_python3,win32: Fix Python3 stable ABI

There were some issues in current stable ABI implementation on Windows:
* Python DLL name should be `python3.dll` instead of `python311.dll` and
  so on. (See: https://docs.python.org/3/c-api/stable.html)
* Some non-stable API functions were used:
  - `_PyObject_NextNotImplemented`
  - `PyStdPrinter_Type`
* `reset_stdin()` and `hook_py_exit()` didn't work with `python3.dll`.
  `python3.dll` is a special type of DLL called forwarder DLL.
  It just forwards the functions to other DLL (e.g. `python311.dll`).
  There were two issues regarding these functions:
  - `python3.dll` doesn't have import tables. This caused a crash in
    `get_imported_func_info()`. Add a check whether the specified DLL
    has an import table.
  - `reset_stdin()` and `hook_py_exit()` should be applied to the
    forwarded DLL (e.g. `python311.dll`), not to `python3.dll`.
    Check the export directory of `python3.dll` to find the forwarded
    DLL and apply the functions to it.

closes: #13260

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1980
2023-10-04 20:05:05 +02:00
zeertzjq
317468aace
patch 9.0.1979: Cirrus CI disabled
Problem:  Cirrus CI disabled
Solution: re-enable Cirrus CI

Ref patch 9.0.1912:

> Perhaps at the beginning of the next month we can revisit and enable
> just a build without testing it.  Hopefully this is won't take too
> many credits and we can at least verify that building works.

Actually enabling testing should be fine. In the last month there were
three Cirrus CI jobs and credits ran out on Sep 15, but now there is
only one Cirrus CI job, so credits shouldn't run out.

closes: #13261

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1979
2023-10-04 19:57:35 +02:00
dundargoc
3d90f71b76
patch 9.0.1978: No filetype detection for just files
Problem:  No filetype detection for just files
Solution: Detect just files (*.just, justfile, etc)

closes: #13271

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: dundargoc <gocdundar@gmail.com>
v9.0.1978
2023-10-04 19:52:54 +02:00
Yegappan Lakshmanan
fe7b20a1a3
patch 9.0.1977: Vim9: object members can change type
Problem:  Vim9: object members can change type
Solution: Check type during assignment to object/class var

closes: #13127
closes: #13262

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1977
2023-10-04 19:47:52 +02:00
Antonio Giovanni Colombo
b9a974df9e
translation(it): update translation of xxd manpage
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-04 18:30:25 +02:00
Christian Brabandt
b74ebfc6bf
runtime(doc): update xxd manpage and mention $NO_COLOR env
also regenerate the xxd.man document page.

fixes: #13257

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 16:58:55 +02:00
Aliaksei Budavei
b043ff34c1
runtime(doc): fix two typos in vim9.txt and options.txt (#13258)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 16:39:53 +02:00
zeertzjq
2dfc22908e
runtime(doc): remove E1507 help tag, which is no longer used (#13254)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-03 08:12:56 +02:00
Christian Brabandt
3f168ec8ae
patch 9.0.1976: style: space before tab in optionstr.c
Problem:  style: space before tab in optionstr.c
Solution: remove the space

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1976
2023-10-02 23:21:11 +02:00
Gene C
993b17569b
patch 9.0.1975: xattr: permission-denied errors on write
Problem:  xattr: permission-denied errors on write
Solution: ignore those errors

closes: #13246

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gene C <arch@sapience.com>
v9.0.1975
2023-10-02 22:44:12 +02:00
Restorer
12a0d999b1
translation(ru): Update Russian message translation to Vim 9.0.1968 (#13239)
* Updated to Vim 9.0.1968. Several refinements and corrections
* typo fixed

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:53:27 +02:00
Yegappan Lakshmanan
cd39b69b02
runtime(doc): add missing error numbers in the help. (#13241)
closes: #13240

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:50:45 +02:00
dundargoc
20f48d5b2d
runtime(doc): mention how to disable folding in diff mode (#13242)
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:49:23 +02:00
h_east
ba77bbb5c7
runtime(doc): fix typos.
* Fix typo in document (Related: #12516)
* Fix E1363 duplication
* Fix one more typo.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02 21:47:13 +02:00
Yegappan Lakshmanan
b32064fedb
patch 9.0.1974: vim9: using contra-variant type-checks
Problem:  vim9: using contra-variant type-checks (after v9.0.1959)
Solution: Use invariant type checking instead

closes: #13248

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
v9.0.1974
2023-10-02 21:43:58 +02:00
Yee Cheng Chin
6d11347260
patch 9.0.1973: Clean up cmdline option completion code
Problem:  Clean up cmdline option completion code
Solution: Fix various minor problems

- Fix manual array size calculations to just use `ARRAY_LENGTH()`.
- Fix unintentional typo in comments due to copy-paste error.
- Fix assert_equal() usages to pass the expected value to first
  parameter instead of 2nd one to avoid confusion.
- Fix signed vs unsigned warnings
- Correct misplaced comments about set_op_T and set_prefix_T
  and fix a typo in another comment

closes: #13249
closes: #13237

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
v9.0.1973
2023-10-02 21:38:39 +02:00
Ken Takata
4a1ad55564
patch 9.0.1972: win32: missing '**' expansion test
Problem:  win32: missing '**' expansion test (after v9.0.1947)
Solution: Add test for MS-Windows

win32: Add "**" test

Vim supports "**" on MS-Windows. However, it is not tested by
`Test_glob_extended_bash`.

Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion.
So, I added as a separate test.

related: #13205
closes: #13250

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1972
2023-10-02 21:33:42 +02:00
Yee Cheng Chin
f59cbefd0a
patch 9.0.1971: macOS: FEAT_SOUND guard too restrictive
Problem:  macOS: FEAT_SOUND guard too restrictive
Solution: check for older macOS support properly

Fix macOS FEAT_SOUND guards to be less restrictive

This allows +sound to work on older macOS platforms again. The +sound
implementation uses APIs available in 10.6, but the code itself uses
generics with type parameters which was only added in Xcode 7 / clang 7,
which was released for macOS 10.11. This means as long as Vim is
compiled under 10.11+, and using a deployment target >= 10.6, the
feature will work.

closes: #13251

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
v9.0.1971
2023-10-02 21:28:50 +02:00
Ken Takata
7086b3e76a
patch 9.0.1970: win32: high-dpi support can be improved
Problem:  win32: high-dpi support can be improved
Solution: implement WM_GETDPISCALEDSIZE

win32: Better support of Per-Monitor V2 High DPI

Implement WM_GETDPISCALEDSIZE.
It is not so easy to calculate the new size without actually changing
the size. So, this returns an approximate size.

This doesn't work well when a bitmap font (e.g. FixedSys) is selected,
but I think this is acceptable.

closes: #11812
closes: #13252

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
v9.0.1970
2023-10-02 21:26:03 +02:00
Christian Brabandt
3bd7fa12e1
patch 9.0.1969: [security] buffer-overflow in trunc_string()
Problem:  buffer-overflow in trunc_string()
Solution: Add NULL at end of buffer

Currently trunc_string() assumes that when the string is too long,
buf[e-1] will always be writeable. But that assumption may not always be
true. The condition currently looks like this

    else if (e + 3 < buflen)
    [...]
    else
    {
	// can't fit in the "...", just truncate it
	buf[e - 1] = NUL;
    }

but this means, we may run into the last else clause with e still being
larger than buflen. So a buffer overflow occurs.

So instead of using `buf[e - 1]`, let's just always
truncate at `buf[buflen - 1]` which should always be writable.

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.0.1969
2023-10-02 20:59:47 +02:00
Yee Cheng Chin
6ee7b521fa
patch 9.0.1968: cmdline completion should consider key option
Problem:  cmdline completion should consider key option
Solution: Disable cmdline completion for key option, slightly
          refactor how P_NO_CMD_EXPAND is handled

Harden crypto 'key' option: turn off cmdline completion, disable set-=

"set-=" can be used maliciously with a crypto key, as it allows an
attacker (who either has access to the computer or a plugin author) to
guess a substring by observing the modified state. Simply turn off
set+=/-=/^= for this option as there is no good reason for them to be
used.

Update docs to make that clear as well.

Also, don't allow cmdline completion for 'key' as it just shows *****
which is not useful and confusing to the user what it means (if the user
accidentally hits enter they will have replaced their key with "*****"
instead).

Move logic to better location, don't use above 32-bit for flags

Move P_NO_CMD_EXPAND to use the unused 0x20 instead of going above
32-bits, as currently the flags parameter is only 32-bits on some
systems. Left a comment to warn that future additions will need to
change how the flags work either by making it 64-bit or split into two
member vars.

Also, move the logic for detecting P_NO_CMD_EXPAND earlier so it's not
up to each handler to decide, and you won't see the temporary "..." that
Vim shows while waiting for completion handler to complete.

closes: #13224

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
v9.0.1968
2023-10-01 09:19:18 +02:00