Problem: fnamemodify() treats ".." and "../" differently.
Solution: Expand ".." properly like how "/.." is treated in 8.2.3388.
(zeertzjq)
closes: vim/vim#152181ee7420460
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>
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>
Problem: Cannot use relative paths as findfile() stop directories.
Solution: Change a relative path to an absolute path.
(zeertzjq)
related: vim/vim#15200closes: vim/vim#15202764526e279
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#15202e6ab23bd4a
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#1520268819afb2c
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#15217e7b98ab96e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: fnamemodify('path/..', ':p') differs from using 'path/../'.
Solution: Include the "/.." in the directory name. (closesvim/vim#8808)
4eaef9979f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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#4478closes: vim/vim#15198893eeeb445
Co-authored-by: LemonBoy <thatlemon@gmail.com>
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#13604c03f631b7b
Co-authored-by: Christian Brabandt <cb@256bit.org>
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#151992e7d89b398
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#151901ad194c0df
Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
Problem: No test for antlr4 filetype
(after 9.1.0550)
Solution: Add a simple filename test
related: vim/vim#151918fc23bb8a4
Co-authored-by: Christian Brabandt <cb@256bit.org>
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#8201closes: vim/vim#151854ff3a9b1e3
Co-authored-by: LemonBoy <thatlemon@gmail.com>
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#15097closes: vim/vim#1510948b7d05a4f
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Neovim bundles treesitter parsers for bash and python but does
not use them by default. This dilutes the messaging about the bundled
parsers being required for functionality or reasonable out-of-the-box
experience. It also increases the risk of query incompatibilities for no
gain.
Solution: Stop bundling bash and python parser and queries.
Problem: Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
(zeertzjq)
fixes: vim/vim#15069closes: vim/vim#150718145620a95
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#8334closes: vim/vim#15124b975ddfdf9
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: filetype: zone files are not recognized
(rpdprd)
Solution: Detect '*.zone' files as bindzone filetype
fixes: vim/vim#14222f095539b39
Co-authored-by: Christian Brabandt <cb@256bit.org>
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#15033closes: vim/vim#1511025ac6d67d9
Co-authored-by: distobs <cuppotatocake@gmail.com>
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#15095closes: vim/vim#1510565407ce1d2
Co-authored-by: glepnir <glephunter@gmail.com>
This patch replaces fswatch with inotifywait from inotify-toools:
https://github.com/inotify-tools/inotify-tools
fswatch takes ~1min to set up recursively for the Samba source code
directory. inotifywait needs less than a second to do the same thing.
https://github.com/emcrisostomo/fswatch/issues/321
Also it fswatch seems to be unmaintained in the meantime.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
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#150707ccd1a2e85
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
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
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#15101closes: vim/vim#15102761a420c66
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#538closes: vim/vim#15128749ba0f6d9
Cherry-pick Test_deeply_nested_source() from patch 8.2.5169.
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem:
Error when calling vim.treesitter.start() and vim.treesitter.stop() in
init.lua.
Solution:
Ensure syntaxset augroup exists after loading synload.vim.
Although the built-in pum completion mechanism will filter anyway on the
next input it is odd if the initial popup shows entries which don't
match the current prefix.
Using fuzzy match on the label/prefix is compatible with
`completeopt+=fuzzy` and also doesn't seem to break postfix snippet
cases
Closes https://github.com/neovim/neovim/issues/29287
This is a breaking change which will make refactor of typval and shada
code a lot easier. In particular, code that would use or check for
v:msgpack_types.binary in the wild would be broken. This appears to be
rarely used in existing plugins.
Also some cases where v:msgpack_type.string would be used to represent a
binary string of "string" type, we use a BLOB instead, which is
vimscripts native type for binary blobs, and already was used for BIN
formats when necessary.
msgpackdump(msgpackparse(data)) no longer preserves the distinction
of BIN and STR strings. This is very common behavior for
language-specific msgpack bindings. Nvim uses msgpack as a tool to
serialize its data. Nvim is not a tool to bit-perfectly manipulate
arbitrary msgpack data out in the wild.
The changed tests should indicate how behavior changes in various edge
cases.
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#1508188bbdb04c2
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: with a single `context.options` there is no way for user to
force which scope (local, global, both) is being temporarily set and
later restored.
Solution: replace single `options` context with `bo`, `go`, `wo`, and
`o`. Naming and implementation follows how options can be set directly
with `vim.*` (like `vim.bo`, etc.).
Options are set for possible target `win` or `buf` context.
Problem: `vim._with()` has many different use cases which are not
covered with tests.
Solution: cover with tests. Some (many) test cases are intentionally
marked as "pending" because they cover cases which don't work as
expected at the moment (and fixing them requires specific knowledge of
C codebase). Use them as a reference for future fixes.
Also some of "can be nested" tests currently might pass only because
the tested context doesn't work.
Instead of looping over all captured nodes, just take the end range from
the last node in the list. This uses the fact that nodes returned by
iter_matches are ordered by their range (earlier to later).
Problem: Treesitter highlighter clears the already populated highlight
state when performing spell checking while drawing a
smoothscrolled topline.
Solution: Save and restore the highlight state in the highlighter's
_on_spell_nav callback.
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#15053resolves: neovim/neovim#2940549012cd8c2
Co-authored-by: Tyler Miller <tmillr@proton.me>
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#29431closes: vim/vim#150657002c055d5
Problem: hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
(Shougo Matsushita)
closes: vim/vim#15040d09521476f
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Problem:
`o`-ing on a folded line opens the fold, because the new line gets the
fold level from the above line (level '='), which extends the fold to
the new line. `O` has a similar problem when run on the line below a
fold.
Solution:
Use -1 for the added line to get the lower level from the above/below
line.
Problem: too complicated mapping restore in termdebug
Solution: simplify unmapping logic, add a few more tests
(Ubaldo Tiberi)
closes: vim/vim#1504646f2823807
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Problem: inner-tag textobject confused about ">" in attributes
Solution: Skip over quoted '>' when determining the start position
fixes: vim/vim#15043closes: vim/vim#15049ca7f93e6f3
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: termdebug can be further improved
Solution: refactor save/restore, update docs,
add a new save/restore test (Ubaldo Tiberi)
closes: vim/vim#15032a48637c105
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
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>
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.
fixesvim/vim#14933closes: vim/vim#1501423c5ebeb95
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: Hit assert when clicking inside a padded 'statuscolumn' that
is padded beyond the length of the allocated click_defs.
Solution: Still consider this a "in_statuscol" click, but return early
when about to execute the click func.
Followup to #28515:
Rename the static os_homedir() to os_uv_homedir() to emphasize that it
is a wrapper around a libuv function.
Add the function os_get_homedir() to os/env.c to return the cached
homedir value as a const. Must be called after homedir is initialized or
it fails.
The difference between this function and the static os_uv_homedir() is
that the latter gets the homedir from libuv and is used to initialize
homedir in init_homedir(), while os_get_homedir() just returns homedir
as a const if it's initialized and is public.
Use the os_get_homedir() accessor for ~/ expansion on Windows to make
the code more concise.
Add a Windows section to main_spec.lua with tests for expanding ~/ and
~\ prefixes for files passed in on the command-line.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Do the expansion right after setting the expand context, so that the
length of the completion prefix can be set, but don't do that directly
in set_one_cmd_context(), as that's also called by getcmdcompltype().
Problem: matched text is highlighted case-sensitively
Solution: use MB_STRNICMP, update highlighting when the base changes
(glepnir)
fixes: vim/vim#15021closes: vim/vim#15023f189138b39
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
(zeertzjq)
closes: vim/vim#15029d8c9340fc6
Cherry-pick syntax.txt change from runtime update.
Problem: Wrong matched text highlighted in pum with 'rightleft'.
Solution: Match using the original text instead of the reversed text.
(zeertzjq)
closes: vim/vim#1502063901e8963
Problem: A custom 'statuscolumn' needs to check a bunch of options and
placed signs to replicate the default number column.
Solution: Rework %l item to include the necessary logic to mimic the
default number column. Remove now redundant %r item.
Problem: Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)
closes: vim/vim#150120d4d23dac0
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
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#15018acc8746941
Problem: default completion may break with fuzzy
Solution: check that completion_match_array is not null
(glepnir)
closes: vim/vim#15010aced8c2f4f
Co-authored-by: glepnir <glephunter@gmail.com>
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#15005883018feff
Problem: Wrong padding for pum "kind" with 'rightleft'.
Solution: Fix off-by-one error (zeertzjq).
The screen_fill() above is end-exclusive, and
- With 'rightleft' it fills `pum_col - pum_base_width - n + 1` to `col`,
so the next `col` should be `pum_col - pum_base_width - n`.
- With 'norightleft' it fills `col` to `pum_col - pum_base_width + n - 1`,
so the next `col` should be `pum_col - pum_base_width + n`.
closes: vim/vim#15004a2324373eb
Problem:
When 'ignorecase' is set, the default keymap Q and Q would exit visual
mode.
This issue was raised in #28287 and a fix was applied in #28289.
However, `==` operator is subject to user `ignorecase` setting.
Solution:
Switching to `==#` operator would guarantee case sensitive comparison
between visual mode and linewise visual mode.
Co-authored-by: Kuanju Chen <kuanju.chen@mksinst.com>
Problem: completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
(glepnir)
closes: vim/vim#14955f94c9c482a
Co-authored-by: glepnir <glephunter@gmail.com>
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#14996afbe5359e9
Problem: Cannot see matched text in popup menu
Solution: Introduce 2 new highlighting groups: PmenuMatch and
PmenuMatchSel (glepnir)
closes: vim/vim#1469440c1c3317d
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
(zeertzjq)
closes: vim/vim#149888e56747fd2
Problem:
For snippets lsp.completion prefers the label if it is shorter than the
insertText or textEdit to support postfix completion cases but clangd
adds decoration characters to labels. E.g.: `•INT16_C(c)`
Solution:
Use parse_snippet on insertText/textEdit before checking if it is
shorter than the label.
Fixes https://github.com/neovim/neovim/issues/29301
Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly
used, but `:color vim` does not set them to the values used in Vim.
This might be fine if `:color vim` is treated as "the state of default
color scheme prior the big update", but it seems to be better treated
as "Vim's default color scheme" (how it is documented in its header).
Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to
'runtime/colors/vim.lua'.
Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg`
used in source, as the latter caused some problems in the past (if
`Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the
foreground value).
Also realign the rest of the background conditional highlight groups.
This reduces the number of nil checks around buf_versions usage
Test changes were lifted from 5c33815
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
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#14980ef8eab86e2
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Problem: glob() not sufficiently tested
Solution: Add more tests for directory containing [] chars
related: vim/vim#149918b34aea1b0
Co-authored-by: Christian Brabandt <cb@256bit.org>
These highlight groups are used for the statusline in :terminal windows.
By default they link to StatusLine and StatusLineNC (respectively), so
there is no visual difference unless a colorscheme defines these groups
separately.