tmux indicates its RGB support via setrgbb and setrgbf. In modern tmux
code, Tc and RGB just set setrgbb and setrgbf, so we can just check for
them.
Link: 7eb496c00c
(cherry picked from commit 88eb0ad149)
Co-authored-by: Tristan Partin <tristan@partin.io>
Problem:
`:checkhealth nvim` warns about missing vimrc if `init.lua` exists but
`init.vim` does not.
Solution:
Check for any of: init.vim, init.lua, $MYVIMRC.
Fix#25291
Backport of https://github.com/neovim/neovim/pull/25306
As specified by MAINTAIN.md, features should be soft deprecated at first
(meaning no warnings) to give people a chance to adjust. The problem
with this approach is that deprecating a feature becomes harder than
usual as during the soft deprecation period you need to remember not to
issue a warning, and during the hard deprecation period you need to
remember to start issuing a warning.
This behavior is only enforced if the `plugin` parameter is `nil` as
plugins may not want this specific behavior.
(cherry picked from commit 0a598c13b1)
This is a maintenance release, focusing on bugfixes.
Notably, fixes were made for using and testing Nvim on less
common platforms, like big endian systems.
BUG FIXES
- defaults: Set 'fsync'
- Dont create data dir if it's a broken symlink
- Make InspectTree handle nested injection
- Remove nested for_each_tree in TSTreeView
- api: Use a conditional stack for nvim_cmd
- change: Update fold after on_bytes
- deps: Bump libmpack from luarocks
- extmark_to_array: Convert conceal_char to bytes
- highlight: Apply 'winblend' to float border
- inccommand: Save and restore '[ and '] marks
- inccommand: Don't crash with "split" and 'n' flag
- lsp: Handle NUL bytes in popup text
- lua: Correct return value for on_key with no arguments
- lua: Crash in nlua_error
- man: Make :Man with a range work
- mappings: Fix mapset() not replacing map with backslash
- marks: Handle switching buffer properly
- mouse: Avoid dragging after click label popupmenu callback
- mouse: Avoid dragging when clicking next to popupmenu
- move: Check the correct buffer
- options: Setting 'scroll' with resized grid
- quickfix: Check if delete failed in qf_fill_buffer()
- set_bool_option: Use int value to make bool Object
- set_option_from_tv: Use v_bool to access boolean option
- terminal: Assign channel to terminal earlier
- terminal: Avoid Insert mode in Terminal buffer
- terminal: Don't lose focus on <MouseMove>
- terminal: Keep focus when scrolling number column of another window
- terminal: Make backslashes in 'shell' work on Windows
- treesitter: Foldexpr tweaks
- treesitter: Remove incompatible c query (again)
- ui: Empty line before the next message after :silent command
BUILD SYSTEM!
- Fix universal mac builds
- ci: Ensure correct headers are used on macOS
DOCUMENTATION
- List NVIM_APPNAME as env on manpage
- starting.txt: Correct step number
PERFORMANCE
- Remove redundant strlen in skipwhite
TESTING
- Fix dependencies between test cases and test flakiness
runtime(syntax): unlet b:filetype_in_cpp_family for cpp & squirrel
Update runtime/syntax/cpp.vim and runtime/syntax/squirrel.vim to unlet
b:filetype_in_cpp_family as it remains set even after updating the ft of
a file manually or through a modeline, not allowing c specific keywords
to be highlighted.
Since the variable b:filetype_in_cpp_family is only used by the c.vim
syntax script, unlet it directly after sourcing the c.vim runtime file
instead of at the end of the script.
Also update the last Change Header for both files.
closes: vim/vim#13650ff0baca865
Co-authored-by: laburnumT <laburnumtec@gmail.com>
(cherry picked from commit 6333be96ca)
Problem:
`LanguageTree:for_each_tree` calls itself for child nodes, so when we
calls `for_each_tree` inside `for_each_tree`, this quickly leads to
exponential tree calls.
Solution:
Use `pairs(child:trees())` directly in this case, as we don't need the
extra callback for each children, this is already handled from the outer
`for_each_tree` call
(cherry picked from commit 0712a4c085)
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Checking if it's non-empty and not a directory gets us quite far, but
not all the way. While a working symlink would trigger the earlier
checks, a broken symlink does not.
This commit fixes the special case where ~/.local/share/nvim already
exists but is a broken symlink. Thus, it fixes the following error on
startup:
E739: Cannot create directory /home/samuel/.local/share/nvim: file
already exists
(cherry picked from commit a6051e68a3)
backport #26034
Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888
Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.
Co-authored-by: Ploum <1233155+ploum@users.noreply.github.com>
This is a maintenance release, focusing on bugfixes.
BUG FIXES
- build: Fix exporting symbols on macOS Sonoma
- api: Handle NUL in nvim_err_write() and nvim_out_write()
- autocmd: Api functions accepting garbage after event name
- clang: Null pointer dereference in parse_msgpack
- clipboard: Don't pass --foreground to wl-copy
- exception: Remember whether message is multiline
- float: Update position of anchored windows first
- float: Fix some other crashes with :unhide or :all
- lua: Not using global value in vim.opt_global
- lua: Show error message when failing to set variable
- mouse: Click on 'statuscolumn' with 'rightleft'
- path: Accept special characters on Windows
- provider: Fix python3 provider cannot detect python3.12
- provider/pythonx: Import the correct module
- rpc: Fix race condition
- runtime: Add commentstring for D ftplugin
- statuscolumn: Update number hl for each screen line
- terminal: Check terminal size at end of screen update
- treesitter: Remove more double recursion
- ui: "resize -1" with cmdheight=0
- unhide: Close floating windows first
- unittests: Ignore __s128 and __u128 types in ffi
- tutor: Clarify the meaning of ✗ and ✓
BUILD SYSTEM!
- deps: Bump libmpack-lua to 1.0.11
- ci: fix mac release for Sonoma
This is a maintenance release, focusing on bugfixes.
BUG FIXES
- build: Fix exporting symbols on macOS Sonoma
- api: Handle NUL in nvim_err_write() and nvim_out_write()
- autocmd: Api functions accepting garbage after event name
- clang: Null pointer dereference in parse_msgpack
- clipboard: Don't pass --foreground to wl-copy
- exception: Remember whether message is multiline
- float: Update position of anchored windows first
- float: Fix some other crashes with :unhide or :all
- lua: Not using global value in vim.opt_global
- lua: Show error message when failing to set variable
- mouse: Click on 'statuscolumn' with 'rightleft'
- path: Accept special characters on Windows
- provider: Fix python3 provider cannot detect python3.12
- provider/pythonx: Import the correct module
- rpc: Fix race condition
- runtime: Add commentstring for D ftplugin
- statuscolumn: Update number hl for each screen line
- terminal: Check terminal size at end of screen update
- treesitter: Remove more double recursion
- ui: "resize -1" with cmdheight=0
- unhide: Close floating windows first
- unittests: Ignore __s128 and __u128 types in ffi
- tutor: Clarify the meaning of ✗ and ✓
BUILD SYSTEM!
- deps: Bump libmpack-lua to 1.0.11
Problem: No commentstring is set for D buffers after removing the
default C-style commentstring
Same solution than neovim#23039
(cherry picked from commit 222196824f)
PROBLEM: The builtin python3 provider cannot auto-detect python3.12
when g:python3_host_prog is not set. As a result, when python3 on $PATH
is currently python 3.12, neovim will fail to load python3 provider
and result in `has("python3") == 0`, e.g.,
"Failed to load python3 host. You can try to see what happened by ..."
ROOT CAUSE: the `system()` call from `provider#pythonx#DetectByModule`
does not ignore python warnings, and `pkgutil.get_loader` will print
a warning message in the very first line:
```
<string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and
slated for removal in Python 3.14; use importlib.util.find_spec() instead
```
SOLUTION:
- Use `importlib.util.find_spec` instead (python >= 3.4)
- Use `-W ignore` option to prevent any potential warning messages
(cherry picked from commit 3da511f1d0)
Problem: r_CTRL-C works differently in visual mode
Solution: Make r_CTRL-C behave consistent in visual mode
in terminal and Windows GUI
in visual mode, r CTRL-C behaves strange in Unix like environments. It
seems to end visual mode, but still is waiting for few more chars,
however it never seems to replace it by any characters and eventually
just returns back into normal mode.
In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area
all characters by a literal CTRL-C.
Not sure why it behaves like this. It seems in the Windows GUI, got_int
is not set and therefore behaves as if any other normal character has
been pressed.
So remove the special casing of what happens when got_int is set and
make it always behave like in Windows GUI mode. Add a test to verify it
always behaves like replacing in the selected area each selected
character by a literal CTRL-C.
closes: vim/vim#13091closes: vim/vim#13112476733f3d0
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit d2678c78dc)
`LanguageTree:parse` is recursive, and calls
`LanguageTree:for_each_child`, which is also recursive.
That means that, starting from the third level (child of child of root),
nodes will be parsed twice.
Which then means that if the tree is N layers deep, there will be ~2^N
parses even if the branching factor is 1.
Fixes: #25104
This is a maintenance release, focused on bug fixes and improvements.
However, There are included features related to TUI and :terminal.
BRAM
Nvim is a fork of the Vim editor, created and developed by Bram Moolenaar.
On August 3, 2023, he passed away at the age of 62. If Vim or Nvim have
been of use to you in your life, read `:help Bram` and `:help Uganda`
and consider honoring his memory in a way you see fit.
CHANGES SINCE 0.9.1
BREAKING CHANGES
An adjustment was made to the `grid_line` event as part of the exernal
UI protocol the `cells` array might now end with a `[' ', attr, 0]` item
with a repeat count of zero. This is needed by the TUI to disambiguate
final spaces on a line from just clearing the line, which will make a
difference when copying text using the terminal emulators builtin
primary selection support.
External UI:s can safely ignore such an empty item and most UIs already
handle this fine. But it could break some UI:s which has an assert to
validate the cell count to be bigger than zero, or similar checks.
FEATURES
- tui: Support Super and Meta modifiers
- terminal: forward more special keys and modifier-mouse combinations
BUG FIXES
- lua: Always set arg0 to lua scripts
- api: Redundant error when using `nvim_cmd`
- api, lua: Make blank lines in a message work properly
- column: fix bugs related to signs in 'statuscol'
- completion: Don't add backslash in runtime completion
- diff: Filler lines for hunks bigger than linematch limit
- edit: Fix K_EVENT interfering with 'digraph'
- editorconfig: Better validation and error handling
- events: Don't expand non-file as file name
- events: Trigger VimResume on next UI request
- extmarks: Wrong display when changing text with virt_lines
- folds: Update folds in Insert mode with fdm=indent
- helptags: Make multibyte help tags work properly
- highlight: Make CurSearch work properly with 'winhl'
- inccommand: Fix saving of undo info
- keycodes: Recognize <t_xx> as a key
- lsp: Do not assume client capability exists in watchfiles check (#24558)
- mouse: Handle folded lines with virt_lines attached to line above
- remote: Make --remote-expr print to stdout
- remote: Restore previous --remote-expr output formatting
- spell: Splice extmarks on :spellrepall
- startup: Don't truncate when printing with -l
- startup: Run embedded Nvim with real path
- statusline: Redraw when Visual submode changes
- statusline: Fill for double-width char after moving items
- treesitter: updates to queries and injections
- treesitter: Fix TSNode:tree() double free
- ui: Propagate line wrapping state on grid_line events
- ui: Avoid ambiguity about chunk that clears part of line
PERFORMANCE
- extmarks: Avoid unnecessary marktree traversal with folds
- substitute: Don't reallocate new_start every time
BUILD SYSTEM
- deps: Bump libvterm to 0.3.3
- deps: Bump LuaJIT to HEAD - 03c31124c
- deps: Bump libuv to v1.46.0
- deps: Bump Luv to 1.45.0-0
- deps: Bump tree-sitter-c to v0.20.5
- deps: Bump tree-sitter-lua to v0.0.18
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
(cherry picked from commit 84376afc72)
When an injection has not set include children, make sure not to add
the injection if no ranges are determined.
This could happen when there is an injection with a child that has the
same range as itself. e.g. consider this Makefile snippet
```make
foo:
$(VAR)
```
Line 2 has an injection for bash and a make variable reference. If
include-children isn't set (default), then there is no range on line 2
to inject since the variable reference needs to be excluded.
This caused the language tree to return an empty range, which the parser
now interprets to mean the full buffer. This caused makefiles to have
completely broken highlighting.
Backports #24550.
Adjusts test to expect that didChangeWatchedFiles is *not* registered if
client `capabilities` is nil (as it's not enabled by default for v0.9).
fix(ui): delay win_viewport until screen update #24182
Problem:
Sometimes, when nvim sends the `win_viewport` event, for example when scrolling
with visible folds on the screen, it reports the `scroll_delta` value one batch
into "future". So when the client application is trying to show the new viewport
it's not yet updated, resulting in temporary corruption / screen flickering.
For more details see #23609, and starting from [this comment](
https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in
https://github.com/neovide/neovide/pull/1790,, where the issue was first
detected. Note that some of the conclusions in those are not fully accurate, but
the general observations are.
Solution:
When there are pending updates to a Window, delay the `win_viewport` UI event
until the updates are sent. This ensures that there's no flush between sending
the viewport and updating of the lines corresponding to the new viewport.
Document the existing viewport behaviour (for cases where there are no
extra flushes), give a hint about how applications can deal with the slightly
surprising behaviour of the viewport event being sent after the updates.
Fixes https://github.com/neovim/neovim/issues/23609