Commit Graph

6224 Commits

Author SHA1 Message Date
zeertzjq
087ef52997
vim-patch:9.0.1840: [security] use-after-free in do_ecmd (#24993)
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

e1dc9a6275

N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 11:15:43 +08:00
Maria José Solano
517dfdf0fc
fix(shada): update marks when using delmarks! (#24978) 2023-09-03 10:34:09 +08:00
zeertzjq
b55010a539 vim-patch:9.0.1846: [security] crash in fullcommand
Problem:  crash in fullcommand
Solution: Check for typeval correctly

4c6fe2e2ea

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:14:30 +08:00
zeertzjq
272c4fba83
vim-patch:9.0.1852: i_CTRL-O does not reset Select Mode (#24990)
Problem:  i_CTRL-O does not reset Select Mode
Solution: Reset select mode on CTRL-O in insert mode

closes: vim/vim#13001
closes: vim/vim#12115

d69aecf141

Co-authored-by: pierreganty <pierreganty@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-09-03 09:04:58 +08:00
dundargoc
f30844008b
build: download busted from own neovim/deps repository
Downloading the necessary files all at once instead of doing dependency
handling with luarocks speeds up installation immensely. We speed up the
process even more by using luv as a replacement for the C modules in the
busted dependencies, which allows us to skip costly compilation times.

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-03 00:38:10 +02:00
zeertzjq
0c86828ac5
fix(ui): avoid ambiguity about chunk that clears part of line (#24982)
Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-09-02 18:50:12 +08:00
zeertzjq
bc43575c52
test(shada/marks_spec): load the file with the marks (#24979) 2023-09-02 10:23:43 +08:00
zeertzjq
592a8f1e90
vim-patch:9.0.1828: cursor wrong with virt text before double-width char (#24967)
Problem:  Wrong cursor position with virtual text before double-width
          char at window edge.
Solution: Check for double-width char before adding virtual text size.

closes: vim/vim#12977

ac2d8815ae
2023-09-01 06:45:27 +08:00
Lewis Russell
dd0e77d48a fix(query_error): multiline bug 2023-08-31 15:12:17 +01:00
Amaan Qureshi
845d5b8b64 feat(treesitter): improve query error message 2023-08-31 13:33:40 +01:00
Chris AtLee
c235959fd9
fix(lsp): only disable inlay hints / diagnostics if no other clients are connected (#24535)
This fixes the issue where the LspNotify handlers for inlay_hint /
diagnostics would end up refreshing all attached clients.

The handler would call util._refresh, which called
vim.lsp.buf_request, which calls the method on all attached clients.

Now util._refresh takes an optional client_id parameter, which is used
to specify a specific client to update.

This commit also fixes util._refresh's handling of the `only_visible`
flag. Previously if `only_visible` was false, two requests would be made
to the server: one for the visible region, and one for the entire file.

Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2023-08-31 10:00:24 +02:00
Maria José Solano
ee56daebb6
fix(shada): update deleted marks (#24936)
Fix #4295
Close #16067

Co-authored-by: chentau <tchen1998@gmail.com>
2023-08-31 10:15:49 +08:00
zeertzjq
839d919098
vim-patch:9.0.1825: wrong cursor position with virt text and 'linebreak' (#24957)
Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: vim/vim#12956

6e55e85f92

N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
2023-08-31 08:35:08 +08:00
zeertzjq
5d49542b56
vim-patch:9.0.1820: Rexx files may not be recognised (#24956)
Problem:  Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
	  files

closes: vim/vim#12951

e06afb7860

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 08:20:00 +08:00
zeertzjq
7914881356
vim-patch:9.0.1797: Vimball/Visual Basic filetype detection conflict (#24947)
Problem:  Vimball/Visual Basic filetype detection conflict
Solution: runtime(vb): Improve Vimball and Visual Basic detection logic

Only run Vimball Archiver's BufEnter autocommand on Vimball archives.
Fixes vim/vim#2694.

closes: vim/vim#12899

f97f6bbf56

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 07:44:33 +08:00
zeertzjq
6463116818
vim-patch:9.0.1807: runtime: crystal scripts not recognised (#24949)
Problem:  runtime: crystal scripts not recognised
Solution: Filetype detect Crystal scripts by shebang line

closes: vim/vim#12935

9b73902dbe

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-31 04:38:28 +08:00
zeertzjq
497cf996eb
vim-patch:9.0.1803: runtime(filetype): Add norg language detection (#24948)
runtime(filetype): Add norg markup language detection

closes: vim/vim#12913

03e44a1d70

Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2023-08-31 04:38:01 +08:00
bfredl
b051b131f5 fix(api): nvim_buf_get_offset in a new buffer with zero or one lines
fixes #24930
2023-08-30 12:01:35 +02:00
bfredl
50a03c0e99 fix(treesitter): fix another TSNode:tree() double free
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
2023-08-29 11:35:46 +02:00
nwounkn
6e45567b49
fix(treesitter): fix TSNode:tree() double free (#24796)
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.

Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
2023-08-29 10:48:23 +02:00
bfredl
0a81ec14a4 fix(api): better topline adjustments in nvim_buf_set_lines
Some more reasonable defaults for topline:
  - if topline was replaced with another line, that now becomes topline
  - if line was inserted just before topline, display it. This is more
    similar to the previous API behavior.
2023-08-29 09:26:15 +02:00
zeertzjq
794981d9be
vim-patch:9.0.1813: linebreak incorrect drawn with breakindent (#24917)
Problem: 'linebreak' is incorrectly drawn after 'breakindent'.
Solution: Don't include 'breakindent' size when already after it.

closes: vim/vim#12937
closes: vim/vim#12940

1d3e0e8f31
2023-08-29 09:36:55 +08:00
bfredl
132bbd1cbd fix(api): handle clearing out last line of non-current buffer
fixes #24911
2023-08-28 12:39:02 +02:00
zeertzjq
656be8a591
vim-patch:9.0.1810: camel-case spelling has issues with digits (#24909)
Problem:  camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
          and caps into account

Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.

closes: vim/vim#12644
closes: vim/vim#12933

d08745040b

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-28 07:16:15 +08:00
zeertzjq
6b12eda220
vim-patch:9.0.1798: The 'syntax' option has no completion. (#24908)
Problem:  The 'syntax' option has no completion.
Solution: Add syntax option completion.

closes: vim/vim#12900

6dfdff3f27

N/A patches:
vim-patch:9.0.1795: Indentation issues

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-28 07:07:50 +08:00
zeertzjq
062db5c136 vim-patch:9.0.1802: Multiline regex with Visual selection fails with virtual text
Problem:  Multiline regex with Visual selection fails when Visual
          selection contains virtual text after last char.
Solution: Only include virtual text after last char when getting full
          line length.

closes: vim/vim#12908

e3daa06be1
2023-08-28 06:10:36 +08:00
zeertzjq
c70aa84b2a vim-patch:9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem:  Cursor position still wrong with 'showbreak' and virtual text
          after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
          fix first char of virtual text not shown at the start of a screen
          line.

closes: vim/vim#12478
closes: vim/vim#12532
closes: vim/vim#12904

6a3897232a
2023-08-28 06:02:01 +08:00
zeertzjq
128091a256 fix(ui): wrong cursor position with left gravity inline virt text at eol 2023-08-28 05:51:01 +08:00
Lewis Russell
abb8c2c453 fix(editorconfig): do not set 'endofline'
Problem:
  'endofline' can be used to detect if a file ends of <EOL>, however
  editorconfig can break this.

Solution:
  Set 'endofline' during BufWritePre

Fixes: #24869
2023-08-27 19:27:25 +01:00
zeertzjq
1f49c98036
vim-patch:9.0.1792: problem with gj/gk/gM and virtual text (#24898)
Problem:  Normal mode "gM", "gj", "gk" commands behave incorrectly with
          virtual text.
Solution: Use linetabsize() instead of linetabsize_str().

closes: vim/vim#12909

d809c0a903
2023-08-27 20:04:44 +08:00
bfredl
840749d6c9 fix(undo): fix crash caused by checking undolevels in wrong buffer
fixes #24894
2023-08-27 12:08:11 +02:00
bfredl
9b9030ff2c fix(api): fix inconsistent behavior of topline touched in recent refactor
The change in #24824 0081549 was not a regression, however it was an
incomplete change. Unfortunately some common plugins come to depend on
this exising self-inconsistent behavior. These plugins are going to need
to update for 0.10

nvim_buf_set_lines used to NOT adjust the topline correctly if a buffer
was displayed in just one window. However, if displayed in multiple
windows, it was correctly adjusted for any window not deemed the
current window for the buffer (which could be an arbitrary choice if the
buffer was not already current, as noted in the last rafactor)

This fixes so that all windows have their topline adjusted. The added
tests show this behavior, which should be the reasonable one.
2023-08-27 12:07:46 +02:00
Evgeni Chasnovski
35570e4a11
feat(float): implement footer
Problem: Now way to show text at the bottom part of floating window
  border (a.k.a. "footer").

Solution: Allows `footer` and `footer_pos` config fields similar to
  `title` and `title_pos`.
2023-08-26 19:37:43 +03:00
luukvbaal
afd0c648a8
fix(statuscolumn): force full redraw when signcolumn is invalid (#24859)
Fix #24655
2023-08-26 21:10:04 +08:00
Ibby
362df0f793
fix(extmarks): wrong display when changing text with virt_lines (#24879) 2023-08-26 19:39:05 +08:00
bfredl
0081549547 refactor(change): do API changes to buffer without curbuf switch
Most of the messy things when changing a non-current buffer is
not about the buffer, it is about windows. In particular, it is about
`curwin`.

When editing a non-current buffer which is displayed in some other
window in the current tabpage, one such window will be "borrowed" as the
curwin. But this means if two or more non-current windows displayed the buffers,
one of them will be treated differenty. this is not desirable.

In particular, with nvim_buf_set_text, cursor _column_ position was only
corrected for one single window. Two new tests are added: the test
with just one non-current window passes, but the one with two didn't.

Two corresponding such tests were also added for nvim_buf_set_lines.
This already worked correctly on master, but make sure this is
well-tested for future refactors.

Also, nvim_create_buf no longer invokes autocmds just because you happened
to use `scratch=true`. No option value was changed, therefore OptionSet
must not be fired.
2023-08-26 12:02:05 +02:00
zeertzjq
a9418ef8cf
fix(ui): wrong display with 0-width inline virt_text at eol (#24854) 2023-08-24 11:28:10 +08:00
Amaan Qureshi
c6ec7fa8d7 feat(treesitter): add 'injection.self' and 'injection.parent'
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-24 09:05:44 +09:00
zeertzjq
466c18b818
vim-patch:9.0.1785: wrong cursor position with 'showbreak' and lcs-eol (#24852)
Problem:  wrong cursor position with 'showbreak' and lcs-eol
Solution: Add size of 'showbreak' before when 'listchars' "eol" is used.
          Also fix wrong cursor position with wrapping virtual text on
          empty line and 'showbreak'.

closes: vim/vim#12891

1193951beb
2023-08-24 07:19:18 +08:00
zeertzjq
08fa71fd27
vim-patch:9.0.1773: cannot distinguish Forth and Fortran *.f files (#24841)
Problem:  cannot distinguish Forth and Fortran *.f files
Solution: Add Filetype detection Code

Also add *.4th as a Forth filetype

closes: vim/vim#12251

19a3bc3add

Don't remove filetype files from Vim patches:
- filetype.vim, script.vim, ft.vim usually contain useful changes
- script.vim and ft.vim don't even have their paths spelled correctly

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2023-08-23 19:32:11 +08:00
zeertzjq
3f32cb88c2 vim-patch:9.0.1781: Problems when setting bin/paste option
Problem:  Problems when setting bin/paste option
Solution: When setting binary/paste, remember that this also affects
          depending options, so that :verbose set returns the right
          location.

Mention if depending options for 'binary' or 'paste' have been reset
indirectly. Add a test to verify it works.

Also noticed as small bug, that the global option value for expandtab
was not reset when paste option is set, so fix that while at it.

closes: vim/vim#12837
closes: vim/vim#12879

757593c07a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 18:24:14 +08:00
zeertzjq
0ba27bb51d vim-patch:9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
         different than other global-local options
Solution: Make it behave consistent for all global-local options

It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'

So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.

Add a few tests to make sure all global-local window options behave
similar

closes: vim/vim#12956
closes: vim/vim#12643

4a8eb6e7a9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 18:24:14 +08:00
zeertzjq
908f247c22 fix(plines): count 'showbreak' for virtual text at eol 2023-08-23 13:17:17 +08:00
zeertzjq
a1d71ad55e vim-patch:9.0.1783: Display issues with virt text smoothscroll and showbreak
Problem:  Wrong display with wrapping virtual text or unprintable chars,
          'showbreak' and 'smoothscroll'.
Solution: Don't skip cells taken by 'showbreak' in screen lines before
          "w_skipcol". Combined "n_skip" and "skip_cells".

closes: vim/vim#12597

b557f48982
2023-08-23 13:17:17 +08:00
zeertzjq
6462ee1c10
vim-patch:9.0.1779: Need more state() tests (#24840)
Problem:  Need more state() tests
Solution: Add a few more tests for operater pending mode and register
          yank command

closes: vim/vim#12883

8dabccd295
2023-08-23 06:42:10 +08:00
zeertzjq
20f76ebf2b
test: fix state() test flakiness (#24839) 2023-08-23 00:00:57 +08:00
zeertzjq
b84a67f50e
vim-patch:9.0.0579: using freed memory when 'tagfunc' wipes out buffer (#24838)
Problem:    Using freed memory when 'tagfunc' wipes out buffer that holds
            'complete'.
Solution:   Make a copy of the option.  Make sure cursor position is valid.

0ff01835a4

Cherry-pick a cmdwin change from patch 9.0.0500.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 22:48:55 +08:00
zeertzjq
e34eb4ccf9
test(old): reorder test_edit.vim to match upstream (#24837) 2023-08-22 20:57:10 +08:00
zeertzjq
63094e0013
vim-patch:8.0.0571: negative line number when using :z^ in an empty buffer (#24836)
Problem:    The cursor line number becomes negative when using :z^ in an empty
            buffer. (neovim vim/vim#6557)
Solution:   Correct the line number.  Also reset the column.

a364cdb648

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 20:56:14 +08:00
zeertzjq
3f1a12b8cc
test(old): remove workaround for TSAN CI (#24834)
Now that TSAN CI no longer runs oldtests, match upstream better.
2023-08-22 20:03:03 +08:00
zeertzjq
94f2da09e1
vim-patch:8.2.4611: typos in tests; one lua line not covered by test (#24835)
Problem:    Typos in tests; one lua line not covered by test.
Solution:   Fix typos. Add test case. (Dominique Pellé, closes vim/vim#9994)

81b573d7e5

Cherry-pick test_menu.vim change from patch 9.0.1453.

N/A patch:
vim-patch:8.2.3045: minor typos

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-08-22 20:02:50 +08:00
zeertzjq
09910d5b35 vim-patch:9.0.0837: append() reports failure when not appending anything
Problem:    append() reports failure when not appending anything.
Solution:   Only report failure when appending something. (closes vim/vim#11498)

cd9c8d400c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
zeertzjq
48722ec400 vim-patch:9.0.0428: autocmd test uses common file name
Problem:    Autocmd test uses common file name.
Solution:   Use unique name to reduce flakiness.

be9fc5b60c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
zeertzjq
1da705c433 vim-patch:9.0.0425: autocmd test is a bit flaky on MS-Windows
Problem:    Autocmd test is a bit flaky on MS-Windows.
Solution:   Add a bit more sleeping. (Ken Takata, closes vim/vim#11095)

ae04a6049b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
zeertzjq
10990eace2 vim-patch:9.0.0415: on MS-Windows some tests are flaky
Problem:    On MS-Windows some tests are flaky.
Solution:   Add sleeps, disable swapfile, mark test as flaky. (Ken Takata,
            closes vim/vim#11082)

0500e87eba

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-08-22 18:56:43 +08:00
zeertzjq
c170708023 vim-patch:9.0.0391: using separate delete() call instead of writefile() 'D' flag
Problem:    Using separate delete() call instead of writefile() 'D' flag.
Solution:   Use the writefile 'D' flag.

3411265a36

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
zeertzjq
50b069a8b9 vim-patch:9.0.0380: deleting files in tests is a hassle
Problem:    Deleting files in tests is a hassle.
Solution:   Use the new 'D' flag of writefile().

e1f3ab73bc

vim-patch:e1f3ab73bc7c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
zeertzjq
d401b33314
fix(terminal): handle horizontal scrolling in another window (#24828) 2023-08-21 23:19:12 +08:00
Gregory Anders
d0717a7c4e
vim-patch:9.0.0423: "for" and "while" not recognized after :vim9cmd and :legacy (#24825)
Problem:    "for" and "while" not recognized after :vim9cmd and :legacy.
            (Emanuele Torre)
Solution:   Recognize all the command modifiers. (closes vim/vim#11087)
            Add a test to check the list of modifiers.

9132426334

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 09:06:21 -05:00
zeertzjq
28c2e83fb4 vim-patch:9.0.0313: 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.

e7cda97b6b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:31:31 +08:00
zeertzjq
00ad0c81b6 vim-patch:9.0.0077: wrong restored cursor position when switching window in autocmd
Problem:    When switching window in autocmd the restored cursor position may
            be wrong.
Solution:   Do not restore the cursor if it was not set. (closes vim/vim#10775)

b03950fafa

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:25:48 +08:00
zeertzjq
bd9a9e63bc vim-patch:8.2.4212: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Explicitly set the 'title' option.

1450112eef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:17:01 +08:00
zeertzjq
67edc0a772 vim-patch:8.2.4211: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Use WaitForAssert().

3a8ad5918b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:53 +08:00
zeertzjq
7fab06cb0c vim-patch:8.2.4210: window title test fails in some configurations
Problem:    Window title test fails in some configurations.
Solution:   Only run the test if the title can be obtained.

a6c09a7c20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:43 +08:00
zeertzjq
893437512c vim-patch:8.2.4208: using setbufvar() may change the window title
Problem:    Using setbufvar() may change the window title.
Solution:   Do not redraw when creating the autocommand window. (closes vim/vim#9613)

dff97e65eb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:22 +08:00
zeertzjq
02ca31979b vim-patch:8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-21 15:43:39 +08:00
zeertzjq
00f92f086e vim-patch:8.2.3518: Test_xrestore sometimes fails
Problem:    Test_xrestore sometimes fails.
Solution:   Mark the test as flayky.  Move marking test as flaky to the test
            instead of listing them in runtest.

f08b0eb869

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:35:08 +08:00
zeertzjq
7aa3f825cd vim-patch:8.2.2910: test for cmdline window and terminal fails on MS-Windows
Problem:    Test for cmdline window and terminal fails on MS-Windows.
Solution:   Skip the test on MS-Windows.

0b49648486

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
d4b6a25e67 vim-patch:8.2.2908: crash when using a terminal popup window from cmdline window
Problem:    Crash when using a terminal popup window from the cmdline window.
Solution:   Instead of checking cmdwin_type call cmdwin_is_active().
            (closes vim/vim#8286)

e5b4486c42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
ff801ce7f7 vim-patch:8.2.0533: tests using term_wait() can still be flaky
Problem:    Tests using term_wait() can still be flaky.
Solution:   Increase the wait time when rerunning a test. (James McCoy,
            closes vim/vim#5899)  Halve the initial times to make tests run faster
            when there is no rerun.

6a2c5a7dd5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
ff37916b47 vim-patch:8.2.0454: some tests fail when the system is slow
Problem:    Some tests fail when the system is slow.
Solution:   Make the run number global, use in the test to increase the
            waiting time. (closes vim/vim#5841)

3ed9efc2b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
045cc185d5 vim-patch:8.2.0310: autocmd test fails on a slow system
Problem:    Autocmd test fails on a slow system.
Solution:   Adjust the expectations. (James McCoy, closes vim/vim#5685)

8fb1b47a5e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
702a5f0cbb vim-patch:8.2.0195: some tests fail when run in the GUI
Problem:    Some tests fail when run in the GUI.
Solution:   Make sure the window width is enough.  In the GUI run terminal Vim
            in the terminal, if possible.

3180fe6c6d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
e8df2a012b vim-patch:8.2.0186: a couple of tests may fail when features are missing
Problem:    A couple of tests may fail when features are missing.
Solution:   Check for features. (Dominique Pelle, closes vim/vim#5561)

705724e430

Just copy the two 'wincolor' test functions from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
6f5ff5818a vim-patch:8.1.2403: autocmd test fails under valgrind
Problem:    Autocmd test fails under valgrind.
Solution:   Wait a bit longer.

3c47e8384d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
6aa29d0f01 test: add some tests for SafeState autocommand 2023-08-21 14:16:16 +08:00
zeertzjq
71acb71043 vim-patch:8.1.2099: state() test fails on some Mac systems
Problem:    state() test fails on some Mac systems.
Solution:   Increase the wait time. (closes vim/vim#4983)

b7a97ef340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
e05031097c vim-patch:8.1.2069: test for SafeStateAgain may still fail
Problem:    Test for SafeStateAgain may still fail.
Solution:   Send another message to trigger SafeStateAgain.

0f6629a08a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
0defbd38e4 vim-patch:8.1.2068: test for SafeState and SafeStateAgain may fail
Problem:    Test for SafeState and SafeStateAgain may fail.
Solution:   Accept more possible responses

513537bfff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
3e79afec54 vim-patch:8.1.2067: no tests for SafeState and SafeStateAgain
Problem:    No tests for SafeState and SafeStateAgain.
Solution:   Add tests.

cadbe1b1fb

This test is quite useless. Don't port to Lua.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
6bf5b2428b vim-patch:8.1.2066: no tests for state()
Problem:    No tests for state().
Solution:   Add tests.  Clean up some feature checks.  Make "a" flag work.

c258549032

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
Christian Clason
eaad2f7806 vim-patch:9.0.1768: Runtime: no support for bicep files
Problem:  Runtime: no support for bicep files
Solution: Add filetype support for bicepparam

closes: vim/vim#12784

2d0988ef93

Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
2023-08-21 10:13:44 +09:00
Christian Clason
a5b6468e9b vim-patch:9.0.1766: Runtime: Missing QML support
Problem:  Runtime: Missing QML support
Solution: Add QML support to Vim

closes: vim/vim#12810

bedc69f9d6

Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>
2023-08-21 10:13:44 +09:00
zeertzjq
a2a226170d
vim-patch:9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows (#24811)
Problem:    Cursor is adjusted in window that did not change in size by
            'splitkeep'.
Solution:   Only check that cursor position is valid in a window that
            has changed in size.

closes: vim/vim#12509

16af913eee

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-08-21 08:58:18 +08:00
zeertzjq
694814cdd5
vim-patch:9.0.1774: no support for custom cmdline completion (#24808)
Problem:  no support for custom cmdline completion
Solution: Add new vimscript functions

Add the following two functions:
- getcmdcompltype() returns custom and customlist functions

- getcompletion() supports both custom and customlist

closes: vim/vim#12228

92997dda78

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2023-08-21 07:29:49 +08:00
zeertzjq
ac99e63d73
vim-patch:9.0.1763: crash when passing invalid buffer to undotree() (#24807)
Problem:  crash when passing invalid buffer to undotree()
Solution: Use get_buf_arg() instead of tv_get_buf_from_arg().

closes: vim/vim#12862
closes: vim/vim#12830

ab9f2ecfd4
2023-08-21 07:20:26 +08:00
zeertzjq
d21e6285e9
vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line (#24806)
Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: vim/vim#12865

8fc6a1dae0
2023-08-21 07:18:39 +08:00
zeertzjq
0c91cb4f03 vim-patch:9.0.1761: g<kEnd> behaves different from g<end>
Problem:  g<kEnd> behaves different from g<end>
Solution: Make g<kEnd> behave like g<End>

closes: vim/vim#12861

654bdbbd32
2023-08-21 06:12:03 +08:00
zeertzjq
7485fd0518 vim-patch:9.0.1753: can't move to last non-blank char
Problem: can't move to last non-blank char
Solution: Make g<end> behave like that

Make it possible to move to last non-blank char on a line

We can distinguish between g0 and g^ to move to the very first character
and the first non-blank char.

And while we can move to the last screen char, we cannot go to the last
non-blank screen char.

Since I think g$ is the more widely used and known movement command (and
g<end> is synonymous to it) change the behaviour of g<end> to move to
last non-screen char instead and don't have this be the same command as
the g$ command anymore.

If you want to keep the old behaviour, you can use:

```
nnoremap g<end> g$
```

Add a test to verify the behaviour.

closes: vim/vim#12593

b5f6fe9ca2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-21 06:11:16 +08:00
zeertzjq
421713523e
vim-patch:9.0.1745: Missing test coverage for blockwise Visual highlight (#24790)
Problem:  Missing test coverage for blockwise Visual highlight with
          virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.

closes: vim/vim#12835

fc3058495d
2023-08-19 20:34:58 +08:00
zeertzjq
c8e58bf09c
vim-patch:9.0.1742: wrong curswant when clicking on second cell of double-width char (#24789)
Problem:  Wrong curswant when clicking and the second cell of a
          double-width char.
Solution: Don't copy virtcol of the first char to the second one.

closes: vim/vim#12842

9994160bfe
2023-08-19 19:40:26 +08:00
zeertzjq
fcd729f22c vim-patch:9.0.1540: reverse() on string doesn't work in compiled function
Problem:    reverse() on string doesn't work in compiled function.
Solution:   Accept string in argument type check. (Yegappan Lakshmanan,
            closes vim/vim#12377)

f9dc278946

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq
4c7df98e4e vim-patch:9.0.1515: reverse() does not work for a String
Problem:    reverse() does not work for a String.
Solution:   Implement reverse() for a String. (Yegappan Lakshmanan,
            closes vim/vim#12179)

03ff1c2dde

vim-patch:9.0.1738: Duplicate code to reverse a string

Problem:  Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().

closes: vim/vim#12847

4dd266cb66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq
5a6c7c805b
fix(extmarks): make empty "conceal" respect &conceallevel = 1 (#24785)
This treats extmark conceal more like matchadd() conceal.
2023-08-19 03:55:11 +08:00
zeertzjq
1d3d50e8f0 test(ui/mouse_spec): mouse click with matchadd() concealed text 2023-08-18 19:34:25 +08:00
zeertzjq
551998b7ee vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Problem:    Wrong cursor position when clicking after concealed text
            with 'virtualedit'.
Solution:   Store virtual columns in ScreenCols[] instead of text
            columns, and always use coladvance() when clicking.

This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.

closes: vim/vim#12808

e500ae8e29

Remove the mouse_adjust_click() function.

There is a difference in behavior with the old mouse_adjust_click()
approach: when clicking on the character immediately after concealed
text that is completely hidden, cursor is put on the clicked character
rather than at the start of the concealed text. The new behavior is
better, but it causes unnecessary scrolling in a functional test (which
is an existing issue unrelated to these patches), so adjust the test.

Now fully merged:
vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
2023-08-18 19:34:16 +08:00
zeertzjq
b0dda500e9 vim-patch:9.0.1705: cursor position wrong when clicking on an unprintable char
Problem:  cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.

closes: vim/vim#12664

b25dbb3f9b

Tests only. Code superseded by patch 9.0.1725.
2023-08-18 19:34:16 +08:00
zeertzjq
5ff725fa94 vim-patch:9.0.0048: cursor in wrong column with mouse click after concealed text
Problem:    Cursor in wrong column with mouse click after concealed text.
Solution:   Store the text column when drawing text.

b90818867c

Tests only. Code changes moved to the port of patch 9.0.1725.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-18 19:34:07 +08:00
zeertzjq
81d5550d77
vim-patch:9.0.1731: blockwise Visual highlight not working with virtual text (#24779)
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
          Check for double-width char inside virtual text.

closes: vim/vim#12606

6e940d9a1d

Need to remove area_active and use wlv.fromcol and wlv.tocol directly.
2023-08-18 14:00:12 +08:00
zeertzjq
71ad771ea4
fix(ui_compositor): only reset skipstart at first column (#24776)
Problem:    A double-width char in a floating window causes an extra
            space to be drawn to the left of its boundary.
Solution:   Only reset skipstart at the first column.

Fix #24775
2023-08-18 12:08:18 +08:00