Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
3b0d70f4ff
This includes only test_help.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem:
Crash on startup in some situations due to call to `set_curbuf`
with the current value of `cur_buf`.
Solution:
Switch buffers before doing the wipeout of the stdin buffer.
Use cmdline cmds instead of raw buffer pointers to avoid lifetime issues.
Problem: tests: No test when deleting text after autocompletion with preinsert
did complete an entry
Solution: Verify, that after deletion autocompletion does not reinsert
the deleted text. Note: the actual issue was fixed with v9.1.1750.
(Girish Palya)
Pre v9.1.1750 behaviour:
When autocomplete is enabled with *preinsert*, deleting text after selecting a
longer match could cause unintended reinsertion, e.g.:
- Matches available: "foo" and "foobar".
- User selects "foobar" with Ctrl-N
- User deletes characters back to "foo".
- Autocomplete then incorrectly re-inserts "bar", preventing deletion past "foo".
v9.1.1750 removes the unwanted reinsertion so text can be deleted correctly.
closes: vim/vim#18259fe0061c609
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
(Girish Palya).
When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.
Related to https://github.com/vim/vim/pull/18213.
closes: vim/vim#182542525c56e42
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: completion: redo (.) broken with preinsert and autocompletion
Solution: Make redo (.) work with preinsert and autocompletion
(Girish Palya)
closes: vim/vim#18253306a138172
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
(Girish Palya)
This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.
Try: `:set ac cot=preinsert`
See `:help 'cot'` for more details.
closes: vim/vim#18213fa6fd41a94
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: nvim_win_set_config may crash when attempting to move curwin to a
different tabpage if there is no other non-float available to switch to.
Solution: fix the crash. Fix ONE_WINDOW checks in winframe_find_altwin and
win_altframe to consider floating windows by instead using one_window. Allow
one_window to consider non-current tabpages. We can use one_window in
win_close_othertab now to also better reflect its use in win_close.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: cmdline-autocompletion breaks history navigation (ddad431)
Solution: Support history navigation in cmdline autocompletion (Girish
Palya)
Up/Down arrows support history navigation when using wildtrigger()
fixes: vim/vim#18207closes: vim/vim#18219708ab7f5fb
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem:
Currently, prompt_buffer manages `:` mark by itself and exposes it
read-only mark. However when it fails there can be no mitigation made
by plugins. The `:` mark should act like a regular marks and be
modifiable.
Solution:
Allow plugins to set `:` mark.
The flakiness happens because get() uses vim.schedule(), and a following
key may be processed before the scheduled event. Use poke_eventloop() to
ensure that the scheduled event is processed.
Problem: Matches may be listed twice with wildmode=longest,list when
"longest" doesn't change command line (after 9.1.1737).
Solution: Set did_wild_list when trying "list" after "longest"
(zeertzjq).
closes: vim/vim#18227a28a2eb9d9
Problem: Patch v9.1.1714 introduce a regression for wildmenu (zeertzjq)
Solution: Restore behavior of "longest" in 'wildmode' (Girish Palya)
- Fixed a regression caused by PR vim/vim#18125 selecting wrong item
- Fixed another regression where the first pasted text did not appear on
the command-line after starting Vim.
closes: vim/vim#182128fec92d631
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: completion: long line shown twice
(Maxim Kim)
Solution: Fix the issue, disable an incorrect test.
(Girish Palya)
fixes: vim/vim#18035closes: vim/vim#1808857379302aa
Omit removal of blank line in Test_noselect_expand_env_var() as it's
added again in patch 9.1.1682.
Cherry-pick two blank lines in Test_long_line_noselect() from patch
9.1.1682.
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Some environment variables which are useful when working inside
a bare repository can affect any Git operation.
Solution: Explicitly unset problematic environment variables.
Problem:
There is no straightforward way to pretty-print objects as JSON.
The existing `vim.inspect` outputs LON.
Solution:
Introduce an `indent` option for `vim.json.encode()` which enables
human-readable output with configurable indentation.
Adapts PR to upstream: openresty/lua-cjson#114
Problem:
Force resolve `spec.version` overrides the information about whether
a user supplied `version` or not. Knowing it might be useful in some use
cases (like comparing to previously set `spec` to detect if it has
changed).
Solution:
Do not resolve `spec.version`. This also improves speed when triggering
events and calling `get()`.
- Place default branch first when listing all branches.
- Use correct terminology in `get_hash` helper.
- Do not return `{ '' }` if there are no tags.
Problem:
There is no way to get more information about installed plugins, like
current revision or default branch (necessary if resolving default
`spec.version` manually). As computing Git data migth take some time,
also allow `get()` to limit output to only necessary set of plugins.
Solution:
- introduce arguments to `get(names, opts)`, which follows other
`vim.pack` functions. Plugin extra info is returned by default and
should be opt-out via `opts.info = false`.
- Examples:
- Get current revision: `get({ 'plug-name' })[1].rev`
- Get default branch: `get({ 'plug_name' })[1].branches[1]`
- `update()` and `del()` act on plugins in the same order their names
are supplied. This is less surprising.
- default `opts.info` to `true` since this simplifies logic for the
common user, while still leaving the door open for a faster `get()` if
needed.
As noted in #34908, the arm unittests fail due to unrecognized types:
ERROR test/unit/testutil.lua @ 802: Expressions parser works with &opt
test/unit/testutil.lua:774: test/unit/testutil.lua:758: (string) '
test/unit/testutil.lua:288: declaration specifier expected near '__SVFloat32_t''
exit code: 256
After testing on Debian's arm64 porterbox, the unittests cleanly pass
when ignoring various types defined in
/usr/include/aarch64-linux-gnu/bits/math-vector.h
Problem: after #34287 nvim_win_set_config no longer errors when attempting to
split from a floating window only if "win" is 0.
Solution: fix the regression, reduce the scope of "parent" and similar checks to
only where it's currently used and add test coverage for the errors.
Problem: Progress reports use plain `nvim_echo()` with manually
constructed messages and populate history on every call.
Solution: Use `nvim_echo()` with newly added `kind=progress` which (at
least for now) is meant to be a unified interface for showing progress
report. Also save in history only first and last progress report
messages.
Problem: filetype: .inc file detection can be improved
Solution: Update filetype detection for Pascal and BitBake code
(Martin Schwan).
Fix the detection of .inc files containing Pascal and BitBake code:
- the concatenated string, merged from three lines, only contains one
beginning and the pattern "^" would not match as expected. Use a range()
loop to iterate each line string individually. This way, the pattern "^"
works for beginning of lines.
- improve BitBake include file detection by also matching forward-slashes
"/" in variable names and assignment operators with a dot ".=" and "=.".
Valid examples, which should match, are:
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
MACHINEOVERRIDES =. "qemuall:"
BBPATH .= ":${LAYERDIR}"
- parse twenty instead of just three lines, to accommodate for potential
comments at the beginning of files
closes: vim/vim#182029fd1a657d2
Co-authored-by: Martin Schwan <m.schwan@phytec.de>
Problem:
Adding multigrid tests to `mouse_spec` requires all tests to test both
the multigrid and non-multigrid screen state, which adds a lot of extra
code.
Solution:
Instead of testing the full screen state, only test substrings of it.
- Problem: It's not clear for new plugin developers that `:help` uses
a help-tags file for searching the docs, generated by `:helptags`.
- Solution: Hint to the |:helptags| docs for regenerating the tags
file for their freshly written documentation.
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Solution: A window marked for ext_cmdline usage is still referenced
after it is already closed and freed.
Solution: Unset cmdline_win when the window is closed.
Problem: filetype: vivado journal/log files are not recognized
Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu).
closes: vim/vim#181919a6cafdc1c
Also fix missing anchor in the pattern from the port of patch 9.1.1602.
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem:
Currently it's only possible to test a single string match in the
screen, which makes it hard match multiple strings in the screen to
avoid having to compare the whole screen state.
It's also not possible to test if a string match is not found in the screen.
Solution:
Support an array of `any` matches and also support `none`, which does a
negative comparision.
Problem: a horizontal separator may be added to a window that doesn't need one
if there is no room when moving a different window.
Solution: only restore a hsep in winframe_restore when the global statusline is
enabled.
Problem:
insert-mode ctrl-r input is treated like raw user input, which is almost
never useful. This means any newlines in the input are affected by
autoindent, etc., which is:
- slow
- usually breaks the formatting of the input
Solution:
- ctrl-r should be treated like a paste, not user-input.
- does not affect `<c-r>=`, so `<c-r>=@x` can still be used to get the
old behavior.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
The default progress message doesn't account for
message-status. Also, the title and percent sections don't get written
to history. And progress percent is hard to find with variable length messages.
Solution:
Apply highlighting on Title based on status. And sync the formated msg
in history too. Also updates the default progress message format to
{title}: {percent}% msg
Problem:
The callback passed to `vim.wait` cannot return results directly, it
must set upvalues or globals.
local rv1, rv2, rv3
local ok = vim.wait(200, function()
rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } }
return true
end)
Solution:
Let the callback return values after the first "status" result.
local ok, rv1, rv2, rv3 = vim.wait(200, function()
return true, 'a', 42, { ok = { 'yes' } }
end)
Problem: tests: various tests can be improved
Solution: Use string interpolation to concatenate strings in
test_winfixbuf, check for specific errors in assert_fails()
(Yegappan Lakshmanan)
closes: vim/vim#1815197ea879b9b
Cherry-pick Test_file_perm.vim changes from patch 9.0.{0363,0611}.
Skip Test_colornames_assignment_and_unassignment().
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: filetype: fvwm2m4 files are no longer recognized
(after 9.1.1687).
Solution: Add a special case in m4 filetype detection (zeertzjq).
closes: vim/vim#181465355e81868
Co-authored-by: Damien Lejay <damien@lejay.be>
Problem: tests: no test for aclocal.m4
(after v9.1.1693)
Solution: Add a test that aclocal.m4 is detected as config filetype
related: vim/vim#18065f5670a1596
Co-authored-by: Christian Brabandt <cb@256bit.org>