1
0
forked from aniani/vim

19179 Commits

Author SHA1 Message Date
Aliaksei Budavei
a2addebca3
runtime(syntax-tests): include missing changes
related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 20:40:54 +01:00
MyyPo
ef21bcaab1
runtime(rust): Respect no_plugin_maps and no_rust_maps globals (#14221)
Signed-off-by: myypo <nikirsmcgl@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:38:09 +01:00
Aliaksei Budavei
a9bc195d64
runtime(syntax-tests): Retrofit input/c.c. with TEST_SETUP
Also:

- Include a syntax test for Markdown that takes advantage of
  a sourceable setup configuration.
- Update Filelist

closes: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:32:48 +01:00
Aliaksei Budavei
f6069a7ddc
runtime(syntax-tests): Support sourceable Vim configuration for syntax tests
Not all programming languages support comments; without such
support, the TEST_SETUP functionality that offers embeddable
Vim Ex commands may no longer be applicable.

We can achieve similar functionality by storing Ex commands
in a Vim file with its basename matching the basename of the
test file, and having this Vim file sourced, and then having
the test file loaded and tested.  When such a Vim file would
be used for a language that has comments and whose matching
test file has embedded TEST_SETUP lines, we will accommodate
it by letting the TEST_SETUP lines augment and/or overrule
sourced configuration.

Further details can be found in the discussion thread at
https://github.com/vim/vim/discussions/14117.

related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:32:48 +01:00
Aliaksei Budavei
93edd254d5
runtime(syntax-tests): Support embeddable Vim configuration for syntax tests
Currently, the very same syntax file for which a test can
be written is the only place where global variables can be
defined so that the file parts guarded with such variables
can be read during screen dump generation.  This approach
would lead to littering the syntax file with test-related
queries.

Instead, we could borrow the idea of comment-based mechanism
for test setup from the indent test runner.  With it, the
first 20 lines of each test file would be ALWAYS scanned in
search of the TEST_SETUP markers and, when found, the part
between the end of the marker and the end of the line would
be treated as a Vim Ex command.

Note that with these changes, runtime/defaults.vim is no
longer sourced for screen dump generation; however, some of
its functionality is reintroduced.

Further details can be found in the discussion thread at
https://github.com/vim/vim/discussions/14117.

related: #14215

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:32:16 +01:00
Aliaksei Budavei
78c189837a
runtime(doc): Recover some missed commas and periods in starting.txt
Also:

- Insert some missing words;
- Strive for consistency with capitalisation of words;
- Improve shell alias examples.

The gvim words were left alone for now, but they deserve to
be treated like proper names, GVim or GUI Vim, unless these
refer to executable filenames (on *nix systems).

closes: #14194

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:25:27 +01:00
zeertzjq
4e334d0443
patch 9.1.0187: filetype: no support for Dafny files
Problem:  Dafny files are not recognized.
Solution: Recognize *.dfy files as filetype "dafny" (zeertzjq).

Ref: https://dafny.org/
Ref: https://github.com/mlr-msft/vim-loves-dafny

closes: #14226

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0187
2024-03-18 19:21:48 +01:00
dkearns
9530fe4f3a
runtime(vim): Update base-syntax, improve :highlight command (#14228)
Improve :highlight command highlighting

- Use the same highlight groups for "default link" with and without
  bang.
- Match some common line-continuation use.
- Match :hi clear variants.
- Highlight color-name values.

Resync vim.vim and generator/vim.vim.base.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-18 19:19:51 +01:00
Christian Brabandt
0e17f7e972
runtime(doc): clarify close behaviour for :term
closes: #14207

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-17 20:14:25 +01:00
Matthew Hughes
3d46de703c
runtime(go): goPackageComment highlighting too broad
Previously this would highlight any comment before a line starting
`package`, for example

    var (
      // This comment would be highlighted as a goPackageComment
      packages []string
    )

The package clause is only valid when followed by a space[1], so include
this restriction

This is upstreaming a change from `go-vim`[2]

[1] https://go.dev/ref/spec#Package_clause
[2] d1c36cc417

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-17 20:05:43 +01:00
zeertzjq
deb2204bff
patch 9.1.0186: cursor pos wrong on mouse click after eol with 'rl', 've' and conceal
Problem:  Wrong cursor position when clicking after end of line with
          'rightleft', 'virtualedit' and conceal.
Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT.  Also fix
          off-by-one cursor position with 'colorcolumn' (zeertzjq).

closes: #14218

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0186
2024-03-17 19:44:30 +01:00
zeertzjq
f6272551bd
patch 9.1.0185: 'wincolor' hl missing with 'rightleft', "below" virttext, 'nowrap'
Problem:  'wincolor' highlight missing with 'rightleft', "below" virtual
          text and 'nowrap'.
Solution: Handle 'rightleft' in draw_screen_line() (zeertzjq).

closes: #14216

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0185
2024-03-17 10:01:47 +01:00
RestorerZ
8291e91c6b
runtime(indent-test): MS-Windows: Add Makefile for running indent tests
A few more unrelated changes:
- fix Vim script style of indent test
- Change comments to complete sentences in Filelist

closes: #14198
2024-03-16 15:13:21 +01:00
zeertzjq
d0c1b7723f
patch 9.1.0184: Cursor pos wrong when clicking with conceal and wrap
Problem:  Cursor position wrong when clicking with conceal and wrap.
Solution: Use the virtual column of the last char for ScreenCols[] in
          boguscols.  Remove use of MAXCOL in ScreenCols[].  Rename
          third argument of wlv_screen_line() to "clear_end" as that's
          clearer what it does (zeertzjq).

related: 14192
closes: #14200

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0184
2024-03-16 15:03:33 +01:00
zeertzjq
9e7f1fc2f1
patch 9.1.0183: Wrong display or screenpos() result when toggling diff mode
Problem:  Wrong display or screenpos() result when toggling diff mode.
Solution: Reset w_skipcol when disabling 'wrap'.  Reset w_leftcol when
          enabling 'wrap' (zeertzjq).

fixes: #14210
closes: #14211

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0183
2024-03-16 09:40:22 +01:00
zeertzjq
6a04bf5ee5
patch 9.1.0182: Can define function with invalid name inside 'formatexpr'
Problem:  Can define function with invalid name inside 'formatexpr'.
Solution: Use goto instead of checking for did_emsg later.
          (zeertzjq)

closes: #14209

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0182
2024-03-16 09:39:06 +01:00
Restorer
20eaf8b78d
tools/rename.bat uses 'mv' and "move" (#14201)
refactor tools/rename.bat and support both "mv" for Linux build environments
and "move" for Windows build environments

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-16 09:38:10 +01:00
zeertzjq
989faa4fce
runtime(doc): make :h tag-! more consistent (#14208)
- Use "on" and "off" for 'winfixbuf' option values.
- Retab the table.

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-16 09:21:20 +01:00
dkearns
b4b3d7de24
runtime(vim): Update base-syntax, revert last change to vimUserFunc (#14202)
Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by
re-enabling the original fix for #9987.

Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062.

This will be fixed more generally when there is context-sensitive
matching for commands and functions.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-15 18:53:53 +01:00
dkearns
61887b3d6f
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (#14199)
Improve :echo and :execute highlighting.

- Add better line-continuation support for both commands.
- Improve the :execute command's expression argument matching.
- Remove the fix for issue #9987 as this is now handled by correctly
  matching the parens in :echo (...) as operator parens.


Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-15 12:45:48 +00:00
Christ van Willegen
c35fc03dbd
patch 9.1.0181: no overflow check for string formatting
Problem:  no overflow check for string formatting
Solution: Check message formatting function for overflow.
          (Chris van Willegen)

closes: #13799

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0181
2024-03-14 18:58:04 +01:00
zeertzjq
010e1539d6
patch 9.1.0180: Cursor pos wrong when double-width chars are concealed
Problem:  Cursor pos wrong when double-width chars are concealed.
Solution: Advance one more virtual column for a double-width char.
          Run some tests with both 'wrap' and 'nowrap' (zeertzjq).

closes: #14197

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0180
2024-03-14 18:22:17 +01:00
zeertzjq
9352c28292
patch 9.1.0179: 'wincolor' highlight missing with "below" virtual text
Problem:  'wincolor' highlight missing with "below" virtual text.
Solution: Subtract n_attr_skip from n_attr.  Combine 'wincolor' with
          other highlights when 'nowrap' is set. (zeertzjq)

closes: #14196

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0179
2024-03-14 18:16:56 +01:00
Christian Brabandt
45da32964d
runtime(mswin): still another clipboard_working test
Commit 760f664213dea9a300454992ba1589f4601d622f missed to revert back
another test for `if has('clipboard_working')`

So change the remaining check around the inoremap <c-v> mappings.

fixes #14195

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-14 07:59:09 +01:00
Christian Brabandt
0a32b8854b
patch 9.1.0178: E1513 might be confusing
Problem:  E1513 might be confusing
          (Christoph Thoma)
Solution: reword error message, fix test to not
          depend on the actual message

fixes: #14189

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0178
2024-03-13 20:59:27 +01:00
zeertzjq
8c55d60658
patch 9.1.0177: Coverity reports dead code
Problem:  Coverity reports dead code.
Solution: Remove the dead code. Also fix a mistake in ml_get_pos_len()
          and update some comments (zeertzjq).

closes: #14189

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0177
2024-03-13 20:42:26 +01:00
zeertzjq
253ff4dece
patch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal
Problem:  Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
          (zeertzjq)

closes: #14190

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0176
2024-03-13 20:38:26 +01:00
Sean Dewar
5866bc3a0f
patch 9.1.0175: wrong window positions with 'winfix{width,height}'
Problem:  winframe functions incorrectly recompute window positions if
          the altframe wasn't adjacent to the closed frame, which is
          possible if adjacent windows had 'winfix{width,height}' set.

Solution: recompute for windows within the parent of the altframe and
          closed frame. Skip this (as before) if the altframe was
          top/left, but only if adjacent to the closed frame, as
          positions won't change in that case. Also correct the return
          value documentation for win_screenpos. (Sean Dewar)

The issue revealed itself after removing the win_comp_pos call below
winframe_restore in win_splitmove. Similarly, wrong positions could result from
windows closed in other tabpages, as win_free_mem uses winframe_remove (at least
until it is entered later, where enter_tabpage calls win_comp_pos).

NOTE: As win_comp_pos handles only curtab, it's possible via other means for
positions in non-current tabpages to be wrong (e.g: after changing 'laststatus',
'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional
as an optimization? Should probably be documented in win_screenpos then, but I
won't address that here.

closes: #14191

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0175
2024-03-13 20:17:24 +01:00
zeertzjq
21b0a3df8c
patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap
Problem:  'cursorline' and 'wincolor' highlight missing with concealed and
          wrapped lines.
Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols.
          (zeertzjq)

Since 'cursorline' and 'wincolor' highlight apply after the end of the
line, it is more consistent to have them also apply to boguscols.

Assigning MAXCOL to values in ScreenCols[] make mouse click behave the
same with 'cursorline' and 'nocursorline', but such behavior may be
incorrect, as it puts the cursor on the next screen line.  That may be
fixed in a future PR.

closes: #14192

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0174
2024-03-13 20:09:02 +01:00
Christian Brabandt
760f664213
runtime(mswin): revert back the check for clipboard_working support
Commit d9ebd46bd090c598adc82e6 changed the condition to
check if the clipboard is available from:
```
has('clipboard')
```
to
```
has('clipboard_working')
```
Assuming that is the more accurate test because even when clipboard
support is enabled at compile time it may not be actually working (e.g.
if no X11 environment is available, or when working on a remote server).

However it seems that condition does not evaluate to true, when the GUI
has not been started up yet (and there was no X11 Connection yet possible).

So let's just revert back the check to `has('clipboard')`, since that
has been proven to be working well enough.

related: #13809

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-13 16:38:16 +01:00
RestorerZ
e498cafe74
patch 9.1.0173: msgfmt ver. 0.22 forcibly converts text to UTF-8
Problem:  msgfmt ver. 0.22 forcibly converts text to UTF-8
Solution: use '--no-convert' if msgfmt supports it. Add a configure
          check for the msgfmt version (RestorerZ).

closes: #14163

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0173
2024-03-12 22:14:39 +01:00
Christian Brabandt
9a660d2883
runtime(doc): add reference to matchbufline() at :h search()
related: #14173

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12 22:03:45 +01:00
zeertzjq
94b7c3233e
patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()
Problem:  More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len().  Also do not
          set ml_line_textlen in ml_replace_len() if "has_props" is set,
          because "len_arg" also includes the size of text properties in
          that case. (zeertzjq)

closes: #14183

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0172
2024-03-12 21:50:32 +01:00
Sean Dewar
5cac1a9bee
patch 9.1.0171: Small split-move related improvements
Problem:  small improvements can be made to split-move related
          functions.
Solution: apply them (Sean Dewar):

- Improve some doc comments (frame_flatten should still work for non-current
  tabpages, despite the topframe check, which looks benign, though I'm unsure if
  it's still needed; see #2467).

- f_win_splitmove should check_split_disallowed on wp, not targetwin, as that's
  what win_splitmove checks (though it's probably unnecessary to check
  b_locked_split at all; see #14109, which I hope to get around to finishing at
  some point).

- Make winframe_restore restore window positions for the altframe, which
  winframe_remove changes. This doesn't affect the prior behaviour, as we called
  win_comp_pos after, but as win_comp_pos only works for curtab, and
  winframe_remove supports non-current tabpages, we should undo it. Regardless,
  this should mean we don't need win_comp_pos anymore; adjust tests to check
  that window positions remain unchanged.

  I'm not sure win_comp_pos is needed after last_status anyway if it doesn't
  steal rows from another frame to make room for a new statusline, which
  shouldn't be the case after winframe_remove? To be safe, I'll leave it as is.

closes: #14185

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0171
2024-03-12 21:11:39 +01:00
Sean Dewar
d64801e913
patch 9.1.0170: Re-allow curwin == prevwin, but document it instead
Problem:  more places exist where curwin == prevwin, and it may even be
          expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
          (Sean Dewar)

I've had a change of heart for the following reasons:

- A quick 'n dirty [GitHub code
  search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
  reveals some cases where it's expected in the wild.

  Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
  is changed temporarily during the evaluation of a &statusline expression item
  (`%{...}`), and is used to show something different on the statusline
  belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
  but it means curwin == prevwin makes sense in some cases.

- The definition and call sites of back_to_prevwin imply some expectation that
  prevwin == wp (== curwin) is possible, as it's used to skip entering the
  prevwin in that case.

- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
  v9.1.0001, but now does. That resulted in #14047 being opened, as it affected
  the CtrlP plugin.

  I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
  nothing, but it may be preferable to keep things that way (or instead also
  beep if curwin == prevwin, if that's preferred).

- After more digging, I found cases in win_free_mem, enter_tabpage,
  aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
  (many of them from autocommands). Others probably exist too, especially in
  places where curwin is changed temporarily.

fixes: #14047
closes: #14186

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0170
2024-03-12 20:50:27 +01:00
Sean Dewar
e101028a5c
patch 9.1.0169: current window number returned by tabpagewinnr may be outdated
Problem:  current window number returned by tabpagewinnr may be outdated
          when called from win_execute for the original tabpage.
Solution: update the original tabpage's tp_curwin in switch_win; use
          {un}use_tabpage instead. Don't do it in restore_win to ensure
          tp_curwin of the temporarily visited tabpage is unchanged from
          switch_win visiting it, as before. (Sean Dewar)

Maybe restore_win should only restore tp_curwin if
`curtab == switchwin->sw_curtab`, in case the user changed tabpages from within
win_execute, but not doing that is consistent with the old behaviour.

related: #14186

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0169
2024-03-12 20:42:25 +01:00
John Marriott
bfcc895482
patch 9.1.0168: too many STRLEN() calls
Problem:  too many STRLEN() calls
Solution: Make use of ml_get_len() calls instead
          (John Marriott)

closes: #14123

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0168
2024-03-11 22:04:45 +01:00
dkearns
5cd86c6cff
runtime(vim): Update base-syntax, improve number matching (#14175)
- Limit blob literals to an even number of hexadecimal digits and
  correctly located dots.
- Match octal numbers.

The current version unsuccessfully attempts to match a leading '-' as
part of the float literal.  It's actually parsed as part of the literal
for all numbers but the syntax file hasn't matched it like that for a
long time and highlights negative numbers as UNARY-MINUS NUMBER.  This
will be fixed when better expression matching is implemented.


Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-11 21:40:58 +01:00
zeertzjq
49ffb6b428
patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Problem:  Changing buffer in another window using win_execute() causes
          it to show matchparen (after 9.0.0969).
Solution: Delay highlighting with SafeState in BufWinEnter.
          (zeertzjq)

closes: #14177

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0167
2024-03-11 21:38:58 +01:00
zeertzjq
5406eb8722
patch 9.1.0166: Internal error with blockwise getregion() in another buffer
Problem:  Internal error with blockwise getregion() in another buffer
Solution: Also change curwin->w_buffer when changing curbuf (zeertzjq)

closes: #14179

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0166
2024-03-11 21:36:42 +01:00
Rimas Kudelis
cb942cc4ca
translation(lt): Update Lithuanian translation of Vim tutor to v.1.7 (#14176)
Signed-off-by: Rimas Kudelis <rimas@kudelis.lt>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-11 15:15:04 +00:00
zeertzjq
0049a495c8
runtime(doc): improve 'winfixbuf' docs (#14180)
- Make it not sound like a buffer option.
- "!" is called a modifier, not an option.

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-11 15:13:16 +00:00
Christian Brabandt
675cbfb47f
runtime(doc): Update Markdown syntax, add missing configs
fixes: #14168

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-10 19:34:32 +01:00
Yegappan Lakshmanan
fa63008727
patch 9.1.0165: Vim9: Importing an autoload imported script fails
Problem:  Vim9: Importing an autoload imported script fails
          (Song-Tianxiang)
Solution: Return the script ID in this case
          (Yegappan Lakshmanan)

fixes: #14171
closes: #14174

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0165
2024-03-10 19:22:38 +01:00
zeertzjq
26dd09ad5e
patch 9.1.0164: Internal error when passing invalid position to getregion()
Problem:  Internal error or crash when passing invalid position to
          getregion().
Solution: Give an error for invalid position (zeertzjq).

closes: #14172

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0164
2024-03-10 15:46:58 +01:00
zeertzjq
82e079df81
patch 9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed
Problem:  Calling STRLEN() to compute ml_line_textlen when not needed.
Solution: Use 0 when STRLEN() will be required and call STRLEN() later.
          (zeertzjq)

closes: #14155

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0163
2024-03-10 08:55:42 +01:00
Paul R. Tagliamonte
14759ded57
patch 9.1.0162: problem with writing extended attributes on failure
Problem:  problem with writing extended attributes on failure
Solution: Change return type to ssize_t and check listxattr's return
          value correctly on failure (Paul Tagliamonte)

The existing logic will return when the listxattr call returns with the
errno set to ENOTSUP (or a size of 0 bytes), without checking to see if
listxattr actually failed. listxattr can fail with at least E2BIG,
ENOTSUP, ERANGE, or anything that `stat(2)` can fail with (in my case;
ENOENT from stat).

The returned size is stored to a size_t, but the return type is a
ssize_t. On failure, listxattr returns -1, which will get translated to
size_t's MAX. If the listxattr call failed with anything other than
ENOTSUP, this triggers a request for size_t MAX bytes.

This means that, if the listxattr call fails with anything other than
ENOTSUP on save, vim will error with

`E342: Out of memory!  (allocating 18446744073709551615 bytes)`

(keen observers will note 18446744073709551615 is 0xffffffffffffffff)

In reality, this is likely masking a different (usually filesystem?)
error -- but at least it's an error being pushed to the user now, and we
don't try to allocate size_t MAX bytes.

I've opted to change the type that we store listxattr to from size_t to
ssize_t, to match listxattr(2)'s signature, and to check for the -1
return value. Additionally, I've removed the errno check -- if we get a
listxattr failure for any reason, we may as well bail without trying;
it's not like we can even recover.

closes: #14169

Signed-off-by: Paul Tagliamonte <paultag@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.1.0162
2024-03-10 08:53:33 +01:00
Rimas Kudelis
ca0e0d2708
translation(lt): Added Lithuanian translation of Tutor v. 1.4 by Laurynas Stančikas (#14118)
This translation has been available for free download from lietuvybe.org,
then lietuvybe.akl.lt, then lietuvybė.lt since at least 2006[1], but noone
ever bothered to contribute it upstream.

[1] https://web.archive.org/web/20060222162117/http://lietuvybe.org/files/vim-tutor-lt.txt

Co-authored-by: Laurynas Stančikas <lasas@gim.ktu.lt>
Signed-off-by: 	Rimas Kudelis <rimas@kudelis.lt>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 18:27:46 +01:00
Aliaksei Budavei
a2c65809da
runtime(java): Recognise string templates (#14150)
As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.

According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines.  Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.

References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 18:03:11 +01:00
dkearns
5d67aef306
runtime(vim): Update base-syntax, improve :map highlighting (#14141)
Improve :map command highlighting.

- Fix multiline RHS matching, allow continued lines and comments.
- Allow ^V-escaped whitespace in LHS.
- Handle map-bar properly and allow trailing commands.

Fixes issue #12672.


Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 18:01:22 +01:00