Problem: Using \{xxx} for encoding a modifier is not nice.
Solution: Use \<*xxx> instead, since it's the same as \<xxx> but producing a
different code.
fccd93f091
Use this notation in langmap_spec.
Problem: GUI tests fail because the test doesn't use a modifier.
Solution: Add "\{xxx}" to be able to encode a modifier.
ebe9d34aa0
Change macros to enums to use them in unit tests.
This marks the following Vim patches as ported:
vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Problem: With modifyOtherKeys CTRL-^ doesn't work.
Solution: Handle the exception.
828ffd5963
vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Problem: Other text for CTRL-V in Insert mode with modifyOtherKeys.
Solution: Convert the Escape sequence back to key as if modifyOtherKeys is
not set, and use CTRL-SHIFT-V to get the Escape sequence itself.
(closesvim/vim#5254)
fc4ea2a72d
vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Problem: CTRL-V U doesn't work to enter a Unicode character when
modifyOtherKeys is effective. (Ken Takata)
Solution: Add a flag to get_literal() for the shift key. (closesvim/vim#7413)
0684e36a7e
Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
Problem:
winpty is only needed for Windows 8.1. Removing it reduces our build and code
complexity.
Solution:
- Remove winpty.
- Require Windows 10.
closes#18252
Problem:
I had some issues where multiple plugins (vim-fzf and fugitive) was slow
because of my `.zshenv`.
Solution:
Check shell performance in :checkhealth.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Some language servers send empty `textDocument/publishDiagnostics`
messages after indexing the project with URIs corresponding to unopened buffers.
This commit guards against opening buffers corresponding to empty diagnostics.
Problem: Using matchfuzzy() on a long list can take a while.
Solution: Add a limit to the number of matches. (Yasuhiro Matsumoto,
closesvim/vim#10189)
9029a6e993
The default value of including F in 'shortmess' has the unfortunate side
effect of hiding output from autocommands. This is a common source of
confusion and often leads people to think their autocommands are not
working when they are. There is a small snippet in the docs for
'shortmess' indicating that the F flag suppresses autocmd output, but
it's not easy to find if you don't already know to look for it.
This commit removes that behavior of the F flag to make it only suppress
file info when opening a new file.
This reverts commit 526798a941.
This will make man filetype not modifiable by default, as it is the
superior behavior in my opinion. More importantly, also make it possible
for a user to modify man filetypes by adding `set modifiable` in
`~/.config/nvim/ftplugin/man.vim` or its equivalent.
ref #11450closes#17595
Co-authored-by: Javier López <graulopezjavier@gmail.com>
In `filetype.lua`, source runtime `ftdetect` scripts within the `filetypedetect` augroup, same as `filetype.vim` (and only do so if `g:did_load_ftdetect` does not exist).
`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.
Some people ran into issues trying to use `callback = myluafun` because
of the event data payload.
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
The LSP progress handler would put non-progress messages (such as from
clangd or pyls; not part of the LSP spec) directly into
`client.messages`, while `vim.lsp.util.get_progress_messages()` would
try to fetch them from `client.messages.messages` instead (and come up
empty everytime). This would result in these messages never being
cleaned up by `get_progress_messages()`.
This commit fixes that by treating those messages like show-once
progress messages (by setting `done=true` immediately).
Problem: KRL files using "deffct" not recognized.
Solution: Adjust the pattern used for matching. (Patrick Meiser-Knosowski,
closesvim/vim#10200)
93c7a45e86
BREAKING CHANGES
* Support for Python 2 is dropped. For Python 3, the minimum supported version is 3.6. Legacy `:pythonx` commands are still available, and always uses the python 3 provider.
* api: Existing usages of `nvim_buf_set_text` that use negative line numbers will be off-by-one.
* highlight: signature of `vim.highlight.range` was changed.
* input: distinguish between some input keys which previously were synonyms. This will break some exiting mappings.
- `<cr>`, `<tab>` and `<esc>` are no longer considered equivalent to `<c-m>`, `<c-i>` and `<c-[`> respectively. In case the terminal or GUI supports distinguishing these keys, these can now be mapped separately. But even if the terminal only can send one code you might still need to change what variant is used in the config.
FEATURES
Core APIs:
* api: add support for lua function & description in keymap
* api: add api and lua autocmds
* api: nvim_clear_autocmd
* api: pass args table to autocommand callbacks
* api: remove Lua autocommand callbacks when they return true
* api: implement nvim_{add,del}_user_command
* api: implement nvim_buf_get_text
* api: add nvim_get_option_value
* highlight: ns=0 to set :highlight namespace
* highlight: support for blend in nvim_set_hl
* api: add strikethrough, nocombine to set_hl
* api: relax statusline fillchar width check
Lua:
* lua: add vim.keymap
* lua: add vim.spell
* lua: add proper support of luv threads
* lua: make :lua =expr print result of expr
* lua: handle lazy submodules in `:lua vim.` wildmenu completion
* lua: add notify_once()
* lua: add support for multiple optional types in vim.validate
* lua: show proper verbose output for lua configuration
* lua: more conversions between LuaRef and Vim Funcref
* lua: support converting nested Funcref back to LuaRef
* call __tostring on lua errors if possible before reporting to user
* filetype.lua
* filetype.lua: add support for files under .git
* filetype.lua: add support for patch files
* filetype.lua: add support for tmux.conf files
* filetype.lua: add support for txt files
* filetype.lua: Add typescript extension to filetype detection
* filetype.lua: fix .cc file not detected
* filetype.lua: fix .env file not detected
* filetype: convert patterns for mail buffers
* filetype: support scripts.vim with filetype.lua
UI and decorations:
* decorations: support signs
* extmarks: add strict option
* api: expose extmark more details
* api: expose extmark right_gravity and end_right_gravity
* use nvim_buf_set_extmark for vim.highlight
* statusline: support multibyte fillchar
* add support for global statusline
Treesitter:
* ui: allow conceal to be defined in decorations and tree-sitter queries
* tree-sitter: allow Atom-style capture fallbacks
* treesitter: add more default groups to highlight map
* treesitter: multiline match predicates
* treesitter: set allocator when possible
* ts: add support for multiline nodes in get_node_text
* ts: expose minimum language version to lua
* runtime: add query filetype
LSP and diagnostic:
* diagnostic: add "code" to the diagnostic structure
* diagnostic: allow retrieving current diagnostic config
* lsp,diagnostic: open folds in jump-related functions
* lsp: add buf_detach_client
* lsp: add handler for workspace/workspaceFolders
* lsp: dynamically generate list title in response_to_list
* lsp: enable default debounce of 150 ms
* lsp: skip or reduce debounce after idle
* lsp: use `vim.ui.select` for selecting lsp client
Initial work to support remote TUI (and ui client library):
* ui_client: connect to remote ui
* ui_client: implement event handlers
* ui_client: handle resize events
* ui_client: implement async paste handling
* ui_client: pass user input to remote server
* --headless: add on_print callback to stdioopen
* add autocommand event when search wraps around
* add vim.tbl_get
* autocmd: add Recording autocmds
* autocmd: populate v:event in RecordingLeave
* completion: support selecting item via API from Lua mapping
* eval/method: partially port v8.1.1993
* eval/method: partially port v8.1.1996
* eval/method: partially port v8.1.2004
* eval: partially port v8.2.0878
* eval: port emsg from v8.2.3284
* events: add DirChangedPre
* events: support SIGWINCH for Signal event
* hardcopy: check gui colours for highlights first
* highlight: support color names for cterm
* ignore nore on <Plug> maps
* input: delay some conversions to vgetc()
* input: enable <tab>/<c-i>, <cr>/<c-m>, <esc>/<c-[> pairs unconditionally
* keymap: add F38-F63 keys
* keymap: return nil from an expr keymap
* mappings: considering map description when filtering
* provider: remove support for python2 and python3.[3-5]
* remote: add basic --remote support
* runtime: import cleanadd.vim from Vim
* runtime: include Lua in C++ ftplugin
* runtime: new checkhealth filetype
* term: use vterm_output_set_callback()
* test: use nvim_exec in helpers.source()
* trigger ModeChanged for terminal modes
* tui: add error logging
* tui: add support for `CSI 4 : [2,4,5] m`
* tui: enable CSI u keys
* vim-patch.sh: support additional args for -s
Performance Improvements
* lsp: request only changed portions of the buffer in changetracking
* only redraw concealed line if cursor has moved horizontally
* pre-compile embedded Lua source into bytecode
* screen: reduce cursorline redrawing when jumping around
* treesitter: cache query parsing
* api: elide luaref copy when setting 'callback' in nvim_set_keymap
BUG FIXES
* --headless: do not block on press-enter prompts when no UI
* <Nop> not shown in :map commands
* add forkpty for SunOS variants
* add STRNLEN compatability macro
* anonymous sid not working
* api, lua: return NIL on failure to find converted function
* api/nvim_win_call: share common win_execute logic
* api: allow empty list for cterm in nvim_set_hl
* api: allow nvim_buf_set_extmark to accept end_row key
* api: convert blob to NUL-terminated API string
* api: correctly handle negative line numbers for nvim_buf_set_text
* api: correctly pass f-args for nvim_create_user_command
* api: delete all autocmds with the same ID
* api: force redefinition of user commands by default
* api: highlight attribute for underline
* api: improve autocmd error handling
* api: include event in get_autocmds
* api: make nil value in nvim_set_option_value clear local value
* api: nvim__set_hl_ns causes extra redraws
* api: nvim_win_set_cursor() redraw for cursorline and statusline
* api: re-route nvim_get_runtime_file errors
* api: use changedir_func() in nvim_set_current_dir()
* api: validate command names in nvim_add_user_command
* api: validate user_command name
* append test for checking zero width node range
* aucmd_win: always make aucmd_win the last window
* aucmd_win: ensure aucmd_win stays floating
* autocmd: clean up autocmds only when needed
* autocmd: restore autocmd showing behavior
* autoload variables not loaded with vim.g & nvim_get_var
* bounds check for underdot
* build: check for empty value of LUAC_PRG
* build: check that LuaJIT has required modules for compilation
* build: install luajit modules on windows
* channel: fix channel consistency
* check for interrupt in nvim_echo, write_msg and nlua_print
* checkhealth: make provider checkhealth output more consistent
* ci/backport: check for event_name == "pull_request_target"
* ci: provide necessary permissions for calling workflow
* clang/'Dead store': do not assign endcol
* close floating windows when calling win_close()
* completion: prevent K_LUA from closing pum
* completion: update submode message when selecting from API
* correct vertical dragging room calculation with global statusline
* coverity/175977: big parameter passed by value
* coverity/188749: nullify pointer to fix use-after-free
* coverity/340720: error if nvim_eval_statusline given invalid winid
* coverity: dead code and operands don't affect result
* decorations: do not put empty virt_text
* define NAME_MAX from _XOPEN_NAME_MAX
* diagnostic: allow setting arbitrary config values
* diagnostic: assert that diagnostics have line number and column
* diagnostic: clamp diagnostics on negative line numbers
* diagnostic: escape special chars in file names
* diagnostic: improve validation for list arguments
* diagnostic: make `open_float` respect global diagnostic options
* diagnostic: only set default handler config if unset
* diagnostic: resolve nil opts tables
* diagnostic: respect "if_many" source option for virtual text
* diagnostic: set effective buffer number for DiagnosticChanged autocmd
* diagnostic: set effective buffer number in autocmd (again)
* diagnostic: use botright copen for qflist
* diff: make algorithm work for vim.diff
* do not cast offset to char_u
* do not pass aucmd to the callback
* do not save K_EVENT as lastc in Insert mode
* docs: add bufnr and user_data to diagnostic-structure
* docs: spelling in new underlines docs
* don't include pty.h on SunOS
* don't use cfsetspeed, use i and o variants
* enable filetype detection and syntax highlighting with --clean
* eval/method: add missing method support for existing built-ins
* eval: v:lua support for `-` in module names
* event-loop: call vpeekc() directly first to check for character
* event-loop: check if executed register has ended
* event-loop: duplicate display updating logic in vgetorpeek()
* events: make v:event readonly in more events
* ex_normal: spam \n in Ex mode only if in Cmdline mode
* extmarks: fix signs
* extmarks: splice extmarks on accepting spell
* filetype.lua: always return a string in getline helper function
* filetype: expand tildes in filetype patterns
* filetype: fix foam pattern detection
* filetype: match negative priority patterns after extensions
* filetype: match on <afile> rather than <abuf>
* filetype: normalize slashes in file paths
* filetype: set default ft_ignore_pat in filetype.lua
* float: do not switch window before deleting last listed buffer
* float: don't always switch window when deleting last listed buffer
* float: handle buffer deletion with floating windows
* float: make laststatus=1 behave consistently with floating windows
* healthcheck: handle empty reports
* health: do not run external processes in a shell
* highlight: accept NONE as a color name
* highlight: allow globals to be cleared
* highlight: always update window highlight if highlight changed
* inccommand: do not change reg_prev_sub when previewing
* input: do not translate scroll keys into multiclicks
* input: fix clearing of reg_executing
* input: never escape CSI bytes
* input: put modifiers back into typeahead buffer when needed
* input: remove reinterpreted ALT/META chords from recorded macro
* keymap: don't coerce false to ''
* keywordprg: retain terminal buffer after K
* line continuation: set growsize to correct value
* lsp and diagnostic highlight priority
* lsp: always split text edits on \r, \r\n, and \n
* lsp: always use target bufnr in location handler
* lsp: avoid attaching to unloaded buffers
* lsp: avoid nil workspace/symbol query
* lsp: call config on_exit handler before context is cleared
* lsp: correct prefix when filterText is present
* lsp: correctly align start and end range to codepoints during incremental sync
* lsp: create lsp requests with position offsets considering client encoding
* lsp: ensure pending changes are flushed on skipped debounce
* lsp: explicitly pass bufnr in didSave handler
* lsp: fetch offset_encoding from client in references
* lsp: fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods
* lsp: fix applying multiple out-of-range TextEdits
* lsp: fix lookup of boolean values in workspace/configuration
* lsp: forward offset_encoding in rename handler
* lsp: forward offset_encoding to apply_text_edits
* lsp: handle insertion of previous line
* lsp: handle negative activeSignature in signatureHelp
* lsp: only send valid params in executeCommand
* lsp: pass offset_encoding in formatexpr()
* lsp: progress handlers should return vim.NIL on error
* lsp: resolve bufnr for get_lines
* lsp: resolve nil bufnr
* lsp: respect all of 'fixeol', 'eol', and 'binary' applying edits
* lsp: set tabSize from 'shiftwidth', not 'softtabstop'
* lsp: start incremental sync range at previous newline character
* lsp: strictly enforce passing offset encoding
* lsp: suppress ContentModified errors from UI
* lsp: use "text" filetype for plaintext
* lsp: use botright copen for all handlers
* lua: don't use nlua_error when exiting early
* lua: print multiple return values with =expr
* lua: restore priority of the preloader
* lua: stricter type check when calling API function
* make mode() return correct value in ex mode
* man.vim: fix search function on some systems
* man.vim: support calling :Man without a section again
* msgpack#strptime: use calendar.timegm to get seconds since epoch
* ops: str_to_reg passing NULL to memcpy
* options: disallow empty 'fdc' and 'scl'
* paste: avoid edges cases caused by empty chunk
* paste: deal with eol and eof in Visual mode
* paste: deal with trailing new line in chunk
* paste: don't move cursor past the end of pasted text in Normal mode
* paste: escape control characters in Cmdline mode
* paste: use getcmdtype() to determine whether in cmdline mode
* prompt: add missing changes from v8.1.0036
* pty_process_win/wait_eof_timer_cb: also check for proc->out.did_eof
* pum_redraw: use grid_puts_len() to truncate the text
* PVS/V1019: compound assignment expression is used inside condition
* PVS/V560: ignore false "conditional expression is always false"
* PVS/V583: the '?:' operator always returns one and the same value
* query.lua: check empty table for lines
* quickfix: avoid O(N^2) when filling from string typval
* remote: make compile again
* remote: report connection error, missing return values
* remote: report on missing wait commands, typecheck lua results
* remote: respect silent in error reporting
* remote: use STATIC_CSTR_AS_STRING
* resolve nil arguments to API functions
* respect os_proc_children rv of pid not found
* runtime: add missing release metadata
* runtime: add syntax file for query
* runtime: check markdownError before syn-clear
* screen: do not do syntax highlighting at filler or folded lines
* screen: do not draw filler lines post eof if already at last row
* screen: do not update syntax_last_parsed when drawing folded line
* screen: don't put empty sign text in line number column
* screenpos, float: add top and left border adjustment
* screen: truncate double-width character correctly
* screen: truncate when overwriting right half of a double-width char
* set nested before executing callback
* set RedrawingDisabled before entering aucmd_win
* signcol: always trigger a redraw
* signcol: handle edge case with maximum value
* signcol: update cursor when signcol changes
* skip libutil on SunOS
* substitute: properly check for empty command line
* syntax.c: correct hunk from Vim patch 8.0.0647
* syntax: remove trailing spaces in vim.vim
* tabpage: correct check for failure to close window
* termdebug: handle exiting during startup properly
* terminal: correctly forward mouse events
* terminal: fix resize crash with pending scrollback
* terminal: ignore left-release mouse action
* terminal: return early if there are no invalid rows
* terminal: use coladvance() to calculate buffer cursor position
* test: only use buffer completion in popupmenu timer test
* tests: update legacy tab switch test to be sane
* translation: po file for Russian
* translation: po file for Ukrainian
* ts: escape lang when loading parsers
* tui: avoid using uninitialized memory in kitty
* tui: correct CSI sequence
* tui: end streamed paste correctly when key buffer is empty
* tui: remove `ESC NUL` forced escape
* ui: close floating window on BufLeave event
* ui: inccomand performance degradation
* ui: make window resize commands manage cmdheight
* update last cursor on first CursorMoved
* uri: change scheme pattern to not include the comma character
* use normal! <C-L> in default <C-L> mapping
* vim-patch.sh: fix N/A files patterns
* win_close: count the window the be closed instead of curwin
* win_split_ins: do not fail when oldwin is not valid
Problem: Supercollider filetype not recognized.
Solution: Match file extentions and check file contents to detect
supercollider. (closesvim/vim#10142)
8cac20ed42
Problem: Cannot add a digraph with a leading space. It is not easy to list
existing digraphs.
Solution: Add setdigraph(), setdigraphlist(), getdigraph() and
getdigraphlist(). (closesvim/vim#8580)
6106504e9e
Use GA_APPEND_VIA_PTR in registerdigraph().
Use tv_list_append_*() in getdigraphlist_appendpair().
Put the error messages in digraph.c.
E196 is N/A.
Remove mentions about 'encoding' being non-Unicode.
Nvim doesn't support setting encoding=japan, so skip a test.
Problem: Plugins cannot track text scrolling.
Solution: Add the WinScrolled event. (closesvim/vim#10102)
0937182d49
Skip User event in autocmd.txt, not needed unless #10689 is reverted.
Problem: HEEx and Surface templates do not need a separate filetype.
Solution: Use Eelixir for the similar filetypes. (Aaron Tinio, closesvim/vim#10124)
fa76a24109
Problem: ">" marker sometimes not displayed in the jumplist.
Solution: If the buffer no longer exists show "-invalid-". (Christian
Brabandt, closesvim/vim#10131, closesvim/vim#10100)
a0f659c76e
Add a modeline to test_jumplist.vim
Update runtime files
cbaff5e06e
Docs only.
Omit json_encode (different impl, Nvim throws E474 instead; see v8.2.4695).
Skip <MouseMove> (Nvim *kinda* has <MouseMove>, but most of this doc needs
v8.2.4674 anyway...).
Nvim's 'hidden' doc was reworded somewhat, so manually integrate the changes
(8331cd13c4).
Also apply "comma-separated" changes to all possible places in options.txt.
Cherry-pick *highlight-clear* tag from v8.2.3578.
Problem: Kuka Robot Language files not recognized.
Solution: Recognize *.src and *.dat files. (Patrick Meiser-Knosowski,
closesvim/vim#10096)
3ad2090316
Problem: A pattern that matches the cursor position is bit complicated.
Solution: Use a dot to indicate the cursor line and column. (Christian
Brabandt, closesvim/vim#8497, closesvim/vim#8179)
04db26b360
Also use `n = ++vcol` in regexp_bt.c as `++vcol` alone fails lint.
helpers.source() was a hack to work around the lack of anonymous
:source. Its "create tempfile" behavior is not a required part of most
tests that use it.
Some tests still need the old "create tempfile" behavior either because
they test SID behavior, or because of missing nvim_exec features: #16071
Uses of `getline` in `filetype.lua` currently assume it always returns a
string. However, if the buffer is unloaded when filetype detection runs,
`getline` returns `nil`. Fixing this prevents errors when filetype
detection is run on unloaded buffers.
vim.tbl_get takes a table with subsequent string arguments (variadic) that
index into the table. If the value pointed to by the set of keys exists,
the function returns the value. If the set of keys does not exist, the
function returns nil.
The use of 'softtabstop' to set tabSize was introduced in 5d5b068,
replacing 'tabstop'. If we look past the name tabSize and at the actual
purpose of the field, it's the indentation width used when formatting.
This corresponds to the Vim option 'shiftwidth', not 'softtabstop'.
The latter has the comparatively mundane purpose of controlling what
happens when you hit the tab key (and even this is incomplete, as it
fails to account for 'smarttab').
s:EndTermDebug should only be called when exiting if the debugger started
without error, otherwise the plugin breaks.
Vim handles this by using job_setoptions to set the on_exit callback to
s:EndTermDebug after startup succeeds. However, Nvim does not have such
functionality; instead; use s:starting to mimic this behaviour.
Also, introduce s:running to fix s:CheckGdbRunning; it did not work correctly
due to the "[Process exited X]" message keeping the job's channel alive (though
the stream is closed). This means nvim_get_chan_info cannot be used to check if
the debugger has exited, as it may still return a non-empty dict.
Ref: #9342
Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`.
Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`.
The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
Change missing provider plugins from errors to warnings for python and
perl. Also give proper advice under the ADVICE section instead of just
the errors.
Problem: Cannot jump to the last used tabpage.
Solution: Add g<Tab> and tabpagnr('#'). (Yegappan Lakshmanan, closes vim/vim#6661,
neovim #11626)
62a232506d
Nvim implemented this feature before Vim, but Vim made some useful changes (e.g:
beeping on failure). Port the changes to closer match Vim (also makes porting
future patches easier).
Also note that because CHECK_CMDWIN was added to goto_tabpage_tp, there is no
need to do the extra work with tabpage_index and goto_tabpage inside
goto_tabpage_lastused to fix cmdwin issues any more (#11692).
Note that while goto_tabpage_tp doesn't check for textlock like goto_tabpage
does, it shouldn't matter as it is already checked for earlier.
Add tags for <C-Tab> to tabpage.txt, and refer to <C-Tab> over CTRL-Tab to be
consistent with other docs like the patch.
Remove mention of "previous tabpage" (it can be confused with the tabpage to the
left, e.g: `:tabprevious`).
Similarly, don't rename old_curtab to last_tab in enter_tabpage (it might be
confused with the right-most tabpage, e.g: `:tablast`).
Cherry-pick Test_tabpage change from v8.2.0634.
92b83ccfda
Problem: Quickfix buffer shows up in list, can't get buffer number.
Solution: Make the quickfix buffer unlisted when the quickfix window is
closed. get the quickfix buffer number with getqflist().
(Yegappan Lakshmanan, closesvim/vim#4113)
647e24ba3d
Update runtime files.
a2baa73d1d
Cherry-pick tabpage.txt changes from patch 8.2.1413.
Skip digraph functions: included in #17440.
Skip many error codes as they haven't been ported yet.
Problem: Cannot execute a register containing line continuation.
Solution: Concatenate lines where needed. (Yegappan Lakshmanan,
closesvim/vim#6272)
856c1110c1
According to #2542 the "Future:" part was removed intentionally.
Use size_t in more places to reduce type casts.
* feat(api): `group` can be either string or int
This affects the following API functions:
- `vim.api.nvim_create_autocmd`
- `vim.api.nvim_get_autocmds`
- `vim.api.nvim_do_autocmd`
closes#17552
* refactor: add two maps for fast lookups
* fix: delete augroup info from id->name map
When in "stupid_legacy_mode", the value in name->id map would be updated
to `AUGROUP_DELETED`, but the entry would still remain in id->name. This
would create a problem in `augroup_name` function which would return the
name of the augroup instead of `--DELETED--`.
The id->name map is only used for fast loopup in `augroup_name` function
so there's no point in keeping the entry of deleted augroup in it.
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
This enables retrieving autocommands defined in the given buffers. Under
the hood this simply translates the buffer numbers into '<buffer=%d>'
patterns.
This commit finishes support for colored and styled underlines adding
`CSI 4 : [2,4,5] m` support providing double, dashed, and dotted
underlines
Fixes#17362.
`:verbose` didn't work properly with lua configs (For example:
options or keymaps are set from lua, just say that they were set
from lua, doesn't say where they were set at.
This fixes that issue. Now `:verbose` will provide filename and line no
when option/keymap is set from lua.
Changes:
- compiles lua/vim/keymap.lua as vim/keymap.lua
- When souring a lua file current_sctx.sc_sid is set to SID_LUA
- Moved finding scripts SID out of `do_source()` to `get_current_script_id()`.
So it can be reused for lua files.
- Added new function `nlua_get_sctx` that extracts current lua scripts
name and line no with debug library. And creates a sctx for it.
NOTE: This function ignores C functions and blacklist which
currently contains only vim/_meta.lua so vim.o/opt wrappers aren't
targeted.
- Added function `nlua_set_sctx` that changes provided sctx to current
lua scripts sctx if a lua file is being executed.
- Added tests in tests/functional/lua/verbose_spec.lua
- add primary support for additional types (:autocmd, :function, :syntax) to lua verbose
Note: These can't yet be directly set from lua but once that's possible
:verbose should work for them hopefully :D
- add :verbose support for nvim_exec & nvim_command within lua
Currently auto commands/commands/functions ... can only be defined
by nvim_exec/nvim_command this adds support for them. Means if those
Are defined within lua with vim.cmd/nvim_exec :verbose will show their
location . Though note it'll show the line no on which nvim_exec call was made.
Works similar to ex <f-args>. It only splits the arguments if the
command has more than one posible argument. In cases were the command
can only have 1 argument opts.fargs = { opts.args }
Problem: Dtrace files are recognized as filetype D.
Solution: Add a pattern for Dtrace files. (Teubel György, closesvim/vim#9841)
Add some more testing.
4d56b971cb
Update runtime files
944697ae19
Doc changes:
Include remote_*() (even though +clientserver and remote.txt isn't ported yet)
Omit screenpos() (need v8.2.4389)
Other changes are N/A or cannot be directly applied
nvim_buf_get_text is the mirror of nvim_buf_set_text. It differs from
nvim_buf_get_lines in that it allows retrieving only portions of lines.
While this can typically be done easily enough by API clients,
implementing this function provides symmetry between the get/set
text/lines APIs, and also provides a nice convenience that saves API
clients the work of having to slice the result of nvim_buf_get_lines
themselves.
Closes https://github.com/neovim/neovim/issues/17456
* treesitter uses the default highlight priority of 50
* diagnostic highlights have a priority of 150
* lsp reference highlights have a priority of 200
This ensures proper ordering.
Problem: Cannot decide whether to skip test that fails with 64 bit ints.
(closesvim/vim#9072)
Solution: Add v:sizeofint, v:sizeoflong and v:sizeofpointer. Improve the
check for multiply overflow.
69b3072d98
Omit v:sizeof{int,long,pointer} as they're only really used for tests.
Problem: When reloading not all properties are detected.
Solution: Add the "edit" value to v:fcs_choice. (Rob Pilling, closesvim/vim#9579)
8196e94a8b
Cherry-pick some test changes from patch 8.1.1826.
Problem: Search() cannot skip over matches like searchpair() can.
Solution: Add an optional "skip" argument. (Christian Brabandt, closesvim/vim#861)
adc17a5f9d
Enable skip arg usage in autoload/freebasic.vim
evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and
reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway:
- Port evalarg_T into eval.h and use const char * and Callback fields
- Use EVALARG_INIT to initialize
- Return bool over OK/FAIL from evalarg functions
- Remove check from evalarg_clean as callback_free ignores None callbacks anyway
- Move eva_buf field into evalarg_get as a local (not sure what reason it has
being in the struct)
N/A patches for version.c:
vim-patch:8.2.4355: unnecessary call to check_colorcolumn()
Problem: Unnecessary call to check_colorcolumn().
Solution: Remove the call. (Sean Dewar, closesvim/vim#9748)
0f7ff851cb
LSP server might return an item which would replace a token to another.
For example in typescript for a `jest.Mock` object `getProductsMock.`
text I get the following response:
```
{
commitCharacters = {
".",
",",
"("
},
data = {
entryNames = {
"Symbol"
},
file = "/foo/bar/baz.service.spec.ts",
line = 268,
offset = 17
},
filterText = ".Symbol",
kind = 6,
label = "Symbol",
sortText = "11",
textEdit = {
newText = "[Symbol]",
range = {
end = {
character = 16,
line = 267
},
start = {
character = 15,
line = 267
}
}
}
},
```
In `lsp.omnifunc` to get a `prefix` we call the `adjust_start_col` which
then returns the `textEdit.range.start.character`.
Th `prefix` then be the `.` character. Then when filter the items with
`remove_unmatch_completion_items`, every item will be filtered out,
since no completion word starts `.`.
To fix we return the `end.character`, which in that particular case will
be the position after the `.`.
In Nvim, like DirChanged, this also triggers when switching windows.
This marks Vim patch 8.2.4335 as ported.
vim-patch:8.2.4335: no autocommand event triggered before changing directory
Problem: No autocommand event triggered before changing directory. (Ronnie
Magatti)
Solution: Add DirChangedPre. (closesvim/vim#9721)
28e8f73ae2
Problem: Put in Visual mode cannot be repeated.
Solution: Use "P" to put without yanking the deleted text into the unnamed
register. (Shougo Matsushita, closesvim/vim#9591)
fb55207ed1
Cherry-pick get_y_previous() and set_y_previous() from patch 8.1.1736.
Nvim has removed y_current, so code related to it is N/A.
Problem: No support for end line number and column in 'errorformat'.
Solution: Add %e and %k. (closesvim/vim#9624)
e023d49937
Use "\t" to represent a Tab as it looks better.
Problem: Fuzzy matching doesn't give access to the scores.
Solution: Return the scores with a third list. (Yegappan Lakshmanan,
closesvim/vim#7596)
9d19e4f4ba
Remove seemingly useless NULL checks.
assert that removing the li one wasn't dumb.
Problem: Fuzzy matching does not support multiple words.
Solution: Add support for matching white space separated words. (Yegappan
Lakshmanan, closesvim/vim#7163)
8ded5b647a
Problem: Fuzzy matching only works on strings.
Solution: Support passing a dict. Add matchfuzzypos() to also get the match
positions. (Yegappan Lakshmanan, closesvim/vim#6947)
4f73b8e9cc
Also remove some N/A and seemingly useless NULL checks -- Nvim allocs can't
return NULL. I'm not sure why the retmatchpos stuff in match_fuzzy checks for
NULL too, given that Vim checks for NULL alloc in do_fuzzymatch; assert that the
li stuff is not NULL as that's the one check I'm ever-so-slightly unsure about.
Adjust tests. Note that the text_cb tests actually throw E6000 in Nvim, but we
also can't assert that error due to v8.2.1183 not being ported yet.
Problem: Cannot do fuzzy string matching.
Solution: Add matchfuzzy(). (Yegappan Lakshmanan, closesvim/vim#6932)
635414dd2f
Adjust Test_matchfuzzy's 2nd assert to expect the last error thrown, as
v8.2.1183 hasn't been ported yet (to be honest, the error message is kinda weird
if the 2nd argument is not convertible to string). We can still port this fully
as porting v8.2.1183 would require removing this change to pass CI.
Problem: Fnamemodify() does not apply ":~" when followed by ":.".
Solution: Don't let a failing ":." cause the ":~" to be skipped. (Yasuhiro
Matsumoto, closesvim/vim#5577)
d816cd94d8
Problem: pathshorten() only supports using one character.
Solution: Add an argument to control the length. (closesvim/vim#7006)
6a33ef0deb
Cherry-pick a line in test from patch 8.2.0634.
Use Nvim's config paths in docs.
shorten_dir() returning a pointer looks a bit confusing here, as it is
actually the same pointer passed to it, and it doesn't really reduce
much code, so change it back to void.
Assigning rettv->vval.v_string = NULL is not needed if a pointer is
within 64 bits. While this is usually the case, I'm not sure if it can
be taken for granted.
Problem: Not easy to get mark en cursor posotion by character count.
Solution: Add functions that use character index. (Yegappan Lakshmanan,
closesvim/vim#7648)
6f02b00bb0
Problem: A popup created with "cursorline" will ignore "firstline".
Solution: When both "cursorline" and "firstline" are present put the cursor
on "firstline". (closesvim/vim#7000) Add the "winid" argument to
getcurpos().
99ca9c4868
Skip popup window related code.
Cherry-pick all of Test_getcurpos_setpos() from patch 8.2.0610.
Problem: :for cannot loop over a string.
Solution: Accept a string argument and iterate over its characters.
74e54fcb44
v8.2.2659 is already ported.
N/A patches for version.c:
vim-patch:8.2.2736: Vim9: for loop over string is a bit slow
Problem: Vim9: for loop over string is a bit slow.
Solution: Avoid using strlen().
175a41c13f
Problem: Crash when using garbagecollect() in between rand().
Solution: Redesign the rand() and srand() implementation. (Yasuhiro
Matsumoto, closesvim/vim#5587, closesvim/vim#5588)
4f645c54ef
Omit test_srand_seed.
Unmacroify SHUFFLE_XOSHIRO128STARSTAR and SPLITMIX32 while we're at it (leave
ROTL alone as it's fairly innocent).
Problem: Random number generator in Vim script is slow.
Solution: Add rand() and srand(). (Yasuhiro Matsumoto, closesvim/vim#1277)
06b0b4bc27
Add missing method call usage to builtin.txt.
vim_time and test_settime is N/A.
Add a modeline to test_random.vim.
Use typval_T* over listitem_T* vars so we don't need to use TV_LIST_ITEM_TV all
over the place...
Remove NULL list checks (tv_list_len covers this).
Problem: Not easy to recognize the system Vim runs on.
Solution: Add more items to the features list. (Ozaki Kiichi, closesvim/vim#3855)
39536dd557
Some doc changes have already been applied. Some others are N/A.
"moon" was removed in patch 8.2.0427 so I did not add it.
Problem: Basic and form filetype detection is incomplete.
Solution: Add a separate function for .frm files. (Doug Kearns, closesvim/vim#9675)
c570e9cf68
Problem: No reduce() function.
Solution: Add a reduce() function. (closesvim/vim#5481)
85629985b7
Needs CHECK_LIST_MATERIALIZE from v8.2.0751 (and range_list_materialize from
8.2.0149).
Move e_reduceempty to funcs.c, as it's only used there. Make it static.
Use tv_blob_len, tv_list_len == 0 for empty checks.
Replace vim_memset(&funcexe, 0, ...) with FUNCEXE_INIT.
Leave li initially undefined (tv_list_first returns NULL if list is NULL).
This patch has a memory leak fixed by v8.2.0882.