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

16194 Commits

Author SHA1 Message Date
K.Takata
233f956bd4
patch 9.0.1861: xxd: issue when -R is specified several times
Problem:  xxd: issue when -R is specified several times
Solution: Fix command line parsing

See: https://github.com/vim/vim/pull/12986#issuecomment-1704375892

closes: #13021

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
Co-authored-by: Aapo Rantalainen <aapo.rantalainen@gmail.com>
2023-09-04 07:46:59 +02:00
Christian Brabandt
f44cbe96fa
patch 9.0.1860: CI: test_crash1() is flaky
Problem:  CI: test_crash1() is flaky
Solution: Wait a bit longer

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-04 07:42:27 +02:00
Christian Brabandt
6e60cf444a
patch 9.0.1859: heap-use-after-free in bt_normal()
Problem:  heap-use-after-free in bt_normal()
Solution: check that buffer is still valid

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 21:43:46 +02:00
Christian Brabandt
ee9166eb3b
patch 9.0.1858: [security] heap use after free in ins_compl_get_exp()
Problem:  heap use after free in ins_compl_get_exp()
Solution: validate buffer before accessing it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 21:24:33 +02:00
Christian Brabandt
fc68299d43
patch 9.0.1857: [security] heap-use-after-free in is_qf_win()
Problem:  heap-use-after-free in is_qf_win()
Solution: Check buffer is valid before accessing it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 20:20:52 +02:00
Christ van Willegen
aa90d4f031
patch 9.0.1856: issues with formatting positional arguments
Problem:  issues with formatting positional arguments
Solution: fix them, add tests and documentation

closes: #12140
closes: #12985

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Tentatively fix message_test. Check NULL ptr.
2023-09-03 17:22:37 +02:00
h-east
71ebf3baca
patch 9.0.1855: mode() doesn't indicate command line for terminal
Problem:  mode() doesn't indicate command line for terminal
Solution: make it return 'ct' for command-line from Terminal mode

closes: #6265
closes: #13017
closes: #13018

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
2023-09-03 17:12:55 +02:00
Christian Brabandt
db510ca805
patch 9.0.1854: test_crash1() fails on CI
Problem:  test_crash1() fails on CI
Solution: don't run Screendump test, verify that it doesn't crash
          by running it through a shell command line, testing
          the exit value and concatenating success cmd using '&&'

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:30:09 +02:00
Christian Brabandt
15cbaae313
patch 9.0.1853: CI error on different signedness in regexp.c
Problem:  CI error on different signedness in regexp.c
          (after patch 9.0.1848)
Solution: Cast strlen() call to int

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 22:08:43 +02:00
pierreganty
d69aecf141
patch 9.0.1852: i_CTRL-O does not reset Select Mode
Problem:  i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode

closes: #13001
closes: #12115

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:59:52 +02:00
zeertzjq
3c3cf1d689
patch 9.0.1851: breakindent missing by virt text
Problem:  Virtual text at a column causes 'breakindent' and 'showbreak'
          to be missing (after patch 9.0.1124).
Solution: Add check for "tp_col" in another place where TP_FLAG_WRAP is
          checked.

closes: #12769
closes: #13008
closes: #13010

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-02 21:55:00 +02:00
LemonBoy
32f3461465
patch 9.0.1850: Vim9: wrong line number where options set
Problem:  Vim9: wrong line number where options set
Solution: Set source line number earlier

closes: #13006
closes: #13013

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-09-02 21:52:05 +02:00
Christian Brabandt
c8a034210f
patch 9.0.1849: CI error on different signedness in ex_cmds.c
Problem:  CI error on different signedness
Solution: cast unsigned to int

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:50:10 +02:00
Christian Brabandt
ced2c7394a
patch 9.0.1848: [security] buffer-overflow in vim_regsub_both()
Problem:  buffer-overflow in vim_regsub_both()
Solution: Check remaining space

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 21:37:04 +02:00
Christian Brabandt
889f6af371
patch 9.0.1847: [security] potential oob write in do_addsub()
Problem:  potential oob write in do_addsub()
Solution: don't overflow buf2, check size in for loop()

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:43:33 +02:00
Christian Brabandt
4c6fe2e2ea
patch 9.0.1846: [security] crash in fullcommand
Problem:  crash in fullcommand
Solution: Check for typeval correctly

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:30:03 +02:00
Christian Brabandt
e0bfb7d301
patch 9.0.1845: xxd: Test_xxd_color start failing
Problem:  xxd: Test_xxd_color start failing
Solution: Revert changes to dump file

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 19:13:45 +02:00
Yee Cheng Chin
8b20203141
patch 9.0.1844: doc helptags may not be up to date
Problem:  doc helptags may not be up to date
Solution: Add CI jobs to verify helptags are updated

Also, re-generate the tags file with updated list so it will pass CI.

closes: #13012

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 16:04:50 +02:00
Christian Brabandt
b2422f7540
patch 9.0.1843: xxd color test flaky
Problem:  xxd color test flaky
Solution: Filter unneeded lines

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 16:01:18 +02:00
Ernie Rael
21d3212361
patch 9.0.1842: Need more accurate profiling
Problem:  Need more accurate profiling
Solution: Improve profiling results

closes: #12192

Reduce overhead of checking if a function should be profiled,
by caching results of checking (which are done with regexp).

Cache uf_hash for uf_name in ufunc_T.

Cache cleared when regexps are changed.

Break at first match for has_profiling lookup.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-02 15:09:18 +02:00
Christian Brabandt
9d093fd056
patch 9.0.1841: style: trailing whitespace in ex_cmds.c
Problem:  style: trailing whitespace in ex_cmds.c
Solution: remove it

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 15:08:09 +02:00
Christian Brabandt
e1dc9a6275
patch 9.0.1840: [security] use-after-free in do_ecmd
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-02 14:44:47 +02:00
Christian Brabandt
738ce77aa9
patch 9.0.1839: No Makefile rule to build cscope database
Problem:  No Makefile rule to build cscope database
Solution: Add rule

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-01 22:38:26 +02:00
Yegappan Lakshmanan
3775f777a6
patch 9.0.1838: Vim9: Cannot modify class member vars from def function
Problem:  Vim9: Cannot modify class member vars from def function
Solution: Add support for modifying class member variables from a def
          function

closes: #12995

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-09-01 22:05:45 +02:00
Ernie Rael
456ae556b4
patch 9.0.1837: Vim9: class_member_type() can be optimized
Problem:  Vim9: class_member_type() can be optimized
Solution: class_member_type() provides more information;
          safe an additional alloc()/free()

closes: #12989

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-01 18:57:09 +02:00
zeertzjq
ce53e3ea55
patch 9.0.1836: display wrong with virttext, linebreak and breakindent
Problem:  Wrong display with "above" virtual text and 'linebreak' or
          'breakindent' and 'showbreak'.
Solution: Exclude size of "above" virtual text when calculating them.

closes: #13000

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-01 18:49:30 +02:00
Yee Cheng Chin
7a9d1aa878
patch 9.0.1835: Perl interface has problems with load PL_current_context
Problem:  Perl interface has problems with load PL_current_context
Solution: Fix Perl interface to load PL_current_context from library

In #12914, in order to fix an issue with Perl 5.36 dynamic builds, (that
version introduced a thread-local `PL_current_context`), the file added
the variable manually so we can satisfy the linker. However, the
variable is a different one from the one in the library, so there could
be unpredictable behavior. Instead, just use `dlsym` to load the context
from the library. The fact that it's thread-local doesn't matter too
much to us because Vim's interface is single-threaded so it will work
properly.

closes: #12996

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-01 18:46:17 +02:00
K.Takata
f6fc255e8d
patch 9.0.1834: Some problems with xxd coloring
Problem:  Some problems with xxd coloring
Solution: Fix the following problems:

* Support colored output on Windows.
  SetConsoleMode() is required to enable ANSI color sequences.
* Support "NO_COLOR" environment variable.
  If "NO_COLOR" is defined and not empty, colored output should be
  disabled.
  See https://no-color.org/
* "-R" should only accept "always", "never" or "auto" as the parameter.
* Adjust help and documentation. "-R" cannot omit the parameter. Remove
  surrounding brackets.

Related #12131
closes: #12997
closes: #12991
closes: #12986

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: K.Takata <kentkt@csc.jp>
2023-09-01 18:41:04 +02:00
Christian Brabandt
816fbcc262
patch 9.0.1833: [security] runtime file fixes
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 23:52:30 +02:00
Christian Brabandt
0ffa97e8fa
patch 9.0.1832: xxd: reporting wrong version
Problem:  xxd: reporting wrong version (after 9.0.1827)
Solution: Update version string

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 21:04:52 +02:00
Gianmaria Bajo
6ad4a60a97
patch 9.0.1831: Vim9: failing null test
Problem:  Vim9: failing null test
Solution: Use required public keyword

closes: #12982

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-31 20:55:35 +02:00
Gianmaria Bajo
d7085a0635
patch 9.0.1830: Vim9: crash when accessing a null object
Problem:  Vim9: crash when accessing a null object
Solution: Check accessing a NULL object in def function

An object is NULL when the variable is declared, but the constructor
isn't called. Accessing/setting a member on the object crashed Vim.

Note: this happens inside def functions, at script level things work
differently. Accessing a NULL object member results in E1360
(correctly), while setting a value on it results in E1012 (type
mismatch) so there's still something to fix.

closes: #12973

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-31 18:15:26 +02:00
Yegappan Lakshmanan
eb91e24d5e
patch 9.0.1829: Vim9 missing access-checks for private vars
Problem:  Vim9 missing access-checks for private vars
Solution: Use the proper check for private/readonly variable.  Access
          level for a member cannot be changed in a class implementing an
          interface.  Update the code indentation

closes: #12978

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-31 18:10:46 +02:00
zeertzjq
ac2d8815ae
patch 9.0.1828: cursor wrong with virt text before double-width char
Problem:  Wrong cursor position with virtual text before double-width
          char at window edge.
Solution: Check for double-width char before adding virtual text size.

closes: #12977

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-31 18:07:48 +02:00
Aapo Rantalainen
e2528ae111
patch 9.0.1827: xxd: no color support
Problem:  xxd: no color support
Solution: Add color support using xxd -R

Add some basic color support for xxd

The hex-value and value are both colored with the same color depending
on the hex-value, e.g.:

    0x00 = white
    0xff = blue
    printable = green
    non-printable = red
    tabs and linebreaks = yellow

Each character needs 11 more bytes to contain color. (Same color in a
row could contain only one overhead but the logic how xxd creates colums
must be then changed.) Size of colored output is increased by factor of
~6. Also grepping the output will break when colors is used.

Flag for color is "-R", because less uses "-R".

Color uses parameters auto,always,never same as less and grep (among
others).

E.g.

xxd -R always $FILE | less -R

Add some screen-tests (that currently on work on linux) to verify the
feature works as expected.

closes: #12131

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Aapo Rantalainen <aapo.rantalainen@gmail.com>
2023-08-31 17:58:13 +02:00
zeertzjq
1bed993c01
patch 9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
Problem:  keytrans() doesn't translate recorded key typed in a GUI
Solution: Handle CSI like K_SPECIAL, like in mb_unescape()

closes: #12964
closes: #12966

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-30 19:38:24 +02:00
zeertzjq
6e55e85f92
patch 9.0.1825: wrong cursor position with virt text and 'linebreak'
Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: #12956

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-30 16:55:09 +02:00
Yegappan Lakshmanan
5bbcfbc4a2
patch 9.0.1824: Vim9: private members may be modifiable
Problem:  Vim9: private members may be modifiable
Solution: prevent modification for def function

closes: #12963

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-30 16:40:33 +02:00
Illia Bobyr
a96d544bc3
patch 9.0.1823: Autoconf 2.69 too old
Problem:  Autoconf 2.69 too old
Solution: Migrate to Autoconf 2.71

Autoconf 2.69 is almost 10 years old.  And 2.71 is also a few years old
as well.  Should be pretty well tested by now.  It brings a lot of
improvements and there seems to be an ongoing work on autoconf 2.72
already.

This change just addresses two minor changes `autoupdate` suggested, and
then `src/auto/configure` is regenerated by running

  cd src
  make AUTOCONF=autoconf2.71 autoconf

closes: #12958

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-30 16:30:15 +02:00
Yegappan Lakshmanan
e3b6c78ddc
patch 9.0.1822: Vim9: no check for duplicate members in extended classes
Problem:  Vim9: no check for duplicate members in extended classes
Solution: Check for duplicate members in extended classes.
          Fix memory leak.

closes: #12948

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-29 22:34:36 +02:00
Gianmaria Bajo
4b9777a1df
patch 9.0.1821: Vim9 constructors are always static
Problem:  Vim9 constructors are always static
Solution: make the "static" keyword an error

closes: #12945

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
2023-08-29 22:29:03 +02:00
Doug Kearns
e06afb7860
patch 9.0.1820: Rexx files may not be recognised
Problem:  Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
	  files

closes: #12951

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-29 22:21:35 +02:00
ichizok
3e1e63de18
patch 9.0.1819: Github CI too complex
Problem:  Github CI too complex
Solution: CI: Tidy up matrix

Perform the following changes to the CI configuration:
 - Move common CFLAGS to ci/config.mk.sed
 - Change extra key to array to able to assign no or multiple values
   explicitly
 - Modify luaver variable handling
   - lib${{ matrix.luaver }}-dev ${{ matrix.luaver }} are confusing
     as package names
 - Deduplicate CONFOPT setting

closes: #12955

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-08-29 22:20:21 +02:00
Christian Brabandt
55460da26c
patch 9.0.1818: dynamically linking perl is broken
Problem:  dynamically linking perl is broken
Solution: Fix all issues

This is a combination of several commits:

1) Fix if_perl.xs not being able to build on all versions of Perl (5.30)

This fixes the dynamic builds of Perl interface. The Perl interface file
previously had to manually copy and paste misc inline functions verbatim
from the Perl headers, because we defined `PERL_NO_INLINE_FUNCTIONS`
which prevents us form getting some function definitions. The original
reason we defined it was because those inline functions would reference
Perl functions that would cause linkage errors.

This is a little fragile as every time a new version of Perl comes out,
we inevitably have to copy over new versions of inline functions to our
file, and it's also easy to miss updates to existing functions.

Instead, remove the `PERL_NO_INLINE_FUNCTIONS` define, remove the manual
copy-pasted inline functions. Simply add stub implementations of the
missing linked functions like `Perl_sv_free2` and forward them to the
DLL version of the function at runtime. There are only a few functions
that need this treatment, and it's a simple stub so there is very low
upkeep compared to copying whole implementations to the file.

Also, fix the configure script so that if we are using dynamic linkage,
we don't pass `-lperl` to the build flags, to avoid accidental external
linkage while using dynamic builds. This is similar to how Python
integration works.

2) Fix GIMME_V deprecation warnings in Perl 5.38

Just use GIMME_V, and only use GIMME when using 5.30 to avoid needing to
link Perl_block_gimme. We could provide a stub like the other linked
functions like Perl_sv_free2, but simply using GIMME is the simplest and
it has always worked before.

3) Fix Perl 5.38 issues

Fix two issues:

3.1. Perl 5.38 links against more functions in their inline headers, so we
   need to stub them too.

3.2. Perl 5.38 made Perl_get_context an inline function, but *only* for
   non-Windows build. Fix that. Note that this was happening in Vim
   currently, as it would build, but fail to run Perl code at runtime.

4) Fix Perl 5.36/5.38 when thread local is used

Perl 5.36 introduced using `_Thread_local` for the current context,
which causes inline functions to fail. Create a stub
`PL_current_context` thread local variable to satisfy the linker for
inlined functions. Note that this is going to result in a different
`PL_current_context` being used than the one used in the library, but so
far from testing it seems to work.

5) Add docs for how to build Perl for dynamic linking to work

closes: #12827
closes: #12914

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-29 21:31:28 +02:00
Illia Bobyr
0e82b59df3
patch 9.0.1817: configure: using obsolete AC_HEADER_STDC
Problem:  configure: using obsolete AC_HEADER_STDC
Solution: Remove it and re-create configure

closes: #12949

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
2023-08-29 21:17:50 +02:00
ichizok
bddc6adca6
patch 9.0.1816: configure: sed uses non-portable regex
Problem:  configure: sed uses non-portable regex
Solution: use '*' modifier instead of '\?' in regex
          for luajit version detection

closes: #12954

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: ichizok <gclient.gaap@gmail.com>
2023-08-29 20:54:32 +02:00
James McCoy
fe1463674c
patch 9.0.1815: pango_coverage_unref() deprecated in pango > 1.51
Problem:  pango_coverage_unref() deprecated in pango > 1.51
Solution: use g_object_unref() instead

closes: #12942

Free PangoCoverage with g_object_unref for Pango >= 1.52

pango_coverage_unref was declared deprecated in Pango 1.52.0 in favor of
g_object_unref.  Adjust the call when building against a new enough
Pango to avoid the deprecation warning.

Signed-off-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:29:13 +02:00
Yegappan Lakshmanan
2ba9d2e14e
patch 9.0.1814: Vim9 no error on duplicate object member var
Problem:  Vim9 no error on duplicate object member var
Solution: detect duplicate members and error out

closes: #12938

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-28 21:26:23 +02:00
zeertzjq
1d3e0e8f31
patch 9.0.1813: linebreak incorrect drawn with breakindent
Problem: 'linebreak' is incorrectly drawn after 'breakindent'.
Solution: Don't include 'breakindent' size when already after it.

closes: #12937
closes: #12940

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-28 21:21:46 +02:00
Christian Brabandt
93ebb5e75e
patch 9.0.1812: CI still fails with sodium_mlock error()
Problem:  CI still fails with sodium_mlock error()
Solution: Catch and ignore E1230 error in test_crypt

closes: #12939

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-28 21:17:36 +02:00