Commit Graph

1217 Commits

Author SHA1 Message Date
zeertzjq
4025c2aa5f
vim-patch:8.2.0281: two placed signs in the same line are not combined (#29757)
Problem:    Two placed signs in the same line are not combined.  E.g. in the
            terminal debugger a breakpoint and the PC cannot be both be
            displayed.
Solution:   Combine the sign column and line highlight attributes.

a2f6e42ded

Nvim already does this in decor_redraw_signs().

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-17 01:20:41 +00:00
zeertzjq
7e5c5b4d85 vim-patch:8.2.1659: spellfile code not completely tested
Problem:    Spellfile code not completely tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes vim/vim#6929)

96fdf4348a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:25:10 +08:00
zeertzjq
10fa9c8039 vim-patch:8.2.1651: spellfile code not completely tested
Problem:    Spellfile code not completely tested.
Solution:   Add a few more test cases. (Yegappan Lakshmanan, closes vim/vim#6918)

64e2db6dc6

Fix incorrect spellfile message.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:25:10 +08:00
zeertzjq
0bbccf7c5f
vim-patch:8.2.3381: crash when using NULL list with sign functions (#29740)
Problem:    Crash when using NULL list with sign functions.
Solution:   Handle a NULL list like an empty list. (issue vim/vim#8260)

5c56da4de8

Nvim's TV_LIST_ITER_MOD() already checks for NULL.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 15:24:32 +08:00
zeertzjq
e84a4c5a98 vim-patch:9.0.0393: signals test often fails on FreeBSD
Problem:    Signals test often fails on FreeBSD.
Solution:   Use separate files for Suspend and Resume. (Ken Takata,
            closes vim/vim#11065)

a9480dbc8c

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-07-16 14:41:02 +08:00
zeertzjq
a35eda36c3 vim-patch:8.2.5158: TSTP and INT signal tests are not run with valgrind
Problem:    TSTP and INT signal tests are not run with valgrind.
Solution:   Sleep a bit longer. (closes vim/vim#10614)

61e3784819

Cherry-pick Test_signal_TSTP() from patch 8.2.3941.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 14:40:14 +08:00
zeertzjq
76aede1162 vim-patch:8.2.2276: list of distributed files is outdated
Problem:    List of distributed files is outdated.
Solution:   Update the file list.  Minor comment updates.

a72514945b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 14:38:04 +08:00
zeertzjq
598fd77d95
vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738)
Problem:    Tests fail when the float feature is disabled.
Solution:   Skip tests that don't work without float support.

5feabe00c4

Cherry-pick Test_ruby_Vim_blob() from patch 8.1.0977 and skip it.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 06:25:35 +00:00
zeertzjq
37c7c7547a
vim-patch:8.1.1106: no test for 'writedelay' (#29736)
Problem:    No test for 'writedelay'.
Solution:   Add a test.

449ac47f93

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 05:39:20 +00:00
zeertzjq
a553b36876
vim-patch:7.4.1565 (#29734)
Problem:    Crash when assert_equal() runs into a NULL string.
Solution:   Check for NULL. (Dominique) Add a test.

f155196444

Use the latest version of the test from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 03:44:17 +00:00
zeertzjq
24bd7a4a9c vim-patch:8.2.3579: CI sometimes fails for MinGW
Problem:    CI sometimes fails for MinGW.
Solution:   Use backslashes in HandleSwapExists(). (Christian Brabandt,
            closes vim/vim#9078)

4b2c804767

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-16 10:56:37 +08:00
zeertzjq
1bf9a7ce95 vim-patch:8.2.3311: Vim9: check for DO_NOT_FREE_CNT is very slow
Problem:    Vim9: check for DO_NOT_FREE_CNT is very slow.
Solution:   Move to a separate function so it can be skipped by setting
            $TEST_SKIP_PAT.

dae453f339

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-16 10:56:37 +08:00
zeertzjq
15a0977ffc vim-patch:9.1.0585: tests: test_cpoptions leaves swapfiles around
Problem:  tests: test_cpoptions leaves swapfiles around
Solution: Use :bw! instead of :close!

bb5d27dc79

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-15 06:16:31 +08:00
zeertzjq
7214fd8f55 vim-patch:partial:9.0.0418: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Use the 'D' flag of writefile() and mkdir().

45bbaef038

This only includes test_cpoptions.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-15 06:03:58 +08:00
Christian Clason
79130c0fd3 vim-patch:9.1.0586: ocaml runtime files are outdated
Problem:  ocaml runtime files are outdated
Solution: sync those files with the upstream repo,
          detect a few more ocaml files
          (Yinzuo Jiang)

closes: vim/vim#15260

700cf8cfa1

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-14 23:55:57 +02:00
Christian Clason
60734dc761 vim-patch:9.1.0583: filetype: *.pdf_tex files are not recognized
Problem:  filetype: *.pdf_tex files are not recognized
Solution: Detect '*.pdf_tex' files as tex filetype
          (Jonas Dujava)

Those files are generated by inkscape, when exporting, see e.g.
https://inkscape.org/doc/inkscape-man.html

closes: vim/vim#15250

28145e005d

Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-14 12:21:11 +02:00
zeertzjq
c8401515cd vim-patch:9.1.0582: Printed line doesn't overwrite colon when pressing Enter in Ex mode
Problem:  Printed line no longer overwrites colon when pressing Enter in
          Ex mode (after 9.1.0573).
Solution: Restore the behavior of pressing Enter in Ex mode.
          (zeertzjq)

closes: vim/vim#15258

7d664bf0eb
2024-07-14 16:33:07 +08:00
zeertzjq
ba36742211 vim-patch:9.1.0574: ex: wrong handling of commands after bar
Problem:  ex: wrong handling of commands after bar
Solution: for :append, :insert and :change use the text after the bar
          as input for those commands. This is what POSIX requests.
          (Mohamed Akram)

See the POSIX Spec:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 12.c

closes: vim/vim#15229

8c446da349

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
zeertzjq
9093fbdd02 vim-patch:9.1.0573: ex: no implicit print for single addresses
Problem:  ex: no implicit print for single addresses
Solution: explicitly print even during single addresses,
          as requested by POSIX (Mohamed Akram)

See the POSIX behaviour here:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html#tag_20_40_13_03
Section 6b

closes: vim/vim#15230

c25a7084e9

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 13:39:40 +08:00
zeertzjq
49ba36becd
vim-patch:9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode (#29693)
Problem:  An :lmap mapping for a printable keypad key is not applied
          when typing it in Select mode.
Solution: Change keypad key to ASCII after setting vgetc_char.
          (zeertzjq)

closes: vim/vim#15245

90a800274d
2024-07-14 06:50:36 +08:00
zeertzjq
3700d94c6f vim-patch:9.1.0579: Ex command is still executed after giving E1247
Problem:  Ex command is still executed after giving E1247.
Solution: Indicate the error properly and set cmd to NULL.
          (zeertzjq)

closes: vim/vim#15241

d1b5ea984d
2024-07-14 06:12:42 +08:00
zeertzjq
5531c95101 vim-patch:8.2.4065: computation overflow with large cound for :yank
Problem:    Computation overflow with large cound for :yank.
Solution:   Avoid an overflow.

3cf21b3051

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-14 06:12:42 +08:00
zeertzjq
6276fce11e test(old): enable Test_address_line_overflow()
Nvim doesn't use atol() in getdigits() and doesn't need to check for
size of long.
2024-07-14 06:12:42 +08:00
zeertzjq
c31f64dd4d vim-patch:9.1.0577: Unnecessary checks for v:sizeoflong in test_put.vim
Problem:  Unnecessary checks for v:sizeoflong in test_put.vim.  They are
          no longer necessary as patch 8.2.3661 has changed the count to
          be within 32-bit integer limit.
Solution: Remove the checks (zeertzjq).

closes: vim/vim#15239

69a28f6c08
2024-07-14 06:12:41 +08:00
zeertzjq
b1aa8f5eb8
vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682)
Problem:  cannot specify tab page closing behaviour
          (Gianluca Pacchiella)
Solution: Add the 'tabclose' option (LemonBoy).

fixes: vim/vim#5967
closes: vim/vim#15204

5247b0b92e

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-13 08:56:58 +08:00
zeertzjq
028dd3c5c4
vim-patch:9.1.0569: fnamemodify() treats ".." and "../" differently (#29673)
Problem:  fnamemodify() treats ".." and "../" differently.
Solution: Expand ".." properly like how "/.." is treated in 8.2.3388.
          (zeertzjq)

closes: vim/vim#15218

1ee7420460
2024-07-12 14:30:49 +08:00
zeertzjq
83f42aa450 vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting
Problem:  Cannot expand paths from 'cdpath' setting
          (Daniel Hahler)
Solution: Implement 'cdpath' completion, add the new 'dir_in_path'
          completion type (LemonBoy)

fixes vim/vim#374
closes: vim/vim#15205

a20bf69a3b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-12 07:39:36 +08:00
zeertzjq
f1827d877d vim-patch:partial:9.0.0418: manually deleting temp test files
Problem:    Manually deleting temp test files.
Solution:   Use the 'D' flag of writefile() and mkdir().

45bbaef038

This only includes test_cd.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 07:30:21 +08:00
zeertzjq
a61666293d vim-patch:partial:9.0.0323: using common name in tests leads to flaky tests
Problem:    Using common name in tests leads to flaky tests.
Solution:   Rename files and directories to be more specific.

3b0d70f4ff

This only includes test_cd.vim changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 07:30:21 +08:00
zeertzjq
80818641f3 vim-patch:9.1.0567: Cannot use relative paths as findfile() stop directories
Problem:  Cannot use relative paths as findfile() stop directories.
Solution: Change a relative path to an absolute path.
          (zeertzjq)

related: vim/vim#15200
closes: vim/vim#15202

764526e279
2024-07-12 06:49:43 +08:00
zeertzjq
091a130804 vim-patch:9.1.0566: Stop dir in findfile() doesn't work properly w/o trailing slash
Problem:  Stop directory in findfile() doesn't work properly without a
          trailing slash.
Solution: Always use fnamencmp(), not fnamecmp().

related: vim/vim#15200
related: vim/vim#15202

e6ab23bd4a
2024-07-12 06:49:38 +08:00
zeertzjq
50feb85b0c vim-patch:9.1.0565: Stop directory doesn't work properly in 'tags'
Problem:  Stop directory doesn't work properly in 'tags'.
          (Jesse Pavel)
Solution: Also move the stop directory forward by one byte.
          (zeertzjq)

This doesn't support relative stop directories yet, as they are not
supported in other places like findfile() either.

fixes: vim/vim#15200
related: vim/vim#15202

68819afb2c
2024-07-12 06:49:35 +08:00
zeertzjq
2c9e82e193 vim-patch:partial:9.0.0323: using common name in tests leads to flaky tests
Problem:    Using common name in tests leads to flaky tests.
Solution:   Rename files and directories to be more specific.

3b0d70f4ff

This only includes test_findfile.vim changes.

vim-patch:9.1.0562: tests: inconsistency in test_findfile.vim

Problem:  tests: inconsistency in test_findfile.vim, it saves and
          restores 'shellslash', but doesn't actually set it
Solution: Set shellslash explicitly (zeertzjq)

closes: vim/vim#15217

e7b98ab96e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 06:49:33 +08:00
zeertzjq
31d53cbb0f
vim-patch:8.2.3388: fnamemodify('path/..', ':p') differs from using 'path/../' (#29667)
Problem:    fnamemodify('path/..', ':p') differs from using 'path/../'.
Solution:   Include the "/.." in the directory name. (closes vim/vim#8808)

4eaef9979f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-07-12 06:33:54 +08:00
zeertzjq
45b7a2c503
vim-patch:9.1.0557: moving in the buffer list doesn't work as documented (#29653)
Problem:  moving in the buffer list doesn't work as documented
          (SenileFelineS)
Solution: Skip non-help buffers, when run from normal buffers, else
          only move from help buffers to the next help buffer (LemonBoy)

As explained in the help section for :bnext and :bprev the commands
should jump from help buffers to help buffers (and from regular ones to
regular ones).

fixes: vim/vim#4478
closes: vim/vim#15198

893eeeb445

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-11 08:02:59 +08:00
Christian Clason
afbe7736a4 vim-patch:9.1.0555: filetype: angular ft detection is still problematic
Problem:  filetype: angular ft detection is still problematic
          (after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
          do not try to determine it from a generic name like
          '*.component.html'

For the reasons mentioned here:

https://github.com/vim/vim/pull/13594#issuecomment-1834465890

related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604

c03f631b7b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-11 00:41:40 +02:00
zeertzjq
07c1996c8a
vim-patch:9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages (#29651)
Problem:  :bwipe doesn't remove file from jumplist and tagstack of other
          tabpages. Time complexity of mark_forget_file() is O(n^2) when
          removing all entries (after v9.1.0554)
Solution: Use FOR_ALL_TAB_WINDOWS().  Start the loops over the arrays
          from the end instead of the start (zeertzjq)

closes: vim/vim#15199

2e7d89b398
2024-07-11 06:26:22 +08:00
Christian Clason
17bc5af01b vim-patch:9.1.0553: filetype: *.mcmeta files are not recognized
Problem:  filetype: *.mcmeta files are not recognized
Solution: Detect '*.mcmeta' files as json filetype
          (Tomodachi94)

"pack.mcmeta" was added to the JSON tests because that is the most common
filename with that extension.

There are currently 34,000 instances of this file extension on GitHub:
https://github.com/search?q=path%3A*.mcmeta&type=code&p=2

.zip files with this extension have downloads in the millions on sites
like CurseForge:
https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortBy=relevancy&class=texture-packs

Further reading about the file extension:
https://minecraft.wiki/w/Tutorials/Creating_a_resource_pack#Creating_a_.MCMETA_file

closes: vim/vim#15189

d33a518025

Co-authored-by: Tomodachi94 <tomodachi94@protonmail.com>
2024-07-10 09:31:48 +02:00
Christian Clason
7fa089f463 vim-patch:9.1.0551: filetype: htmlangular files are not properly detected
Problem:  filetype: htmlangular files are not properly detected
Solution: Use the new htmlangular filetype for angular files, because
          since angular v17, those are no longer valid HTML files.
          (Dennis van den Berg)

Since Angular 17, the new Control Flow Syntax is not valid HTML. This PR
adds a new filetype detection for the HTML templates of Angular.

It first checks the filename. The Angular convention is to use
*.component.html for the template. However, this is not mandatory.

If the filename does not match, it will check the contents of the file
if it contains:

  - One of the Control-Flow blocks: @if, @for, @switch, @defer
  - A structural directive: *ngIf, *ngFor, *ngSwitch, *ngTemplateOutlet
  - Builtin Angular elements: ng-template or ng-content
  - String interpolation: {{ something }}

This enables the Angular LSP to attach only to htmlangular filetypes, as
well as language parsers, such as tree-sitter.

closes: vim/vim#15190

1ad194c0df

Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
2024-07-10 09:31:48 +02:00
Christian Clason
80530d07e7 vim-patch:9.1.0552: No test for antlr4 filetype
Problem:  No test for antlr4 filetype
          (after 9.1.0550)
Solution: Add a simple filename test

related: vim/vim#15191

8fc23bb8a4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-10 09:31:48 +02:00
zeertzjq
158ffd646d
vim-patch:9.1.0554: :bw leaves jumplist and tagstack data around (#29639)
Problem:  :bw leaves jumplist and tagstack data around
          (Paul "Joey" Clark)
Solution: Wipe jumplist and tagstack references to the wiped buffer
          (LemonBoy)

As documented the :bwipeout command brutally deletes all the references
to the buffer, so let's make it delete all the entries in the jump list
and tag stack referring to the wiped-out buffer.

fixes: vim/vim#8201
closes: vim/vim#15185

4ff3a9b1e3

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 10:35:12 +08:00
zeertzjq
545aafbeb8
vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem:  No way to get the arity of a Vim function
          (Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
          argument info using get(func, "arity") (LemonBoy)

fixes: vim/vim#15097
closes: vim/vim#15109

48b7d05a4f

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-10 08:07:16 +08:00
Christian Clason
bf92d423a9 vim-patch:9.1.0544: filetype: ldapconf files are not recognized
Problem:  filetype: ldapconf files are not recognized
Solution: Detect '.ldaprc', 'ldap.conf' and 'ldaprc' files as ldapconf
          filetype, include a simple ldapconf ftplugin file
          (Riley Bruins)

[Specification](https://www.openldap.org/software//man.cgi?query=ldap.conf&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release)

closes: vim/vim#15176

62f31e9499

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-08 11:03:51 +02:00
zeertzjq
76b91106fc
vim-patch:9.1.0543: Behavior of CursorMovedC is strange (#29608)
Problem:  Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
          (zeertzjq)

fixes: vim/vim#15069
closes: vim/vim#15071

8145620a95
2024-07-08 06:55:21 +08:00
zeertzjq
6a886a2511
vim-patch:9.1.0538: not possible to assign priority when defining a sign (#29592)
Problem:  not possible to assign priority when defining a sign
          (Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
          the sign_define() function (LemonBoy)

Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.

fixes: vim/vim#8334
closes: vim/vim#15124

b975ddfdf9

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-07 07:21:14 +08:00
Christian Clason
472b5b9b20 vim-patch:9.1.0536: filetype: zone files are not recognized
Problem:  filetype: zone files are not recognized
          (rpdprd)
Solution: Detect '*.zone' files as bindzone filetype

fixes: vim/vim#14222

f095539b39

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-07 00:36:40 +02:00
zeertzjq
5da9b49b19
vim-patch:9.1.0537: signed number detection for CTRL-X/A can be improved (#29590)
Problem:  signed number detection for CTRL-X/A can be improved
          (Chris Patuzzo)
Solution: Add the new "blank" value for the 'nrformat' setting. This
          will make Vim assume a signed number only if there is a blank
          in front of the sign.
          (distobs)

fixes: vim/vim#15033
closes: vim/vim#15110

25ac6d67d9

Co-authored-by: distobs <cuppotatocake@gmail.com>
2024-07-07 06:32:54 +08:00
zeertzjq
7a54d707fa
vim-patch:9.1.0534: completion wrong with fuzzy when cycling back to original (#29588)
Problem:  completion wrong with fuzzy when cycling back to original
          (Quan Nguyen)
Solution: reset show_match_ok when cp_score is zero (glepnir)

fixes: vim/vim#15095
closes: vim/vim#15105

65407ce1d2

Co-authored-by: glepnir <glephunter@gmail.com>
2024-07-06 22:44:37 +08:00
Christian Clason
0abaccb2a7 vim-patch:9.1.0532: filetype: Cedar files not recognized
Problem:  filetype: Cedar files not recognized
Solution: Detect '*.cedar' files as cedar filetype
          (Riley Bruins)

References: https://github.com/cedar-policy

closes: vim/vim#15148

15addb24dd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-06 11:05:19 +02:00
zeertzjq
2a883d9c59
vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be removed (#29572)
Problem:  the recursive parameter in the *_equal functions can be removed
Solution: Remove the recursive parameter in dict_equal(), list_equal()
          object_equal and tv_equal(). Use a comparison of the static
          var recursive_cnt == 0 to determine whether or not tv_equal()
          has been called recursively (Yinzuo Jiang).

closes: vim/vim#15070

7ccd1a2e85

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-07-05 15:20:02 +08:00
luukvbaal
3e6cec0bef
vim-patch:9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569)
Problem:  Cursor is moved to bottom of window trying to pagescroll when
          already at the start of the buffer (Asheq Imran, after v9.1.0357)
Solution: Don't move cursor when buffer content did not move.
          (Luuk van Baal)

8ccb89016e
2024-07-05 07:51:34 +08:00
zeertzjq
842725eedc
vim-patch:9.1.0525: Right release selects immediately when pum is truncated. (#29568)
Problem:  Right release selects immediately when pum is truncated.
Solution: Use pum_height instead of pum_size when checking click row.
          Don't place it above mouse row when there is more space below.
          (zeertzjq)

fixes: vim/vim#15101
closes: vim/vim#15102

761a420c66
2024-07-05 07:46:01 +08:00
zeertzjq
6cbba2b48d
vim-patch:9.1.0529: silent! causes following try/catch to not work (#29567)
Problem:  silent! causes following try/catch to not work
          (Malcolm Rowe)
Solution: consider emsg_silent in handle_did_throw() and do not abort
          evaluation flow for :silent! (LemonBoy)

The silent! flag causes the evaluation not to be aborted in case of
uncaught exceptions, adjust handle_did_throw to take this detail into
account.

Fixes the long-standing todo.txt item:
```
Problem that a previous silent ":throw" causes a following try/catch not
to work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
Also see vim/vim#8487 for an example.
```

fixes: vim/vim#538
closes: vim/vim#15128

749ba0f6d9

Cherry-pick Test_deeply_nested_source() from patch 8.2.5169.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-07-05 07:10:30 +08:00
zeertzjq
e7020306a1
feat(jumplist): allow opting out of removing unloaded buffers (#29347)
Problem:  Cannot opt out of removing unloaded buffers from the jumplist.
Solution: Only enable that with "unload" flag in 'jumpoptions'.
2024-06-30 06:40:31 +08:00
Yinzuo Jiang
9e436251de
vim-patch:9.1.0516: need more tests for nested dicts and list comparison (#29481)
Problem:  need more tests for nested dicts and list comparison
Solution: Add tests for comparing deeply nested List/Dict values
          (Yegappan Lakshmanan)

closes: vim/vim#15081

88bbdb04c2

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-06-25 11:34:37 +08:00
Christian Clason
d82efeccc7 vim-patch:9.1.0506: filetype: .envrc & .prettierignore not recognized
Problem:  filetype: .envrc & .prettierignore not recognized
Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore
          filetype (Tyler Miller)

Support ft detection for `.envrc` files used by direnv, and
`.prettierignore` files used by prettier.

closes: vim/vim#15053
resolves: neovim/neovim#29405

49012cd8c2

Co-authored-by: Tyler Miller <tmillr@proton.me>
2024-06-21 11:17:33 +02:00
zeertzjq
1db1476fd9
vim-patch:9.1.0512: Mode message for spell completion doesn't match allowed keys (#29437)
Problem:  Mode message for spell completion doesn't match allowed keys
          (Kyle Kovacs)
Solution: Show "^S" instead of "s".
          (zeertzjq)

This matches the code in vim_is_ctrl_x_key():

	case CTRL_X_SPELL:
	    return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N);

fixes: neovim/neovim#29431
closes: vim/vim#15065

7002c055d5
2024-06-21 14:40:28 +08:00
zeertzjq
f45403db19 vim-patch:9.1.0511: CursorMovedC triggered wrongly with setcmdpos()
Problem:  CursorMovedC triggered wrongly with setcmdpos()
          (after v9.1.0507)
Solution: Remove the premature triggering.  Also don't trigger when
          cursor didn't move. (zeertzjq)

closes: vim/vim#15064

bc6f96708e
2024-06-21 14:13:33 +08:00
zeertzjq
86ea42ce26 vim-patch:9.1.0507: hard to detect cursor movement in the command line
Problem:  hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
          (Shougo Matsushita)

closes: vim/vim#15040

d09521476f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-06-21 14:10:30 +08:00
zeertzjq
af0021f990
vim-patch:9.1.0505: filetype: Faust files are not recognized (#29426)
Problem:  filetype: Faust files are not recognized
Solution: Detect '*.lib' files as Faust filetype, add detection for
          '*.dsp' files (Faust or Make), remove '*.lib' from Cobol
          filetype (PowerUser64)

closes: vim/vim#14894

aa61b8a908

Co-authored-by: PowerUser64 <blake@blakenorth.net>
2024-06-20 17:45:41 +08:00
zeertzjq
978b0263f8
Merge pull request #29413 from jiangyinzuo/vim-patch-9.1.0497
vim-patch:partial:9.1.{0497,0501}: termdebug can be further improved
2024-06-20 12:29:47 +08:00
Yinzuo Jiang
99373c8792 vim-patch:partial:9.1.0501: too complicated mapping restore in termdebug
Problem:  too complicated mapping restore in termdebug
Solution: simplify unmapping logic, add a few more tests
          (Ubaldo Tiberi)

closes: vim/vim#15046

46f2823807

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-06-20 10:49:24 +08:00
zeertzjq
3317aa2f37
vim-patch:9.1.0504: inner-tag textobject confused about ">" in attributes (#29420)
Problem:  inner-tag textobject confused about ">" in attributes
Solution: Skip over quoted '>' when determining the start position

fixes: vim/vim#15043
closes: vim/vim#15049

ca7f93e6f3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-20 09:57:00 +08:00
Yinzuo Jiang
b48192af37 vim-patch:partial:9.1.0497: termdebug can be further improved
Problem:  termdebug can be further improved
Solution: refactor save/restore, update docs,
          add a new save/restore test (Ubaldo Tiberi)

closes: vim/vim#15032

a48637c105

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-06-19 21:23:21 +08:00
zeertzjq
a2a3e8412e vim-patch:8.2.5047: CurSearch highlight is often wrong
Problem:    CurSearch highlight is often wrong.
Solution:   Remember the last highlighted position and redraw when needed.

368137aa52

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-19 08:02:29 +08:00
zeertzjq
a2d510e101
vim-patch:9.1.0499: MS-Windows: doesn't handle symlinks properly (#29400)
Problem:  MS-Windows: doesn't handle symlinks properly
          (Timothy Madden)
Solution: Implement lstat() on MS-Windows
          (author)

lstat() differs from stat() in how it handles symbolic links, the former
doesn't resolve the symlink while the latter does so.

Implement a simple yet effective fallback using Win32 APIs.

fixes vim/vim#14933
closes: vim/vim#15014

23c5ebeb95

Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2024-06-19 06:32:02 +08:00
zeertzjq
4e8ec4900e
vim-patch:9.1.0498: getcmdcompltype() interferes with cmdline completion (#29397)
Problem:  getcmdcompltype() interferes with cmdline completion.
Solution: Don't set expand context when it's already set.
          (zeertzjq)

closes: vim/vim#15036

a821b609f9
2024-06-19 05:47:25 +08:00
zeertzjq
c2491fbab4 vim-patch:9.1.0496: matched text is highlighted case-sensitively
Problem:  matched text is highlighted case-sensitively
Solution: use MB_STRNICMP, update highlighting when the base changes
          (glepnir)

fixes: vim/vim#15021
closes: vim/vim#15023

f189138b39

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-18 06:18:58 +08:00
zeertzjq
c429c5f86f vim-patch:9.1.0495: Matched text isn't highlighted in cmdline pum
Problem:  Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
          (zeertzjq)

closes: vim/vim#15029

d8c9340fc6

Cherry-pick syntax.txt change from runtime update.
2024-06-18 06:18:34 +08:00
zeertzjq
20a7eebec0
vim-patch:9.1.0494: Wrong matched text highlighted in pum with 'rightleft' (#29371)
Problem:  Wrong matched text highlighted in pum with 'rightleft'.
Solution: Match using the original text instead of the reversed text.
          (zeertzjq)

closes: vim/vim#15020

63901e8963
2024-06-17 06:42:11 +08:00
Christian Clason
191a70f9dd vim-patch:9.1.0492: filetype: Vim-script files not detected by shebang line
Problem:  Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)

closes: vim/vim#15012

0d4d23dac0

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-06-16 11:45:44 +02:00
zeertzjq
57c377dfb2
vim-patch:9.1.0493: Test for patch 9.1.0489 doesn't fail without the fix (#29366)
Problem:  Test for patch 9.1.0489 doesn't fail without the fix.
Solution: Use "!" flag of feedkeys() so that ex_normal_busy is not set
          and ins_compl_check_keys() is not skipped (zeertzjq).

closes: vim/vim#15018

acc8746941
2024-06-16 17:30:15 +08:00
zeertzjq
aa319da402
vim-patch:9.1.0489: default completion may break with fuzzy (#29364)
Problem:  default completion may break with fuzzy
Solution: check that completion_match_array is not null
          (glepnir)

closes: vim/vim#15010

aced8c2f4f

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-16 07:07:06 +08:00
zeertzjq
203540926d
vim-patch:9.1.0491: Cmdline pum doesn't work properly with 'rightleft' (#29355)
Problem:  Cmdline pum doesn't work properly with 'rightleft'.
Solution: Don't use curwin->w_p_rl in cmdline mode in pum_redraw().  Use
          a static variable since pum_may_redraw() may be called in any
          mode.  Also correct position of other popups with 'rightleft'.
          (zeertzjq)

closes: vim/vim#15005

883018feff
2024-06-15 22:37:48 +08:00
Christian Clason
4faad4a950 vim-patch:9.1.0486: filetype: Snakemake files are not recognized
Problem:  filetype: Snakemake files are not recognized
Solution: Detect '*.smk' and Snakefile files as snakemake filetype
          (Riley Bruins)

See:
https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility

closes: vim/vim#14992

82a579e15a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15 10:27:59 +02:00
zeertzjq
199d852d9f
vim-patch:9.1.0487: completed item not update on fuzzy completion (#29341)
Problem:  completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
          (glepnir)

closes: vim/vim#14955

f94c9c482a

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 07:20:38 +08:00
zeertzjq
aacd6c440d vim-patch:9.1.0485: Matched text shouldn't be highlighted in "kind" and "menu"
Problem:  Matched text shouldn't be highlighted in "kind" and "menu".
Solution: Pass hlf_T instead of the attribute.  Fix indent.
          (zeertzjq)

closes: vim/vim#14996

afbe5359e9
2024-06-15 04:58:11 +08:00
zeertzjq
dc4037f612 vim-patch:9.1.0476: Cannot see matched text in popup menu
Problem:  Cannot see matched text in popup menu
Solution: Introduce 2 new highlighting groups: PmenuMatch and
          PmenuMatchSel (glepnir)

closes: vim/vim#14694

40c1c3317d

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-15 04:47:23 +08:00
zeertzjq
fd950d4998
vim-patch:9.1.0484: Sorting of completeopt+=fuzzy is not stable (#29338)
Problem:  Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
          (zeertzjq)

closes: vim/vim#14988

8e56747fd2
2024-06-15 04:33:19 +08:00
Yinzuo Jiang
29e05cfb7e
vim-patch:partial:9.1.0482: termdebug plugin needs more love (#29329)
Problem:  termdebug plugin needs more love
Solution: start with some more Vim9 refactoring
          to improve maintenance and readability
          (Ubaldo Tiberi)

List of Changes and the Reasoning Behind Them:

1) Introduction of InitScriptVariables() Function:

Reasoning: This function has been introduced to ensure that when you open and
close Termdebug, and then open it again, there are no leftover script variable
values from the previous session. Leftover values could potentially cause
issues. The goal is for each Termdebug session to be independent of previous
sessions. At startup, all script variables are initialized. The only exception
is g:termdebug_loaded located at the very beginning of the script to prevent
sourcing the script twice. The variables are declared at script level and
defined in InitScriptVariables().

2) More Descriptive Variable Names:

Reasoning: The names of variables have been made more comprehensive. Almost
every Termdebug buffer now has a variable to indicate its name and another
variable to indicate its number, improving code readability and
maintainability. Due to the latest discussion around the &mousemodel option
save/restore mechanism, perhaps some other variables shall be prepended with
saved_.

3) Consistent Naming for GDB Terminal Buffers:

Reasoning: The name of the GDB terminal buffer now matches the name of the GDB
program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This
ensures clarity and consistency in identifying buffers.

4) Other minor improvements:
Moved EchoErr() on top, added another test, some refactoring, mainly changed
several 0 and 1 to true and false

closes: vim/vim#14980

ef8eab86e2

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-06-14 16:37:38 +08:00
zeertzjq
6b022f9d8b
vim-patch:9.1.0483: glob() not sufficiently tested (#29323)
Problem:  glob() not sufficiently tested
Solution: Add more tests for directory containing [] chars

related: vim/vim#14991

8b34aea1b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14 05:48:23 +08:00
zeertzjq
033810ba23
vim-patch:9.1.0477: block_editing errors out when using <enter> (#29294)
Problem:  block_editing errors out when using <enter>
          (Ali Rizvi-Santiago, after v9.1.0274)
Solution: Change ins_len from size_t to int so that the test
          if ins_len is negative actually works properly

Add a test, so that this doesn't regress.

fixes: vim/vim#14960

1fb9eae579

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-12 11:07:36 +08:00
Luuk van Baal
1dcda86559 fix(column): clamp line number for legacy signs
Problem:  Legacy :sign API still allows placing signs beyond the end of
          the buffer. This is unaccounted for by the signcolumn tracking
          logic and is disallowed in general for the extmark API which
          implements it now.
Solution: Clamp legacy sign line number to the length of the buffer.
2024-06-10 20:00:59 +02:00
zeertzjq
1d4e894403 vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'
Problem:  Cannot have buffer-local value for 'completeopt'
          (Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).

Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.

fixes: vim/vim#5487
closes: vim/vim#14922

529b9ad62a
2024-06-06 06:07:31 +08:00
zeertzjq
c235a063d6 vim-patch:9.1.0467: typos in some comments
Problem:  typos in some comments
          (after v9.1.0466)
Solution: fix comments
          (zeertzjq)

closes: vim/vim#14919

551d8c372e
2024-06-06 05:50:12 +08:00
zeertzjq
164338330b vim-patch:9.1.0463: no fuzzy-matching support for insert-completion
Problem:  no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
          using :set completopt+=fuzzy (glepnir).

closes: vim/vim#14878

a218cc6cda

Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-05 15:08:31 +08:00
Christian Clason
2f5b8a0092 vim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: vim/vim#14843

0a0830624a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-06-04 10:38:55 +02:00
zeertzjq
e20c5fba2c
vim-patch:partial:8.2.3637: typos in test files (#29172)
Problem:    Typos in test files.
Solution:   Correct the typos. (Dominique Pellé, closes vim/vim#9175)

923dce2b07

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2024-06-04 06:07:20 +08:00
Christian Clason
659d3dcd2e vim-patch:9.1.0460: filetype: lintstagedrc files are not recognized
Problem:  filetype: lintstagedrc files are not recognized
Solution: recognize '.lintstagedrc' files as json filetype
          (İlyas Akın)

see: https://github.com/lint-staged/lint-staged

closes: vim/vim#14897

7577afd5ef

Co-authored-by: İlyas Akın <ilyas.akin@kuika.com>
2024-06-02 23:01:20 +02:00
zeertzjq
0e49c3ad1a vim-patch:9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0
Problem:  Left shift is incorrect with vartabstop and shiftwidth=0
Solution: make tabstop_at() function aware of shift direction
          (Gary Johnson)

The problem was that with 'vartabstop' set and 'shiftwidth' equal 0,
left shifts using << were shifting the line to the wrong column.  The
tabstop to the right of the first character in the line was being used
as the shift amount instead of the tabstop to the left of that first
character.

The reason was that the tabstop_at() function always returned the value
of the tabstop to the right of the given column and was not accounting
for the direction of the shift.

The solution was to make tabstop_at() aware of the direction of the
shift and to choose the tabtop accordingly.

A test was added to check this behavior and make sure it doesn't
regress.

While at it, also fix a few indentation/alignment issues.

fixes: vim/vim#14864
closes: vim/vim#14887

88d4f255b7

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2024-06-02 06:06:34 +08:00
zeertzjq
6f87779857 vim-patch:8.2.4452: test for what 8.2.4436 fixes does not check for regression
Problem:    Test for what 8.2.4436 fixes does not check for regression.
Solution:   Set several options. (Ken Takata, closes vim/vim#9830)

2dada73a4e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 06:06:34 +08:00
zeertzjq
7cbfbd3ae1 vim-patch:8.2.4437: vartabs test fails on MS-Windows
Problem:    Vartabs test fails on MS-Windows.
Solution:   Use iso8859-1 'encoding'. (Ken Takata, closes vim/vim#9818)

0f113e4f7b

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-06-02 06:06:34 +08:00
zeertzjq
c81ad884c7 vim-patch:8.2.4436: crash with weird 'vartabstop' value
Problem:    Crash with weird 'vartabstop' value.
Solution:   Check for running into the end of the line.

4e889f98e9

Code change is N/A as it's superseded by virtual text changes.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-06-02 06:06:34 +08:00
Christian Clason
9b3dfa3ac0 vim-patch:9.1.0454: minor issues in test_filetype with rasi test
Problem:  minor issues in test_filetype with rasi test
          (after 9.1.0453)
Solution: re-sort test_filetype, fix wrong syntax.txt help tags

f3dd6f617c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-31 14:11:20 +02:00
Christian Clason
07af492f63 vim-patch:9.1.0453: filetype: rasi files are not recognized
Problem:  filetype: rasi files are not recognized
Solution: regonize '*.rasi' files as rasi filetype,
          include a filetype and syntax plugin
          (Pierrick Guillaume)

ported from: https://github.com/Fymyte/rasi.vim

closes: vim/vim#14821

280e5b13ca

Co-authored-by: Pierrick Guillaume <pierguill@gmail.com>
2024-05-31 14:11:20 +02:00
zeertzjq
2de12e9bd7 vim-patch:9.1.0451: No test for escaping '<' with shellescape()
Problem:  No test for escaping '<' with shellescape()
Solution: Add a test.  Use memcpy() in code to make it easier to
          understand.  Fix a typo (zeertzjq).

closes: vim/vim#14876

88c8c547d5
2024-05-31 05:52:53 +08:00
zeertzjq
40679c764a
vim-patch:8.2.3061: testing the shell option is incomplete and spread out (#29090)
Problem:    Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
            Lakshmanan, closes vim/vim#8464)

054794c20f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-05-30 14:39:48 +08:00
glepnir
dbc2678f46
vim-patch:9.1.0447: completion may be wrong when deleting all chars (#29040)
Problem:  completion may be wrong when deleting all chars.
Solution: reset compl_shown_match (glepnir).

closes: https://github.com/vim/vim/pull/14854

53387c55a1
2024-05-27 22:02:24 +08:00
zeertzjq
22fe04452e
vim-patch:9.1.0446: getregionpos() inconsistent for partly-selected multibyte char (#29032)
Problem:  getregionpos() behaves inconsistently for a partly-selected
          multibyte char.
Solution: Always use column of the first byte for a partly-selected
          multibyte char (zeertzjq).

closes: vim/vim#14851

ef73374dc3
2024-05-27 05:50:49 +08:00
zeertzjq
3d39ea3ea9
vim-patch:9.1.0442: hare runtime files outdated (#29011)
Problem:  hare runtime files outdated
Solution: runtime(hare): update hare.vim to match upstream
          (Amelia Clarke)

closes: vim/vim#14836

35dfe58a54

Co-authored-by: Amelia Clarke <selene@perilune.dev>
2024-05-26 07:11:50 +08:00
zeertzjq
4757d497f3
vim-patch:9.1.0444: Not enough tests for getregion() with multibyte chars (#29000)
Problem:  Not enough tests for getregion() with multibyte chars.
Solution: Add a few more tests (zeertzjq).

closes: vim/vim#14844

dff55a3358
2024-05-25 16:53:10 +08:00
zeertzjq
06347a64ca
vim-patch:9.1.0443: Can't use blockwise selection with width for getregion() (#28985)
Problem:  Can't use a blockwise selection with a width for getregion().
Solution: Add support for blockwise selection with width like the return
          value of getregtype() or the "regtype" value of TextYankPost
          (zeertzjq).

closes: vim/vim#14842

afc2295c22
2024-05-25 05:19:46 +08:00
zeertzjq
8db9a0e5a2
vim-patch:8.2.3158: strange error message when using islocked() with a number (#28962)
Problem:    Strange error message when using islocked() with a number.
            (Yegappan Lakshmanan)
Solution:   Check that the name is empty.

1840a7b4e3

Use ll_name_len instead.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-05-24 18:29:17 +08:00
zeertzjq
4f431bb632
vim-patch:9.1.0439: Cannot filter the history (#28958)
Problem:  Cannot filter the history
Solution: Implement :filter :history

closes: vim/vim#14835

42a5b5a6d0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-24 15:45:07 +08:00
zeertzjq
cd05fbef17
vim-patch:9.1.0441: getregionpos() can't properly indicate positions beyond eol (#28957)
Problem:  getregionpos() can't properly indicate positions beyond eol.
Solution: Add an "eol" flag that enables handling positions beyond end
          of line like getpos() does (zeertzjq).

Also fix the problem that a position still has the coladd beyond the end
of the line when its column has been clamped.  In the last test case
with TABs at the end of the line the old behavior is obviously wrong.

I decided to gate this behind a flag because returning positions that
don't correspond to actual characters in the line may lead to mistakes
for callers that want to calculate the length of the selected text, so
the behavior is only enabled if the caller wants it.

closes: vim/vim#14838

2b09de9104
2024-05-24 15:44:52 +08:00
zeertzjq
c836383d21
vim-patch:9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter (#28956)
Problem:  Wrong Ex command executed when :g uses '?' as delimiter and
          pattern contains escaped '?'.
Solution: Don't use "*newp" when it's not allocated (zeertzjq).

closes: vim/vim#14837

3074137542
2024-05-24 15:04:33 +08:00
zeertzjq
e7859d2ad5
vim-patch:9.1.0436: Crash when using '?' as separator for :s (#28955)
Problem:  Crash when using '?' as separator for :s and pattern contains
          escaped '?'s (after 9.1.0409).
Solution: Always compute startplen. (zeertzjq).

related: neovim/neovim#28935
closes: 14832

789679cfc4
2024-05-24 05:57:00 +08:00
Christian Clason
0d3d198109 vim-patch:9.1.0435: filetype: cygport files are not recognized
Problem:  filetype: cygport files are not recognized
Solution: Recognize '*.cygport' files as sh filetype
          (Ken Takata)

https://cygwin.github.io/cygport/cygport_in.html

closes: vim/vim#14833

cd79f8fbd3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-05-23 23:47:13 +02:00
zeertzjq
bdf15dbe69
vim-patch:9.1.0433: Wrong yanking with exclusive selection and ve=all (#28933)
Problem:  Wrong yanking with exclusive selection and virtualedit=all,
          and integer overflow when using getregion() on it.
Solution: Set coladd when decreasing column and 'virtualedit' is active.
          Add more tests for getregion() with 'virtualedit' (zeertzjq).

closes: vim/vim#14830

701ad50a9e
2024-05-23 14:23:09 +08:00
zeertzjq
5cbd6d9b9f
vim-patch:9.1.0430: getregionpos() doesn't handle one char selection (#28924)
Problem:  getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
          Also add a test for an exclusive charwise selection with
          multibyte chars (zeertzjq)

closes: vim/vim#14825

52a6f34887
2024-05-23 06:08:24 +08:00
zeertzjq
10601ac5fa
vim-patch:62ccaa6: runtime(termdebug): check for gdb file/dir before using as buffer name (#28908)
Add test so that this doesn't regress.

fixes: vim/vim#12718
closes: vim/vim#14792

62ccaa60d5

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2024-05-22 08:41:07 +08:00
zeertzjq
81a1d7258c
vim-patch:9.1.0427: tests: some issues with termdebug mapping test (#28907)
Problem:  tests: some issues with termdebug mapping test
Solution: Use assert_{true,false} if suitable, change
          order of expected and actual arguments in assert() calls.
          (Ken Takata)

closes: vim/vim#14818
related: 7fbbd7f

ffed1540f3

Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-05-22 07:19:12 +08:00
zeertzjq
59fe8ffdea vim-patch:9.1.0428: Tag guessing leaves wrong search history with very short names
Problem:  Tag guessing leaves wrong search history with very short names
          (after 9.1.0426).
Solution: Use the correct variable for pattern length (zeertzjq).

closes: vim/vim#14817

42cd192daa

Cherry-pick Test_tagbsearch() changes from patch 9.0.0767.
2024-05-22 06:37:26 +08:00
zeertzjq
91892f56b6
vim-patch:9.1.0399: block_editing errors out when using del (#28867)
Problem:  block_editing errors out when using del
          (@Jamarley)
Solution: Change ins_len from size_t to int and
          properly check that it doesn't become negative

There is a check in os.c that verifies that `ins_len` does not become
negative:
```
if (pre_textlen >= 0 && (ins_len = len - pre_textlen - offset) > 0)
```
However this only works, if ins_len can actually become negative and
unfortunately, ins_len has been declared as `size_t` so instead of
becoming negative it will wrap around and be very large.

So let's define it as integer, after which the condition above
properly catches this condition.

fixes: vim/vim#14734
closes: vim/vim#14735

d5c8c0920e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-20 21:45:02 +08:00
zeertzjq
e0259b9466 vim-patch:9.1.0423: getregionpos() wrong with blockwise mode and multibyte
Problem:  getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
          Handle coladd properly (zeertzjq).

Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.

closes: vim/vim#14805

c95e64f41f
2024-05-20 20:59:54 +08:00
zeertzjq
d89144626e vim-patch:9.1.0394: Cannot get a list of positions describing a region
Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

b4757e627e

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2024-05-20 20:50:08 +08:00
Christian Clason
5c2616846a vim-patch:9.1.0425: filetype: purescript files are not recognized
Problem:  filetype: purescript files are not recognized
Solution: recognize '*.purs' files as purescript filetype,
          include basic purescript filetype plugin
          (Riley Bruins)

Reference: https://github.com/purescript/documentation/blob/master/language/Syntax.md#comments

closes: vim/vim#14813

155583a5c3

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
70c0b03e61 vim-patch:9.1.0424: filetype: slint files are not recognized
Problem:  filetype: slint files are not recognized
Solution: Detect '*.slint' files as slint filetype,
          include basic sling filetype plugin
          (Riley Bruins)

closes: vim/vim#14808

aa3104b07a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 14:43:12 +02:00
Christian Clason
b16b287b8f vim-patch:9.1.0421: filetype: hyprlang files are not recognized
Problem:  filetype: hyprlang files are not recognized
Solution: recognize 'hypr{land,paper,idle,lock}.conf' files
          as 'hyprlang' filetype, add hyprlang ftplugin
          (Riley Bruins)

closes: vim/vim#14803

5f1b115afd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-05-20 00:13:40 +02:00
zeertzjq
62eb7e79a5
vim-patch:9.1.0418: Cannot move to previous/next rare word (#28822)
Problem:  Cannot move to previous/next rare word
          (Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)

fixes: vim/vim#14773
closes: vim/vim#14780

8e4c4c7d87

Co-authored-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
2024-05-18 07:09:05 +08:00
Luuk van Baal
f178b8ba49 vim-patch:9.1.0414: Unable to leave long line with 'smoothscroll' and 'scrolloff'
Problem:  Unable to leave long line with 'smoothscroll' and 'scrolloff'.
          Corrupted screen near the end of a long line with 'scrolloff'.
          (Ernie Rael, after 9.1.0280)
Solution: Only correct cursor in case scroll_cursor_bot() was not itself
          called to make the cursor visible. Avoid adjusting for
          'scrolloff' beyond the text line height (Luuk van Baal)

b32055e504

vim-patch:9.1.0416: some screen dump tests can be improved

Problem:  some screen dump tests can be improved (after 9.1.0414)
Solution: Make sure screen state changes properly and is captured in the
          screen dumps (Luuk van Baal)

2e642734f4
2024-05-17 20:28:14 +02:00
zeertzjq
acaac07b64
vim-patch:9.1.0413: smoothscroll may cause infinite loop (#28763)
Problem:  smoothscroll may cause infinite loop, with
          very narrow windows
          (Jaehwang Jung, after v9.1.0280)
Solution: Check for width1 being negative, verify
          that win_linetabsize does not overflow

fixes: vim/vim#14750
closes: vim/vim#14772

eff20eb35d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-05-16 05:36:24 +08:00
luukvbaal
e1a81c8d8b
vim-patch:9.1.0407: Stuck with long line and half-page scrolling (#28704)
Problem:  No scrolling happens with half-page scrolling with line
          filling entire window when 'smoothscroll' is disabled.
          (Mathias Rav, after v9.1.0285)
Solution: Adjust amount to move cursor by so that it is moved the same
          number of lines as was scrolled, even when scrolling different
          number of lines than requested with 'nosmoothscroll'.

58448e09be
2024-05-11 18:17:57 +08:00
zeertzjq
14693353d5
vim-patch:9.1.0406: Divide by zero with getmousepos() and 'smoothscroll' (#28701)
Problem:  Divide by zero with getmousepos() and 'smoothscroll'.
Solution: Don't compute skip_lines when width1 is zero.
          (zeertzjq)

closes: vim/vim#14747

031a745608
2024-05-11 17:46:22 +08:00
Christian Clason
a6873450b9 vim-patch:9.1.0402: filetype: mdd files detected as zsh filetype
Problem:  filetype: mdd files detected as zsh filetype
Solution: detect '*.mdd' files as sh filetype, add links
          to reference documentation (Wu, Zhenyu)

closes: vim/vim#14741

63f2a5b8ad

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-05-11 09:13:57 +02:00
Christian Clason
a9fd17e232 vim-patch:9.1.0401: filetype: zsh module files are not recognized
Problem:  filetype: zsh module files are not recognized
Solution: Detect '*.mdh' and '*.epro' as C filetype, '*.mdd' as zsh
          filetype, determine zsh-modules '*.pro' from from it's content
          (Wu, Zhenyu)

closes: vim/vim#14737

887a38cee7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-05-11 09:13:57 +02:00
Gregory Anders
d3fa88b70f
vim-patch:9.1.0396: filetype: jj files are not recognized (#28672)
Problem:  jj files are not recognized
Solution: recognize '*.jjdescription' files as jj filetype
          (Gregory Anders)

See: https://github.com/martinvonz/jj

closes: vim/vim#14733

6a4ea471d2
2024-05-08 18:39:18 -05:00
zeertzjq
e4e230a0cd
vim-patch:9.1.0397: Wrong display with 'smoothscroll' when changing quickfix list (#28674)
Problem:  Wrong display with 'smoothscroll' when changing quickfix list.
Solution: Reset w_skipcol when replacing quickfix list (zeertzjq).

closes: vim/vim#14730

c7a8eb5ff2
2024-05-09 06:11:56 +08:00
Christian Clason
2becec289c vim-patch:9.1.0390: filetype: inko files are not recognized
Problem:  filetype: inko files are not recognized
Solution: Detect '*.inko' as ink filetype
          (Yorick Peterse)

See:
- https://github.com/inko-lang/inko.vim
- https://inko-lang.org/

closes: vim/vim#14699

a01968448a

Co-authored-by: Yorick Peterse <git@yorickpeterse.com>
2024-05-02 14:14:56 +02:00
Christian Clason
ebf8237af8 vim-patch:9.1.0389: filetype: templ files are not recognized
Problem:  filetype: templ files are not recognized
Solution: Detect '*.templ' files as filetype templ
          (Tristan Knight)

See:
- https://github.com/a-h/templ
- https://templ.guide/

closes: vim/vim#14697

54e79157c5

Co-authored-by: tris203 <admin@snappeh.com>
2024-05-02 14:14:56 +02:00
zeertzjq
c4627676f9
vim-patch:9.1.0388: cursor() and getregion() don't handle v:maxcol well (#28602)
Problem:  cursor() and getregion() don't handle v:maxcol well.
Solution: Add special handling for v:maxcol like setpos() does.
          (zeertzjq)

closes: vim/vim#14698

2ffdae7948
2024-05-02 19:33:54 +08:00
Christian Clason
9e2f378b6d vim-patch:9.1.0386: filetype: stylus files not recognized
Problem:  filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
          include indent, filetype and syntax plugin
          (Philip H)

closes: vim/vim#14656

2d919d2744

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-05-02 00:37:16 +02:00
Christian Clason
b5583acc48 vim-patch:9.1.0383: filetype: .out files recognized as tex files
Problem:  filetype: .out files recognized as tex files
Solution: Do not set an explicit filetype until it is clear what this
          should be (shane.xb.qian)

closes: vim/vim#14670

e35478bc9d

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-05-01 10:34:03 +02:00
Christian Clason
e7ae913953 vim-patch:9.1.0382: filetype: Kbuild files are not recognized
Problem:  Kbuild files are not recognized.
Solution: Detect Kbuild files as make files.
          (Bruno Belanyi)

closes: vim/vim#14676

5cbc9a69e5

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-05-01 10:34:03 +02:00
zeertzjq
efaf37a2b9
test(old): restore default 'grepprg' and 'grepformat' (#28574)
This prevents test failure when "rg" is executable.
2024-04-30 07:44:25 +08:00
dundargoc
234b5f6701
docs: various fixes (#28208)
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@proton.me>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Guilherme Soares <guilhermesoares1970@gmail.com>
Co-authored-by: Jannik Buhr <jannik.m.buhr@gmail.com>
Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com>
Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-04-30 07:04:42 +08:00
zeertzjq
f59db07cdc
vim-patch:9.1.0381: cbuffer and similar commands don't accept a range (#28571)
Problem:  cbuffer and similar quickfix and locationlist commands don't
          accept a range, even so it is documented they should
          (ilan-schemoul, after 8.1.1241)
Solution: Define ex commands with ADDR_LINES instead of ADDR_OTHER

fixes: vim/vim#14638
closes: vim/vim#14657

652c821366

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-30 06:02:38 +08:00
zeertzjq
41ceadd458
vim-patch:9.1.0375: tests: 1-second delay after Test_BufEnter_botline() (#28534)
Problem:  tests: 1-second delay after Test_BufEnter_botline()
          (after v9.1.0374)
Solution: Wipe the created buffers (zeertzjq).

closes: vim/vim#14647

340643e977
2024-04-27 18:02:18 +08:00
zeertzjq
435dee74bb
vim-patch:9.1.0374: wrong botline in BufEnter (#28530)
Problem:  When :edit an existing buffer, line('w$') may return a
          wrong result.
Solution: Reset w_valid in curwin_init() (Jaehwang Jung)

`do_ecmd()` reinitializes the current window (`curwin_init()`) whose
`w_valid` field may have `VALID_BOTLINE` set. Resetting `w_botline`
without marking it as invalid makes subsequent `validate_botline()`
calls a no-op, thus resulting in wrong `line('w$')` value.

closes: vim/vim#14642

eb80b8304e

Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2024-04-27 06:32:25 +08:00
dundargoc
052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00
Christian Clason
aef120d1e9 vim-patch:9.1.0366: filetype: ondir files are not recognized
Problem:  filetype: ondir files are not recognized
Solution: Detect '.ondirrc' as ondir filetype
          (Jon Parise)

closes: vim/vim#14604

ea999037a4

Co-authored-by: Jon Parise <jon@indelible.org>
2024-04-23 09:38:46 +02:00
zeertzjq
3305bb9e41
vim-patch:9.1.0364: tests: test_vim9_builtin is a bit slow (#28466)
Problem:  tests: test_vim9_builtin is a bit slow
Solution: source tests from a buffer instead of
          writing and sourcing a file (Yegappan Lakshmanan)

closes: vim/vim#14614

22697b6179

N/A patch:
vim-patch:9.1.0299: Vim9: return type not set for a lambda assigned to script var

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-23 08:28:51 +08:00
zeertzjq
d0ab67410c
vim-patch:9.1.0365: Crash when typing many keys with D- modifier (#28464)
Problem:  Crash when typing many keys with D- modifier (after 9.1.0227).
Solution: Don't treat a 0x80 byte inside a special sequence as the start
          of a special sequence (zeertzjq).

closes: vim/vim#14613

6b13e3d4e4
2024-04-23 08:18:42 +08:00
luukvbaal
ea1c9f60e0
vim-patch:9.1.0357: Page scrolling should place cursor at window boundaries (#28429)
Problem:  Page scrolling does not always place the cursor at the top or
          bottom of the window (Mathias Rav)
Solution: Place the cursor at the top or bottom of the window.
          (Luuk van Baal)

4b6b0c4024
2024-04-22 21:24:32 +08:00
zeertzjq
35e38833c5
vim-patch:9.1.0363: tests: test_winfixbuf is a bit slow (#28446)
Problem:  tests: test_winfixbuf is a bit slow
Solution: use defer if possible, reset hidden option, use --not-a-term
          when starting Vim using system() (Yegappan Lakshmanan)

closes: vim/vim#14611

4baf908d60

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-22 06:24:22 +08:00
Christian Clason
52d2851ca4 vim-patch:9.1.0355: filetype: flake.lock files are not recognized
Problem:  filetype: flake.lock files are not recognized
Solution: Detect 'flake.lock' as json filetype
          (Riley Bruins)

closes: vim/vim#14589

ce736033ae

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-04-19 16:09:41 +02:00
zeertzjq
8d77061051
vim-patch:9.1.0354: runtime(uci): No support for uci file types (#28409)
Problem:  runtime(uci): No support for uci file types
          (Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
          (Colin Caine)

closes: vim/vim#14575

4b3fab14db

Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-19 14:50:12 +08:00
zeertzjq
13ebfafc95
vim-patch:9.1.0351: No test that completing a partial mapping clears 'showcmd' (#28406)
Problem:  No test that completing a partial mapping clears 'showcmd'.
Solution: Complete partial mappings in Test_showcmd_part_map() instead
          of using :echo.  Adjust some comments (zeertzjq).

closes: vim/vim#14580

094c4390bd
2024-04-19 05:45:25 +08:00
zeertzjq
562719033e
vim-patch:9.1.0343: 'showcmd' wrong for partial mapping with multibyte (#28392)
Problem:  'showcmd' is wrong for partial mapping with multibyte char,
          and isn't very readable with modifyOtherKeys.
Solution: Decode multibyte char and merge modifiers into the char.
          (zeertzjq)

This improves the following situations:
- Multibyte chars whose individual bytes are considered unprintable are
  now shown properly in 'showcmd' area.
- Ctrl-W with modifyOtherKeys now shows ^W in 'showcmd' area.

The following situation may still need improvement:
- If the char is a special key or has modifiers that cannot be merged
  into it, internal keycodes are shown in 'showcmd' area like before.
  This applies to keys typed in Normal mode commands as well, and it's
  hard to decide how to make it more readable due to the limited space
  taken by 'showcmd', so I'll leave it for later.

closes: vim/vim#14572

acdfb8a979
2024-04-18 06:23:11 +08:00
zeertzjq
de6eb96fc9
vim-patch:9.1.0344: Cursor wrong after using setcellwidth() in terminal (#28391)
Problem:  Cursor wrong after using setcellwidth() in terminal
          (mikoto2000)
Solution: output additional spaces, so the behaviour matches the GUI
          (mikoto2000)

fixes: vim/vim#14539
closes: vim/vim#14540

Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.

e20fa59903

This is already fixed and tested in Nvim in #28322.

Co-authored-by: mikoto2000 <mikoto2000@gmail.com>
2024-04-18 05:41:19 +08:00
zeertzjq
2f371ad7d0
vim-patch:9.1.0341: Problem: a few memory leaks are found (#28382)
Problem:  a few memory leaks are found
          (LuMingYinDetect )
Solution: properly free the memory

Fixes the following problems:
- Memory leak in f_maplist()
  fixes: vim/vim#14486

- Memory leak in option.c
  fixes: vim/vim#14485

- Memory leak in f_resolve()
  fixes: vim/vim#14484

- Memory leak in f_autocmd_get()
  related: vim/vim#14474

- Memory leak in dict_extend_func()
  fixes: vim/vim#14477
  fixes: vim/vim#14238

closes: vim/vim#14517

29269a71b5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:52:29 +08:00
zeertzjq
0b2b1b0185
vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)
Problem:  Error with matchaddpos() and empty list
          (@rickhow)
Solution: Return early for an empty list

fixes: vim/vim#14525
closes: vim/vim#14563

f7d31adcc2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:49:23 +08:00
zeertzjq
e3c083832c
vim-patch:9.1.0335: String interpolation fails for List type (#28364)
Problem:  String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
          (Yegappan Lakshmanan)

related: vim/vim#14529
closes: vim/vim#14556

bce51d9005

Cherry-pick eval_to_string_eap() from patch 8.2.1914.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 10:18:24 +08:00
zeertzjq
b1e8b799a5
vim-patch:9.1.0332: tests: some assert_equal() calls have wrong order of args (#28363)
Problem:  tests: some assert_equal() calls have wrong order of args
Solution: Correct the order (zeertzjq).

closes: vim/vim#14555

757f32141b
2024-04-16 10:00:48 +08:00
zeertzjq
fb7ffac69f
vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)
Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
2024-04-16 09:33:33 +08:00
zeertzjq
07661009c5
vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)
vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

62c09e032c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: bfrg <bfrg@users.noreply.github.com>
2024-04-16 09:33:16 +08:00
zeertzjq
14fb2ef4fb
vim-patch:8.2.3415: Vim9: not all function argument types are properly checked (#28362)
Problem:    Vim9: Not all function argument types are properly checked.
Solution:   Add and improve argument type checks. (Yegappan Lakshmanan,
            closes vim/vim#8839)

fc3b775055

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 09:32:36 +08:00
zeertzjq
ca2f24cbbd vim-patch:9.1.0324: filetype: some json files are not recognized
Problem:  filetype: some json files are not recognized
Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype
          (Wu, Zhenyu)

See:
- https://github.com/microsoft/PowerToys/blob/main/.vsconfig
- https://jscs-dev.github.io/

closes: vim/vim#14452

c59a8648b2

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:32:08 +08:00
zeertzjq
6717cc5b41 vim-patch:9.1.0322: filetype: some mail tools not recognized
Problem:  filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
          and '.notmuch-config' as ini filetype
          (Shane-XB-Qian)

closes: vim/vim#14533

a7a9a476cf

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-04-16 08:19:17 +08:00
zeertzjq
b35f08ddb1
vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354)
Problem:  No test for highlight behavior with 'ambiwidth'.
Solution: Add a screendump test for 'ambiwidth' with 'cursorline'.
          (zeertzjq)

closes: vim/vim#14554

a59e031aa0
2024-04-16 06:50:23 +08:00
zeertzjq
ba24dab8d6 vim-patch:9.1.0328: CI fails with t_?? test
Problem:  CI fails with t_?? test
Solution: use assert_match instead of assert_equal
          and test only until t_xo, depending on system
          there may be several more termcap codes coming

0d87e3c711

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-15 08:00:29 +08:00
zeertzjq
dea0d50f7f vim-patch:9.1.0321: Garbled output on serial terminals with XON/XOFF flow control
Problem:  When used terminal with XON/XOFF flow control, vim tries to
          still make CTRL-S mapping available, which results in severe
          screen corruption, especially on large redraws, and even
          spurious inputs (John Tsiombikas)
Solution: Disallow CTRL-S mapping if such terminal is recognized.
          Don't remove IXON from the bitmask inversion.
          (Anton Sharonov)

*** When started like this:

    TERM=vt420 vim

:set termcap

    shows "t_xon=y"

map <C-S> :echo "abc"<CR>

    does nothing (after <C-S> output freezes and subsequent <C-Q>
    unfreezes it)

*** When started like this:

    TERM=xterm vim

:set termcap

    shows "t_xon="

map <C-S> :echo "abc"<CR>

    works (after <C-S> one see "abc" string echo-ed)

fixes: vim/vim#12674
closes: vim/vim#14542

49528da8a6

Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
2024-04-15 07:59:45 +08:00
zeertzjq
43f8d7e3ef
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
zeertzjq
6685481dfa
vim-patch:9.1.0320: Wrong cursor position after using setcellwidths() (#28334)
Problem:  Wrong cursor position after using setcellwidths().
Solution: Invalidate cursor position in addition to redrawing.
          (zeertzjq)

closes: vim/vim#14545

05aacec6ab

Reorder functions in test_utf8.vim to match upstream.
2024-04-15 06:11:30 +08:00
zeertzjq
1d73ecda7f
vim-patch:9.1.0319: Using heredoc in string not tested with :execute (#28333)
Problem:  Using heredoc in string not tested with :execute.
Solution: Test with both :execute and execute() (zeertzjq).

closes: vim/vim#14546

3d93630605
2024-04-15 04:15:43 +08:00
Christian Clason
4ca6e08327 vim-patch:9.1.0318: filetype: translate shell config files are not recognized
Problem:  filetype: translate shell config files are not recognized
Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as
          clojure (Wu, Zhenyu)

See: https://github.com/soimort/translate-shell/wiki/Configuration

closes: vim/vim#14499

4b5cd7257e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
391200f198 vim-patch:9.1.0317: filetype: matplotlibrc files are not recognized
Problem:  filetype: matplotlibrc files are not recognized
Solution: Detect 'matplotlibrc' file as yaml filetype
          (Wu, Zhenyu)

See: https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file

closes: vim/vim#14501

55d4f3c006

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
737091d234 vim-patch:9.1.0316: filetype: some sh and confini files not recognized
Problem:  filetype: some sh and confini files not recognized
Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files,
          paru and makepkg config files
          (Wu, Zhenyu)

See:
- https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location
- https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

closes: vim/vim#14505

5a9f7e6750

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
420f130223 vim-patch:9.1.0315: filetype: a few more dosini files are not recognized
Problem:  filetype: a few more dosini files are not recognized
Solution: Detect wakatime, reply config files, flatpak, nfs config files
          and a few more python tools as dosini (or toml)
          (Wu, Zhenyu)

Refer:
- https://packaging.python.org/en/latest/specifications/pypirc/
- https://jorisroovers.com/gitlint/latest/configuration/
- https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options
- https://docs.bpython-interpreter.org/en/latest/configuration.html
- https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
- https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
- https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage
- https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc

close: vim/vim#14512

0881329d12

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
zeertzjq
e81fe387d6 vim-patch:9.1.0313: Crash when using heredoc with comment in command block
Problem:  Crash when using heredoc with comment in command block.
Solution: Handle a newline more like the end of the line, fix coverity
          warning (zeertzjq).

closes: vim/vim#14535

1f5175d9af
2024-04-14 05:06:50 +08:00
zeertzjq
617a385142 vim-patch:9.1.0312: heredocs are not supported for :commands
Problem:  heredocs are not supported for :commands
          (balki)
Solution: Add heredoc support
          (Yegappan Lakshmanan)

fixes: vim/vim#14491
closes: vim/vim#14528

e74cad3321

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-14 05:03:31 +08:00
zeertzjq
355c149ba0
vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)
Problem:  Some config files are not recognized
Solution: Add some patterns for chktex, ripgreprc and ctags config
          files.

See: https://www.nongnu.org/chktex/
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files

closes: vim/vim#14506

a1dcd76ce7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-13 09:59:53 +08:00
zeertzjq
a629978cb6
vim-patch:9.1.0305: filetype: some history files are not recognized (#28300)
Problem:  filetype: some history files are not recognized
Solution: Add some history patterns to filetype.vim
          (Wu, Zhenyu)

closes: vim/vim#14513

da70feabea

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 18:08:54 +08:00
zeertzjq
8c112a8235 vim-patch:9.1.0307: filetype: texdoc config files is not recognized
Problem:  filetype: texdoc config files is not recognized
Solution: Detect 'texdoc.cnf' as conf filetype
          (Wu, Zhenyu)

See: https://github.com/TeX-Live/texdoc/blob/master/texdoc.cnf

closes: vim/vim#14507

7fdbd1bb58

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:22:16 +08:00
zeertzjq
be7d8ff0e4 vim-patch:9.1.0306: filetype: x11vnc config file is not recognized
Problem:  filetype: x11vnc config file is not recognized
Solution: Detect '.x11vncrc' as conf filetype
          (Wu, Zhenyu)

See: https://linux.die.net/man/1/x11vnc

closes: vim/vim#14511

58ce78ad43

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:21:28 +08:00
zeertzjq
7334e9055b vim-patch:9.1.0295: filetype: pip config files are not recognized
Problem:  filetype: pip config files are not recognized
Solution: detect pip.conf as dosini filetype
          (Wu, Zhenyu)

closes: vim/vim#14448

d2b95b8446

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:19:10 +08:00
zeertzjq
60ced890f3 vim-patch:9.1.0293: filetype: lxqt config files are not recognized
Problem:  filetype: lxqt config files are not recognized
Solution: Detect {lxqt,screengrab}/*.conf files as dosini,
          fix failing filetype test for */tex/latex/**.cfg
          (Wu, Zhenyu)

closes: vim/vim#14450

41208884b8

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:17:39 +08:00
zeertzjq
b0ded42680 vim-patch:9.1.0292: filetype: XDG mimeapps.list file is not recognized
Problem:  filetype: XDG mimeapps.list file is not recognized
Solution: Detect mimeapps.list as dosini filetype
          (Wu, Zhenyu)

Refer: https://wiki.archlinux.org/title/XDG_MIME_Applications#Format

closes: vim/vim#14451

efd752ec38

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:15:44 +08:00
zeertzjq
07c5969aa9 vim-patch:9.1.0291: filetype: libreoffice config files are not recognized
Problem:  filetype: libreoffice config files are not recognized
Solution: Detect Libreoffice config fils as xml/dosini
          (Wu, Zhenyu)

closes: vim/vim#14453

73c89bcf79

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:14:43 +08:00
zeertzjq
611cc7de43
vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)
Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

1492fe6903

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:07:24 +08:00
zeertzjq
e4fb3e2007
vim-patch:9.1.0303: filetype: some protocol buffer files not recognized (#28293)
Problem:  filetype: some protocol buffer files not recognized
Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files
          (Bruno Belanyi)

See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files

closes: vim/vim#14463

e54a8e7c73

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:06:21 +08:00
zeertzjq
a93a045e63
vim-patch:9.1.0302: filetype: blueprint files are not recognized (#28292)
Problem:  filetype: blueprint files are not recognized
Solution: Detect '*.bp' files as blueprint files, add
          a minimal filetype plugin (Bruno Belanyi)

See: https://source.android.com/docs/setup/build

closes: vim/vim#14488

6be7ef5bc7

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:05:11 +08:00
zeertzjq
da3059b00f
vim-patch:9.1.0290: filetype: xilinx files are not recognized (#28295)
Problem:  filetype: xilinx files are not recognized
Solution: Add a few xilinx specific file patterns,
          inspect lpr files for being xml/pascal
          (Wu, Zhenyu)

closes: vim/vim#14454

614691ceef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:03:45 +08:00
zeertzjq
5aee587970
vim-patch:9.1.0289: filetype: some TeX files are not recognized (#28291)
Problem:  filetype: some TeX files are not recognized
Solution: Add more patterns for TeX files and inspect
          a few more files for being TeX files
          (Wu, Zhenyu)

closes: vim/vim#14456

61ee833a50

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:02:25 +08:00
zeertzjq
18ee9f9e7d
test(old): make line wrapping in test_filetype.vim match Vim (#28286) 2024-04-12 07:20:03 +08:00
zeertzjq
d0afb2dc4e
vim-patch:9.1.0297: Patch 9.1.0296 causes too many issues (#28263)
Problem:  Patch 9.1.0296 causes too many issues
          (Tony Mechelynck, chdiza, CI)
Solution: Back out the change for now

Revert "patch 9.1.0296: regexp: engines do not handle case-folding well"

This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes
issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It
needs more work.

fixes: vim/vim#14487

c97f4d61cd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:40:16 +08:00
zeertzjq
f504e799a3
vim-patch:9.1.0301: Vim9: heredoc start may be recognized in string (#28266)
Problem:  Vim9: heredoc start may be recognized in string.
Solution: Don't skip to closing bracket for invalid list assignment.
          (zeertzjq)

closes: vim/vim#14472

1817ccdb10
2024-04-11 07:39:10 +08:00
luukvbaal
85099e989b
vim-patch:9.1.0300: Missing test for what patch v9.1.0285 fixes
Problem:  Missing test for what patch v9.1.0285 fixes
Solution: Add a test for cursor movement at buffer boundaries.
          (Luuk van Baal)

aa8e22b035

vim-patch:9.1.0225: test_matchparen not run in CI

Problem:  test_matchparen not run in CI
Solution: add test_matchparen.res to NEW_TESTS_RES in Makefile,
          update changed highlighting dump from v9.1.61

059aeac2be

Changes N/A and test result was restored in patch 9.1.0258 (included in #28160).
2024-04-11 07:37:49 +08:00
zeertzjq
f49408454d
vim-patch:9.1.0296: regexp: engines do not handle case-folding well (#28259)
Problem:  Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip

When the regexp engine compares two utf-8 codepoints case insensitively
it may match an adjacent character, because it assumes it can step over
as many bytes as the pattern contains.

This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some single-byte
value.

Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.

However in that case, it should only step over the single byte
value 's' so by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
- we try to match the correct length for the pattern and the text
- in case of a match, we step over it correctly

The same thing can happen for the NFA engine, when skipping to the next
character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over. So
this needs to be adjusted in find_match_text() as well.

A related issue turned out, when prog->match_text is actually empty. In
that case we should try to find the next match and skip this condition.

fixes: vim/vim#14294
closes: vim/vim#14433

7a27c108e0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-10 07:08:49 +08:00
zeertzjq
efb6640b29
vim-patch:9.1.0287: Vim9: comment may be treated as heredoc start (#28257)
Problem:  Vim9: comment may be treated as heredoc start.
          (Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
          (zeertzjq)

fixes: vim/vim#14444
closes: vim/vim#14446

9a91d2b72c
2024-04-10 06:07:29 +08:00
Luuk van Baal
d4956e16d9 vim-patch:9.1.0294: Text height function does not respect it's argument
Problem:  plines_m_win() does not take into account it's "limit_winheight"
          argument for filler lines below the last line of the buffer.
          (after v9.1.0280)
Solution: Check window height when "limit_winheight" is TRUE.
          (Luuk van Baal)

08b0f632c1
2024-04-09 23:43:42 +02:00
Luuk van Baal
832857ae09 vim-patch:9.1.0285: Still problems with cursor position for CTRL-D/U
Problem:  Problems with cursor position when scrolling half a page.
Solution: Rework the cursor logic. (Luuk van Baal)

78c51500f1
2024-04-09 21:44:42 +02:00
zeertzjq
4946489e2e
vim-patch:9.1.0283: Several small issues in doc and tests (#28249)
Problem:  Wrong doc style for pandoc syntax description,
          Test_diff_eob_halfpage() may fail depending on
          screen size, using braces in highlight.c when
          not necessary
Solution: Fix pandoc documentation, make sure the window
          for the test has 7 lines, remove the braces.

a040019be6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-09 16:42:39 +08:00
Christian Clason
102720be94 vim-patch:9.1.0281: CI: fails Test_compiler_completion
Problem:  CI: fails Test_compiler_completion
Solution: Add pandoc compiler

d33cb3f65e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-09 10:24:49 +02:00
Christian Clason
41521658b1 vim-patch:9.1.0276: No pandoc syntax support
Problem:  No pandoc syntax support
Solution: Add pandoc syntax and compiler plugins
          (Wu, Zhenyu, Konfekt)

closes: vim/vim#14389

7005b7ee7f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-09 10:24:49 +02:00
Christian Clason
cbe982bbd5 vim-patch:9.1.0278: filetype: zathurarc files not recognized
Problem:  filetype: zathurarc files not recognized
Solution: Detect '.zathurarc' files as zathurarc filetype,
          add zathurarc filetype (Wu, Zhenyu)

closes: vim/vim#14380

72d81a66ed

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:54:07 +02:00
Christian Clason
2857cde070 vim-patch:9.1.0275: filetype: R history files are not recognized
Problem:  filetype: R history files are not recognized
Solution: Detect '.Rhistory' files as r filetype
          (Wu, Zhenyu)

closes: vim/vim#14440

fc21b6437c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:53:58 +02:00
Christian Clason
bef4ad6507 vim-patch:9.1.0279: filetype: roc files are not recognized
Problem:  filetype: roc files are not recognized
Solution: Detect '*.roc' files as roc filetype,
          add a basic filetype plugin (nat-418)

closes: vim/vim#14416

196b6678c5

Co-authored-by: nat-418 <93013864+nat-418@users.noreply.github.com>
2024-04-09 09:53:49 +02:00
zeertzjq
2528093bbe
vim-patch:9.1.0277: Cannot highlight the Command-line (#28244)
Problem:  Cannot highlight the Command-line
Solution: Add the MsgArea highlighting group
          (Shougo Matsushita)

closes: vim/vim#14327

be2b03c6ee

Cherry-pick Test_highlight_User() from patch 8.2.1077.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-04-09 07:20:49 +08:00
Luuk van Baal
8f5fd0884b vim-patch:9.1.0280: several issues with 'smoothscroll' support
Problem:  Logic to make sure cursor is in visible part of the screen after
          scrolling the text with 'smoothscroll' is scattered, asymmetric
          and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
          (Luuk van Baal)

9148ba8a46
2024-04-09 00:51:06 +02:00
Luuk van Baal
e21423bb35 vim-patch:9.1.0260: Problems with "zb" and scrolling to new topline with 'smoothscroll'
Problem: "zb" does not reveal filler lines at the start of a buffer.
          Scrolled cursor position with 'smoothscroll' is unpredictable,
          and may reset skipcol later if it is not visible (after v9.1.258)
Solution: Replace confusing for loop that reaches final control value too
          early with while loop. Set "w_curswant" accordingly so cursor
          will be placed in visible part of topline.
          (Luuk van Baal)

bd28cae1f1
2024-04-08 23:15:43 +02:00
Luuk van Baal
e6cfa22c4c vim-patch:9.1.0258: half-page scrolling broke backward compatibility
Problem:  Support for 'smoothscroll' in (half-)page scrolling
          broke backward compatibility and can be made to work better.
          (after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
          half-page scrolling and improve 'smoothscroll' support.
          (Luuk van Baal)

cb204e688e
2024-04-08 23:15:43 +02:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
Christian Clason
541c2d3816 vim-patch:9.1.0273: filetype: keymap files are not recognized
Problem:  filetype: keymap files are not recognized
Solution: Detect '*.keymap' files as Device Tree Files
          (0xadk)

closes: vim/vim#14434

b78753db5f

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2024-04-08 00:35:38 +02:00
zeertzjq
d188b929d4
vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223)
Problem:  Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
          (zeertzjq)

closes: vim/vim#14435

9d956ee8ea
2024-04-08 06:25:22 +08:00
zeertzjq
7560aee595
vim-patch:9.1.0266: filetype: earthfile files are not recognized (#28207)
Problem:  filetype: earthfile files are not recognized
Solution: Detect 'Earthfile' as earthfile
          (Gaëtan Lehmann)

closes: vim/vim#14408

28e5e7c484

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
2024-04-06 21:11:57 +08:00
zeertzjq
08ae0c840b
test(old): sleep for 1 second on non-Windows in test_stat.vim (#28195)
Now that Nvim always supports nanotime, sleeping for some milliseconds
is actually enough, but for test_stat.vim keeping some longer sleeps may
increase test coverage, so just match the upstream test.
2024-04-06 08:33:07 +08:00
zeertzjq
c7d12a5e01 vim-patch:9.1.0269: Test for TextChanged is still flaky with ASAN
Problem:  Test for TextChanged is still flaky with ASAN.
Solution: Don't index the result of readfile().
          (zeertzjq)

It turns out that with ASAN the file may become empty during a write
even if it's non-empty both before and after the write, in which case
indexing the result of readfile() will error, so use join() instead.

Also don't delete the file halfway the test, just in case it may cause
errors on the next read.

closes: vim/vim#14421

e9ff79a7c9
2024-04-06 05:59:13 +08:00
zeertzjq
f4a0c853db vim-patch:9.1.0268: Two tests in test_filechanged.vim are slow
Problem:  Two tests in test_filechanged.vim are slow.
Solution: Sleep for shorter if the +nanotime feature is available.
          (zeertzjq)

closes: vim/vim#14418

83cd2c7bf0
2024-04-06 05:58:55 +08:00
zeertzjq
6ecb5d2d0c
vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)
Problem:  console dialog cannot save unnamed buffers
Solution: set bufname before save (glepnir). Define dialog_con_gui
          to test for GUI+Console dialog support, use it to skip
          the test when the GUI feature has been defined.

Note: The dialog_changed() function will also try to call the
browse_save_fname() function, when FEAT_BROWSE is defined (which is only
defined in a GUI build of Vim). This will eventually lead to a call of
do_browse(), which causes an error message if a GUI is not currently
running (see the TODO: in do_browse()) and will then lead to a failure
in Test_goto_buf_with_onfirm().

Therefore, we must disable the Test_goto_buf_with_onfirm(), when the
dialog_con_gui feature is enabled (which basically means dialog feature
for GUI and Console builds, in contrast to the dialog_con and dialog_gui
feature).

(Previously this wasn't a problem, because the test aborted in the YES
case for the :confirm :b XgotoConf case and did therefore not run into
the browse function call)

closes: vim/vim#14398

df46115fc8

Co-authored-by: glepnir <glephunter@gmail.com>
2024-04-05 18:32:04 +08:00
zeertzjq
9711370c26
feat(defaults): add :Inspect to right-click menu (#28181)
Ref #21393

- Move default user commands to _defaults.lua as that now contains all
  kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
2024-04-05 18:08:54 +08:00
zeertzjq
a500c5f808
vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
zeertzjq
dc69c475a5
vim-patch:9.1.0262: Test for TextChanged is flaky with ASAN (#28180)
Problem:  Test for TextChanged is flaky with ASAN.
Solution: Wait for the file to be non-empty.
          (zeertzjq)

closes: vim/vim#14404

4a65391ca2
2024-04-05 07:24:25 +08:00
zeertzjq
a469745338
vim-patch:9.1.0259: Normal mode TextChanged isn't tested properly (#28167)
Problem:  Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
          and also run it on Windows. Fix a typo in main.c.
          (zeertzjq)

closes: vim/vim#14396

c422662933
2024-04-04 06:11:17 +08:00
Christian Clason
e74cd1d9ff vim-patch:9.1.0253: filetype: typespec files are not recognized
Problem:  filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
          (Hilmar Wiegand)

Specs is at https://typespec.io/

closes: vim/vim#14392

6c9f4f98f1

Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
2024-04-03 10:45:29 +02:00
zeertzjq
aeabd8e245 vim-patch:9.1.0254: [security]: Heap buffer overflow when calling complete_add() in 'cfu'
Problem:  [security]: Heap buffer overflow when calling complete_add()
          in the first call of 'completefunc'
Solution: Call check_cursor() after calling 'completefunc' (zeertzjq)

closes: vim/vim#14391

0a419e07a7
2024-04-03 05:55:50 +08:00
zeertzjq
4a6b4b00cb
vim-patch:9.1.0251: Filetype test fails (#28142)
Problem:  Filetype test fails.
Solution: Move detection by name before detection by extension.
          Improve TextChanged test and remove wrong test and fix
          a typo in a comment (zeertzjq).

closes: vim/vim#14373

8eb7523802

The changes to filetype.vim are N/A since Nvim always prefers filename
matches to extension matches.
2024-04-01 21:49:44 +08:00
zeertzjq
381806729d
vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' (#28141)
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes vim/vim#12553)

c12e4eecbb

In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-01 18:43:30 +08:00
Christian Clason
2e97ae2664 vim-patch:9.1.0250: filetype: ldscripts cannot be recognized
Problem:  filetype: ldscripts cannot be recognized
Solution: Detect '*/ldscripts/*' as ld
          (Wu, Zhenyu)

closes: vim/vim#14371

4c7098b00a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
000431820e vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not recognized
Problem:  filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
          (Wu, Zhenyu)

closes: vim/vim#14370

a917bd58bd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
19ee281809 vim-patch:9.1.0248: filetype: yarn lock files are not recognized
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: vim/vim#14369

3b497aa247

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
de1a54dfe1 vim-patch:9.1.0247: filetype: bundle config files are not recognized
Problem:  filetype: bundle config files are not recognized
Solution: Detect '*/.bundle/config' as yaml
          (Wu, Zhenyu)

closes: vim/vim#14368

3f6fa93b3b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
09869c3745 vim-patch:9.1.0246: filetype: fontconfig files are not recognized
Problem:  filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
          (Wu, Zhenyu)

closes: vim/vim#14367

a2c27b01dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
fa863c17b2 vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem:  filetype: zsh theme, history and zunit files are not
          recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
          (Wu, Zhenyu)

closes: vim/vim#14366

a55a22a1a3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
239101e32a vim-patch:9.1.0244: filetype: bash history files are not recognized
Problem:  filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
          (Wu, Zhenyu)

closes: vim/vim#14365

84ce55001a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
1a0b27965c vim-patch:9.1.0243: filetype: netrw history file is not recognized
Problem:  filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)

closes: vim/vim#14364

abbb4a4f70

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
5cdbb22c34 vim-patch:9.1.0242: filetype: octave history files are not recognized
Problem:  filetype: octave history files are not recognized
Solution: Detect octave/history files as octave
          (Wu, Zhenyu)

closes: vim/vim#14363

be71ac694f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
afc7a5611e vim-patch:9.1.0241: filetype: mysql history files are not recognized
Problem:  filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
          (Wu, Zhenyu)

closes: vim/vim#14362

6b285c8cfd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
a978e83158 vim-patch:9.1.0240: filetype: some python tools config files are not recognized
Problem:  filetype: some python tools config files are not recognized
Solution: Detect config files for setuptools, pudb, coverage as dosini
          (Wu, Zhenyu)

closes: vim/vim#14361

665220a17b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
acac56360f vim-patch:9.1.0239: filetype: gnuplot history files are not recognised
Problem:  filetype: gnuplot history files are not recognised
Solution: detect .gnuplot_history files as gnuplot
          (Wu, Zhenyu)

closes: vim/vim#14360

8e47eb31cc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
ce69056e95 vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognized
Problem:  filetype: jupyterlab and sublime config are not recognized
Solution: Detect jupyterlab and sublime config files as json
          (Wu, Zhenyu)

closes: vim/vim#14359

75c607dff7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
f29ba3c46c vim-patch:9.1.0237: filetype: mplstyle files are not recognized
Problem:  filetype: mplstyle files are not recognized
Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu)

closes: vim/vim#14358

0fd560d46a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
2e0233d003 vim-patch:9.1.0236: filetype: texlua files are not recognized
Problem:  filetype: texlua files are not recognized
Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu)

Reference: https://github.com/TeX-Live/texdoc/tree/master/script

closes: vim/vim#14357

a75f4791b1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
96d77b2051 vim-patch:9.1.0235: filetype: supertux files are not recognized
Problem:  filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
          so add a pattern for supertux files.
          (Wu, Zhenyu)

Reference: https://github.com/SuperTux/supertux/wiki/S-Expression

closes: vim/vim#14356

4ff83b904e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
c24dcb1bea vim-patch:9.1.0234: filetype: support for Intel HEX files is lacking
Problem:  filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
          (Wu, Zhenyu)

Reference: https://en.wikipedia.org/wiki/Intel_HEX

closes: vim/vim#14355

e523dd9803

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
zeertzjq
c4221df7b5
vim-patch:9.1.0232: Conceal test fails when rightleft feature is disabled (#28134)
Problem:  Conceal test fails when rightleft feature is disabled.
Solution: Skip test if rightleft feature is missing (Julio B).

closes: vim/vim#14342

5df961a1bc

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-04-01 06:12:47 +08:00
zeertzjq
b08667d4f0
vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
Problem:  Filetype may be undetected when a SwapExists autocommand sets
          filetype in another buffer.
Solution: Make filetype detection state buffer-specific.  Also fix a
          similar problem for 'modified' (zeertzjq).

closes: vim/vim#14344

5bf6c2117f
2024-04-01 06:12:11 +08:00
zeertzjq
e005b8d2eb
vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135)
Problem:  TextChanged autocommand not triggered under some circumstances
          (Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered

fixes: vim/vim#14332
closes: vim/vim#14339

8603270293

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-01 05:39:52 +08:00
dundargoc
5a5d26b4ab test: skip flaky tests 2024-03-29 14:27:13 +01:00
zeertzjq
fc19ee01ac
vim-patch:9.1.0227: Recording may still be wrong in Select mode (#28092)
Problem:  Recording may still be wrong in Select mode (after 8.2.3993).
Solution: Make sure a character isn't split between two buffer blocks.
          (zeertzjq)

closes: vim/vim#14326

ea95f1a5ad
2024-03-29 17:50:55 +08:00
zeertzjq
d223a7cbd2
vim-patch:9.1.0228: Two unrelated things are tested by a single test (#28093)
Problem:  Two unrelated things are tested by a single test.
Solution: Split it into two, restoring the old Test_brace_single_line().
          Add missing cleanup to some tests.
          (zeertzjq)

closes: vim/vim#14323

ad493ef3ea
2024-03-29 17:49:25 +08:00
zeertzjq
dde2cc65fd
Merge pull request #28044 from luukvbaal/vim-9.1.0211
vim-patch:9.1.{0211,0215}
2024-03-28 19:47:40 +08:00
zeertzjq
346a639028
vim-patch:9.1.0220: Few typos in source and test files (#28076)
Problem:  Typos in code and tests.
Solution: Fix typos (zeertzjq).

closes: vim/vim#14321

c029c131ea
2024-03-28 19:03:27 +08:00
Luuk van Baal
2f638c0ac6 vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-D/Ctrl-U implements
          it's own logic to change the topline and cursor.
          More logic than necessary for scrolling with Ctrl-F/Ctrl-B
          was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
          staying backward compatible as much as possible.
          Restore some of the logic that determined how many lines will
          be scrolled (Luuk van Baal)

5a2e3ec9ac
2024-03-28 11:39:34 +01:00
zeertzjq
08b8ccd733
vim-patch:9.1.0218: Unnecessary multiplications in backspace code (#28075)
Problem:  Unnecessary multiplications in backspace code, as
          "col / ts * ts" is the same as "col - col % ts".
Solution: Change "col / ts * ts" to "col - col % ts".  Adjust the loop
          and the comments ins_bs() to be easier to understand.  Update
          tests to reset 'smarttab' properly.
          (zeertzjq)

closes: vim/vim#14308

8ede7a0694
2024-03-28 18:20:38 +08:00
zeertzjq
6364fc617d
vim-patch:9.1.0217: regexp: verymagic cannot match before/after a mark (#28074)
Problem:  regexp: verymagic cannot match before/after a mark
Solution: Correctly check for the very magic check (Julio B)

Fix regexp parser for \v%>'m and \v%<'m
Currently \v%'m works fine, but it is unable to match before or after
the position of mark m.

closes: vim/vim#14309

46fa3c7e27

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-03-28 18:15:41 +08:00
zeertzjq
070b0b4572
vim-patch:9.1.0213: CI: MS-Windows fails in test_winfixbuf (#28071)
Problem:  CI: MS-Windows fails in test_winfixbuf
          (after v9.1.208)
Solution: Instead of skipping the test, write the file
          so it exists on disk, to verify that MS-Windows
          short filename expansion is successful.
          (Sean Dewar)

related: vim/vim#14286

aed6554b46

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-28 17:53:15 +08:00
zeertzjq
67596c42eb
vim-patch:9.1.0216: Error on exit with EXITFREE and 'winfixbuf' (#28070)
Problem:  Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
          (zeertzjq)

closes: vim/vim#14314

620e85265c
2024-03-28 17:52:06 +08:00
Luuk van Baal
4147302f4b vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-F/Ctrl-B implements
          it's own logic to change the topline and cursor.
          In doing so, skipcol is not handled properly for
          'smoothscroll', and virtual lines.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying
          backward compatible as much as possible.

b9f5b95b7b
2024-03-28 10:18:09 +01:00
dundargoc
a89ce89742
docs: fix typos (#27868)
Co-authored-by: ite-usagi <77563904+ite-usagi@users.noreply.github.com>
Co-authored-by: v-sim <56476039+v-sim@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Quico Augustijn <quico.public@gmail.com>
Co-authored-by: nhld <nahnera@gmail.com>
Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com>
2024-03-28 09:32:32 +08:00