1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-04-17 07:06:18 +02:00
Commit graph

20302 commits

Author SHA1 Message Date
Nir Lichtman
b516598092
patch 9.1.0780: MS-Windows: incorrect Win32 error checking
Problem:  MS-Windows: incorrect Win32 error checking
Solution: fix wrong order of error handling and perform
          some minor refactoring (Nir Lichtman)

In the function that adjusts the process privileges there is a mistake
in which GetLastError is called after CloseHandle, though clearly the
last error check is meant for the privileges related call before hand
and the current state appears like a mistake.

So fix this problem, and also perform the following:

- Remove the static variable done since the PlatformId is only called
  during initialization
- Fix incorrect parameter passed to the Win32 API privileges function

closes: 

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:44:07 +02:00
Richard Russon
a2aa921f76
patch 9.1.0779: filetype: neomuttlog files are not recognized
Problem:  filetype: neomuttlog files are not recognized
Solution: detect '*.neomuttdebug' file as neomuttlog filetype,
          include neomuttlog syntax script (Richard Russon)

closes: 

Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
Signed-off-by: Richard Russon <rich@flatcap.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:42:14 +02:00
Andis Spriņķis
0f146b7925
patch 9.1.0778: filetype: lf config files are not recognized
Problem:  filetype: lf config files are not recognized
Solution: detect lfrc files as lf filetype, include a syntax
          script for lf files (Andis Spriņķis).

References:
- https://github.com/gokcehan/lf

closes: 

Signed-off-by: Andis Spriņķis <spr.andis@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:29:56 +02:00
Maxim Kim
f64bafd98a
runtime(comment): fix commment toggle with mixed tabs & spaces
- fix regression where toggling doesn't properly remove comment chars in
  files with tabs indents only.
- refactor toggling comments for mixed tabs & spaces sources

closes: 

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:20:53 +02:00
h-east
a4205471ad
runtime(misc): Use consistent "Vim script" spelling
References: https://groups.google.com/g/vim_dev/c/3Z5yM8KER2w/m/wAqws0QSEAAJ

closes: 

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:16:42 +02:00
Trilowy
6e918538b1
runtime(gleam): add ftplugin for gleam files
fixes: 
closes: 

Signed-off-by: Trilowy <49493635+trilowy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:08:30 +02:00
Christian Brabandt
5dcee3c723
runtime(doc): link help-writing from write-local-help
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 10:26:37 +02:00
nisbet-hubbard
367499c5c3
patch 9.1.0777: filetype: Some upstream php files are not recognized
Problem:  filetype: Some upstream php files are not recognized
Solution: Detect more config files from the PHP source
          distribution as filetype ini (nisbet-hubbard).

closes: 

Signed-off-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 17:19:58 +02:00
Aliaksei Budavei
05d0893ed8
runtime(java): Define javaBlockStart and javaBlockOtherStart hl groups
And do not link either to any group.

Resolves .

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 17:12:51 +02:00
Christian Brabandt
1961cafc99
runtime(doc): mention conversion rules for remote_expr()
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 11:57:12 +02:00
Andrés
eac806bf0b
runtime(tutor): Fix missing :s command in spanish translation section 4.4
closes: 

Signed-off-by: Andrés <abenitof@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 11:47:18 +02:00
James McCoy
ea997edc7a
patch 9.1.0776: test_strftime may fail because of missing TZ data
Problem:  test_strftime may fail because of missing TZ data
Solution: Use GMT offsets to validate timezone differences (James McCoy)

Some systems only provide timezones that follow the geographical region
naming (e.g. America/New_York) by default and require an additional
install for other names (like EST).

The GMT+<offset> format must always be honored, so use that to generate
distinct data for the test.

closes: 

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 11:36:58 +02:00
Gagik Hakobyan
59086a25c4
translation(am): Add Armenian language translation
closes: 

Signed-off-by: Gagik Hakobyan <hakgagik@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 11:32:46 +02:00
Milly
484facebe4
patch 9.1.0775: tests: not enough tests for setting options
Problem:  tests: not enough tests for setting options
Solution: Add more comprehensive tests to test_options (Milly).

closes: 

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-12 11:26:06 +02:00
zeertzjq
85f36d61e0
patch 9.1.0774: "shellcmdline" doesn't work with getcompletion()
Problem:  "shellcmdline" doesn't work with getcompletion().
Solution: Use set_context_for_wildcard_arg() (zeertzjq).

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-10 19:14:13 +02:00
nisbet-hubbard
e58e9015cc
patch 9.1.0773: filetype: some Apache files are not recognized
Problem:  filetype: some Apache files are not recognized
Solution: Detect more config files from the Apache source
          distribution as filetype apache (nisbet-hubbard)

closes: 

Signed-off-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-10 19:09:28 +02:00
glepnir
7baa014d0f
patch 9.1.0772: some missing changes from v9.1.0771
Problem:  some missing changes from v9.1.0771
Solution: use correct highlighting attribute and adjust comments
          (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-09 20:19:25 +02:00
glepnir
0fe17f8ffb
patch 9.1.0771: completion attribute hl_group is confusing
Problem:  Currently completion attribute hl_group is combined with
          all items, which is redundant and confusing with kind_hlgroup
Solution: Renamed to abbr_hlgroup and combine it only with the abbr item
          (glepnir).

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 22:26:44 +02:00
Ruslan Russkikh
0407d621bb
patch 9.1.0770: current command line completion is a bit limited
Problem:  current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
          function (Ruslan Russkikh).

closes: 

Signed-off-by: Ruslan Russkikh <dvrussk@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 22:24:04 +02:00
Wu, Zhenyu
347d43bd33
patch 9.1.0769: filetype: MLIR files are not recognized
Problem:  filetype: MLIR files are not recognized
Solution: Detect '*.mlir' files as mlir filetype,
          include a mlir filetype plugin
          (Wu, Zhenyu)

closes: 

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 21:58:35 +02:00
William Bresler
ded59139fd
patch 9.1.0768: MS-Windows: incorrect cursor position when restoring screen
Problem:  MS-Windows: incorrect cursor position when restoring screen
          (after v9.1.0664)
Solution: Restore the VTP command for switching screens back to
          termcap_mode_end() (William Bresler)

Patch 9.1.0664 moved the VTP command for switching back to the main
screen buffer from termcap_mode_end() to mch_exit_c().  However, the
saved cursor position from the main screen continued to be restored
in termcap_mode_end().  This failed if the cursor position was beyond
the console window height, since the alternate screen buffer is always
the same size as the console window.

This patch restores the VTP command for switching back to the main
screen buffer to termcap_mode_end().  In order to preserve the effect
of patch 9.1.0664, the VTP command for switching back to the main
screen buffer in mch_exit_c() is issued only if termcap mode was not
active while exiting Vim.

See issue 15775 for a fuller description, with screen shots of the
problem.

fixes: 
closes: 

Signed-off-by: William Bresler <wbresler@gmail.com>
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 21:42:46 +02:00
Andrii Sokolov
830a802f91
runtime(nasm): Update nasm syntax script
Co-authored-by: sarvel <sarvel@protonmail.com>
Signed-off-by: Andrii Sokolov <andriy145@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 21:10:09 +02:00
zeertzjq
c9aa6e4f2a
patch 9.1.0767: A condition is always true in ex_getln.c
Problem:  A cmdlen == 0 condition is always true as ccline.cmdlen == 0
          was already checked above (after v9.1.0766).
Solution: Remove the condition and the variable.
          (zeertzjq)

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 21:04:19 +02:00
Simão Afonso @ Powertools Tech
cb1d1dcc87
runtime(skill): Update syntax file to fix string escapes
The syntax script allowed for single backslash escapes like this
"string\""
But did not accommodate for the uncommon case:
"<key>\\"
Let's fix this by also skipping over double backslashes in the
skillString region.

closes: 

Signed-off-by: Simão Afonso @ Powertools Tech <simao.afonso@powertools-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 20:58:41 +02:00
Christian Brabandt
d3b55d7f76
runtime(help): highlight CTRL-<Key> correctly
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-08 20:20:23 +02:00
Christian Brabandt
015c84ce54
runtime(doc): add missing usr_52 entry to toc
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 21:48:32 +02:00
John Marriott
ccf8907570
patch 9.1.0766: too many strlen() calls in ex_getln.c
Problem:  too many strlen() calls in ex_getln.c
Solution: refactor the code to reduce the number of strlen() calls
          (John Marriott)

closes: 

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 21:40:39 +02:00
Frederick Key Abell III
6e56484f05
runtime(doc): correct vi registers 1-9 documentation error
When using heirloom `vi` originally written by Bill Joy (`:version`
gives me "Version 4.0 (gritter) 12/25/06"), its possible to store text into
registers 1-9 and subsequently use the `:edit` or `:next` command to
change files and paste the contents of those numbered registers,
contrary to what Vim documentation states.

POSIX description also does not mention such a restriction:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ex.html#tag_20_40_13_10

closes: 

Signed-off-by: Frederick Key Abell III <fkabell@localhost.localdomain>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 21:07:12 +02:00
zeertzjq
5df3cb2898
patch 9.1.0765: No test for patches 6.2.418 and 7.3.489
Problem:  No test for patches 6.2.418 and 7.3.489
Solution: Add a test.  Fix some whitespace problems in test_mapping.vim.
          Document the behavior (zeertzjq).

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 21:05:06 +02:00
Andreas Schneider
4f51f3a573
runtime(spec): set comments and commentstring options
closes: 

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 21:02:10 +02:00
K.Takata
48f3833ff0
NSIS: Include libgcc_s_sjlj-1.dll again
gettext-iconv-windows v0.22.5a-v1.17 requires libgcc_s_sjlj-1.dll again.
Add a new option ${INCLUDE_LIBGCC} to control whether it should be
included in the package.

This partly reverts 49f1e1979f.

Related: https://github.com/vim/vim-win32-installer/pull/355

closes: 

Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-07 20:37:00 +02:00
Christian Brabandt
fd4e47e06b
runtime(doc): clarify the effect of 'startofline' option
fixes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 18:02:45 +02:00
Christian Brabandt
51b62387be
patch 9.1.0764: [security]: use-after-free when closing a buffer
Problem:  [security]: use-after-free when closing a buffer
Solution: When splitting the window and editing a new buffer,
          check whether the newly to be edited buffer has been marked
          for deletion and abort in this case

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rj48-v4mq-j4vg

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 17:36:31 +02:00
Doug Kearns
818c641b6f
runtime(vim): Update base-syntax file, improve class, enum and interface highlighting
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
  other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.

fixes: #14393#issuecomment-2042796198.
closes: 

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 17:00:48 +02:00
Aliaksei Budavei
ec0229414b
patch 9.1.0763: tests: cannot run single syntax tests
Problem:  tests: cannot run single syntax tests
Solution: Support running a subset of syntax tests
          (Aliaksei Budavei)

Two methods of assembling a subset of test filenames for
selection are provided:

* Filename and filetype Make targets will be generated, and
  multiple such targets can be passed before the mandated
  trailing "test" target, e.g. "make html markdown test".

* Filenames and their parts can be specified as a regular
  expression that is assigned to a "VIM_SYNTAX_TEST_FILTER"
  environment variable, and used with the test Make target,
  e.g. "VIM_SYNTAX_TEST_FILTER=html\\\|markdown make test".
  (This variable will be ignored and the whole suite will be
  run when Make is GNU Make and a parent Makefile is used.)

Methods can be used alone or together, with the Make targets
having the higher precedence. Neither method will influence
the order of test execution.

closes: 

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 16:57:33 +02:00
Milly
a9c6f90918
patch 9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly
Problem:  'cedit', 'termwinkey' and 'wildchar' may not be parsed
          correctly
Solution: improve string_to_key() function in option.c
          (Milly)

- Problem: `^@` raises an error.
  Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
  Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
  Solution: They are stored as a single character.

closes: 

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 16:47:02 +02:00
Christian Brabandt
1a31c430bb
patch 9.1.0761: :cd completion fails on Windows with backslash in path
Problem:  :cd completion fails on Windows with backslash in path
Solution: switch no_bslash argument to FALSE in file_pat_to_reg_pat()

Note: only fixes the problem on Windows. For Unix, we still need to
escape backslashes since those are taken as regex atoms (and could be
invalid regex atoms).

fixes: 
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 16:34:20 +02:00
Milly
d4ad4c9b3e
patch 9.1.0760: tests: no error reported, if gen_opt_test.vim fails
Problem:  tests: no error reported, if gen_opt_test.vim fails
Solution: Make Vim exit with return code 1 in case of any error
          (Milly)

closes: 

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 16:27:28 +02:00
Christian Brabandt
b065a10e24
patch 9.1.0759: screenpos() may return invalid position
Problem:  screenpos() may return invalid position
          after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
          after copying wrap option

fixes: 
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 17:30:22 +02:00
Konfekt
7c3f9af0ed
runtime(misc): unset compiler in various ftplugins
just to foster best practices

closes: 

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 17:26:46 +02:00
Milly
89872f58a9
runtime(doc): update formatting and syntax
closes: 

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 17:16:18 +02:00
Konfekt
af449f69c7
runtime(compiler): add cppcheck linter compiler plugin
closes: 

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 17:09:21 +02:00
h-east
738ebfea41
runtime(doc): Fix style in documents
closes: 

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 16:56:47 +02:00
h-east
8ee0e0b8e3
runtime(doc): Fix to two-space convention in user manual
closes: 

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 16:44:27 +02:00
Konfekt
7b27fc49a8
runtime(comment): consider &tabstop in lines after whitespace indent
The count `strlen()` in

```vim
line = printf(indent_start .. substitute(cms, '%s\@!', '%%', 'g'),
                       strpart(getline(lnum), strlen(indent_start)))
```

is too large if the block of lines to be operated on contains different
whitespace indenting (tab vs. spaces).

Considering using `2gcc` on the first line with 4 spaces as indenting
and on the next line using a single tab character (with &tabstop value
of 8):

Using `strlen(indent_start) = 4` for an initial indent of 4 spaces is
correct for the first line, but wrong for the next line and will
therefore wrongly comment out the tab-indented line (and possibly
deleting some content).

The new check is still too simple because it assumes that as soon as
there's a tab the whole indent is made of tabs; it's a start of entering
the mixed tab and whitespace indent rabbit hole.

fixes: 
closes: 

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 16:19:40 +02:00
Milly
40c6babc17
patch 9.1.0758: it's possible to set an invalid key to 'wildcharm'
Problem:  it's possible to set an invalid key to 'wildcharm'
Solution: error out, if the 'wildcharm' value is an invalid key
          (Milly)

closes: 

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-04 20:41:14 +02:00
Aliaksei Budavei
60310a4b26
runtime(java): Manage circularity for every :syn-included syntax file
With "g:markdown_fenced_languages" defined and "java" added
to its list, a circular dependency between the Markdown and
Java syntax files will be made.  To break it, no Markdown
documentation comments will be recognised in fenced blocks
in Markdown files; in order to view Java source files,
"java" must be removed from "g:markdown_fenced_languages",
and this task can be automated as follows.

1) Add to "~/.after/ftplugin/java.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
	\ !(exists("g:java_ignore_javadoc") ||
	\ exists("g:java_ignore_markdown"))
    let s:idx = index(g:markdown_fenced_languages, 'java')
    if s:idx > -1
	call remove(g:markdown_fenced_languages, s:idx)
    endif
    unlet s:idx
endif
------------------------------------------------------------

2) Optionally add to "~/.after/ftplugin/markdown.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
	\ index(g:markdown_fenced_languages, 'java') < 0
    call add(g:markdown_fenced_languages, 'java')
endif
------------------------------------------------------------

(Make sure that the above snippets appear in the files under
the "ftplugin" NOT "syntax" directory.)

Finally, unless the new version of the syntax file is made
available from "$VIMRUNTIME" (and from "~/.vim/syntax" if
necessary), OTHER discoverable file versions will be used
whose behaviour may interfere with this fix.

related: 
closes: 

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-04 20:25:05 +02:00
Christian Brabandt
075ab5ab3b
patch 9.1.0757: tests: messages files contains ANSI escape sequences
Problem:  tests: messages files contains ANSI escape sequences
Solution: filter those out in runtests.vim

Also, since we are setting $LC_ALL, we don't need to set $LANG and
$LANGUAGE since those are overridden by $LC_ALL anyhow.

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-03 16:38:52 +02:00
glepnir
a6d9e3c4e0
patch 9.1.0756: missing change from patch v9.1.0754
Problem:  missing change from patch v9.1.0754
Solution: use correct width for the actual item
          in pum_redraw() (glepnir)

closes: 

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-03 11:01:19 +02:00
Austin Chang
2982299699
patch 9.1.0755: quickfix list does not handle hardlinks well
Problem:  quickfix list does not handle hardlinks well
Solution: store original file name with quickfix entry
          (Austin Chang)

Quickfix list shows entries with duplicate name if the file is opened
with the path of hard links.

The major cause is that qflist assumed that the filename passed into
`qf_add_entry` matches the filename opened with the buffer.

This patch handles this case by introduce a `qf_fname` into `qfline_S`
structure. It stores the filename from `qf_add_entry` for each quickfix
line.

closes: 

Signed-off-by: Austin Chang <austin880625@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-03 10:56:31 +02:00