Commit Graph

4458 Commits

Author SHA1 Message Date
zeertzjq
d531ef6813 vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice
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.
2022-04-29 15:51:04 +08:00
zeertzjq
abe91e1efe vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
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.
2022-04-29 15:51:04 +08:00
zeertzjq
212349c100 feat(edit): insert an unsimplified key using CTRL-SHIFT-V
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.
            (closes vim/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. (closes vim/vim#7413)
0684e36a7e

Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which
may introduce a potential breakage.
2022-04-29 15:51:03 +08:00
Christian Clason
521e91e1c4
vim-patch:ce001a337e28 (#18287)
Update runtime files
ce001a337e

also add `vimStdPlugin` keywords missing from previous updates
2022-04-27 17:48:35 +02:00
erw7
5f3018fa1a
refactor(terminal)!: drop winpty, require Windows 10 #18253
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
2022-04-26 21:17:06 -07:00
Philip Linell
d98e5357af
feat(checkhealth): check for slow shell #17829
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>
2022-04-26 20:55:57 -07:00
ii14
55135cea61
fix(lsp): fix unnecessary buffers being added on empty diagnostics (#18275)
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.
2022-04-26 10:00:28 -07:00
Gregory Anders
5d159a7faa
feat(tui): query terminal for CSI u support (#18181)
On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
2022-04-25 20:49:45 -06:00
zeertzjq
e6974114fb vim-patch:8.2.4760: using matchfuzzy() on a long list can take a while
Problem:    Using matchfuzzy() on a long list can take a while.
Solution:   Add a limit to the number of matches. (Yasuhiro Matsumoto,
            closes vim/vim#10189)
9029a6e993
2022-04-26 08:06:32 +08:00
Christian Clason
af82eab946
vim-patch:8.2.4826: .cshtml files are not recognized (#18259)
Problem:    .cshtml files are not recognized.
Solution:   Use html filetype for .cshtml files. (Julien Voisin, closes vim/vim#10212)
1f435dafff
2022-04-25 20:02:36 +02:00
Gregory Anders
2dddc86a42
fix: show autocmd output when F is in shortmess (#18251)
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.
2022-04-25 08:44:18 -06:00
dundargoc
440b65c338
revert: "man.vim: Ensure 'modifiable' in man#init_pager" #17791
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 #11450
closes #17595

Co-authored-by: Javier López <graulopezjavier@gmail.com>
2022-04-25 01:57:14 -07:00
Joel Bradshaw
b7717ed450
docs: clarify enhanced modifiers, SHIFT usage #18124
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-04-24 18:46:56 -07:00
dundargoc
92f7286377
docs: make docstring consistent with parameters #18178
Closes: https://github.com/neovim/neovim/issues/12691
2022-04-23 17:01:01 -07:00
Christian Clason
5c53e29ca9
fix(ftdetect): source plugins in autogroup (#18237)
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).
2022-04-23 17:57:38 +02:00
Andrey Mishchenko
4e4914ab2e
fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)
`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.
2022-04-23 08:01:08 +08:00
Chinmay Dalal
116a3f4683
fix(treesitter): create new parser if language is not the same as cached parser (#18149) 2022-04-22 16:15:28 +02:00
bfredl
f4f593b333
Merge pull request #18211 from clason/update-inspect
chore: update inspect.lua to 3.1.3
2022-04-22 10:53:00 +02:00
Christian Clason
6c8a3013ac
docs(lua): explain and link to lua patterns (#18206)
also correct explanation of when it's allowed to omit parens in Lua function calls
2022-04-21 21:46:07 +02:00
Christian Clason
64784dccb5 chore: update inspect.lua to 3.1.3 2022-04-21 16:23:10 +02:00
atusy
5ecbbba6ee docs: vim.keymap.set can specify buffer as an option 2022-04-21 10:45:39 +09:00
Christian Clason
bfd6eb4404
Merge pull request #18185 from clason/vim-8.2.4781
vim-patch:8.2.{4781,4793}: maxima files are not recognized
2022-04-20 21:45:22 +02:00
Christian Clason
85b13f6db4
docs(filetype): proper example for did_load_filetypes (#18191) 2022-04-20 21:41:35 +02:00
Mathias Fußenegger
a48a0a4f7b
docs(api): add example showing necessity to wrap callback function (#18179)
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>
2022-04-20 18:42:07 +02:00
runiq
7e7fdca163
fix(lsp): unify progress message handling (#18040)
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).
2022-04-20 18:40:52 +02:00
Gregory Anders
6b0d3ae6a8
fix(diagnostic): use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
Use nvim_exec_autocmds to issue the DiagnosticChanged autocommand,
rather than nvim_buf_call, which has some side effects when drawing
statuslines.
2022-04-20 08:16:47 -06:00
bfredl
81f1e33d15
Merge pull request #18145 from bfredl/term_opt
feat(api): allow remote UI to set terminal options
2022-04-20 14:50:04 +02:00
Christian Clason
63eb7e865b vim-patch:8.2.4793: recognizing Maxima filetype even though it might be another
Problem:    Recognizing Maxima filetype even though it might be another.
Solution:   Remove *.mc and *.dem patterns from Maxima files
928a131356
2022-04-20 09:52:31 +02:00
Christian Clason
d40b2afda8 vim-patch:8.2.4781: Maxima files are not recognized
Problem:    Maxima files are not recognized.
Solution:   Add patterns to detect Maxima files. (Doron Behar, closes vim/vim#10211)
d0a20c9d11
2022-04-20 09:50:19 +02:00
Christian Clason
a391cd517b
vim-patch:8.2.4790: lilypond filetype not recognized (#18174)
Problem:    Lilypond filetype not recognized.
Solution:   Add patterns for lilypond. (Doug Kearns)
c448e9c950
2022-04-20 08:35:22 +02:00
bfredl
245858460f
Merge pull request #18157 from famiu/feat/undo!
feat: add `undo!`
2022-04-19 20:55:49 +02:00
Famiu Haque
1e3d9c7dbc feat: add undo!
Allows using `undo!` to undo changes and remove them from the undo-tree. Can only be used for moving backwards in the same undo branch.
2022-04-20 00:10:02 +06:00
bfredl
dbc4af7186
Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
2022-04-19 18:56:51 +02:00
Christian Clason
0124a7bfa9
vim-patch:75ab590f8504 (#18170)
Update runtime files
75ab590f85

omit builtin.txt change to `expand()` (depends on 8.2.4726)
2022-04-19 15:14:17 +02:00
dundargoc
e73ef5c092
docs(terminal): correct sentence on how to enter terminal mode (#18146)
`o`/`O` is not supported for terminal mode
2022-04-18 11:49:06 +02:00
Christian Clason
1facad2347
vim-patch:8.2.4778: pacman files use dosini filetype (#18152)
Problem:    Pacman files use dosini filetype.
Solution:   Use conf instead. (Chaoren Lin, closes vim/vim#10213)
35cff32dd8
2022-04-17 23:30:13 +02:00
Famiu Haque
b16afe4d55 feat(highlight): implement CurSearch highlight
Adds a `CurSearch` highlight group to highlight the current search result under the cursor.
2022-04-17 19:24:59 +06:00
hlpr98
d63ad42e49 feat(api): ui options relevant for remote TUI 2022-04-17 11:41:56 +02:00
Christian Clason
6e6f5a7833
vim-patch:8.2.4767: openscad files are not recognized (#18138)
Problem:    Openscad files are not recognized.
Solution:   Add a filetype pattern. (Niklas Adam, closes vim/vim#10199)
c360b2566c
2022-04-17 10:15:55 +02:00
Christian Clason
670ecfc0cd
vim-patch:8.2.4766: KRL files using "deffct" not recognized (#18137)
Problem:    KRL files using "deffct" not recognized.
Solution:   Adjust the pattern used for matching. (Patrick Meiser-Knosowski,
            closes vim/vim#10200)
93c7a45e86
2022-04-17 10:15:41 +02:00
Eden Zhang
813ecdac79
fix(paste): ignore mappings in Cmdline mode (#18114) 2022-04-17 08:11:53 +08:00
bfredl
333ba6569d NVIM 0.7
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
2022-04-15 13:38:44 +02:00
dundargoc
e63e5d1dbd
docs: typo fixes (#17859)
Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com>
Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com>
Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: rwxd <rwxd@pm.me>
Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
2022-04-15 12:35:06 +02:00
Fredrik Ekre
6160973f36
fix(lsp): fix lookup of boolean values in workspace/configuration (#18026) 2022-04-15 11:12:41 +02:00
Christian Clason
8486c87e58
vim-patch:8.2.4747: no filetype override for .sys files (#18105)
Problem:    No filetype override for .sys files.
Solution:   Add g:filetype_sys. (Patrick Meiser-Knosowski, closes vim/vim#10181)
f420ff2440
2022-04-13 23:11:56 +02:00
Gregory Anders
9a35704333
Merge pull request #15491 from Diomendius/lua_docs
docs(lua): fix, clarify Lua require() docs
2022-04-13 10:50:03 -06:00
Christian Clason
9938740ca6
vim-patch:8.2.4746: supercollider filetype not recognized (#18102)
Problem:    Supercollider filetype not recognized.
Solution:   Match file extentions and check file contents to detect
            supercollider. (closes vim/vim#10142)
8cac20ed42
2022-04-13 17:04:38 +02:00
Christian Clason
7d1142b7e7
fix(runtime): add syntax file for query (#18101)
followup to #17905: also use Lisp syntax for treesitter queries
2022-04-13 16:29:23 +02:00
zeertzjq
b69ecacbb4 vim-patch:partial:a2baa73d1d33
Update runtime files.
a2baa73d1d

This only includes changes to docs of digraph functions.
2022-04-12 21:26:46 +08:00
zeertzjq
3b0bcb8ad0 vim-patch:8.2.3226: new digraph functions use old naming scheme
Problem:    New digraph functions use old naming scheme.
Solution:   Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580)
29b857150c
2022-04-12 21:26:46 +08:00
zeertzjq
cbc54cf484 vim-patch:8.2.3184: cannot add a digraph with a leading space
Problem:    Cannot add a digraph with a leading space.  It is not easy to list
            existing digraphs.
Solution:   Add setdigraph(), setdigraphlist(), getdigraph() and
            getdigraphlist(). (closes vim/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.
2022-04-12 21:26:30 +08:00
zeertzjq
53668a5815 vim-patch:8.2.4713: plugins cannot track text scrolling
Problem:    Plugins cannot track text scrolling.
Solution:   Add the WinScrolled event. (closes vim/vim#10102)
0937182d49

Skip User event in autocmd.txt, not needed unless #10689 is reverted.
2022-04-12 05:02:05 +08:00
Tony Fettes
392cb7ac0c
fix(lsp): pass offset_encoding in formatexpr() (#18084) 2022-04-11 12:44:31 -07:00
zeertzjq
da31e953b6
docs(term.txt): add documentation about TUI input (#18072) 2022-04-11 23:22:04 +08:00
zeertzjq
2dc86ef3b2 vim-patch:8.2.4733: HEEx and Surface do need a separate filetype
Problem:    HEEx and Surface do need a separate filetype.
Solution:   Revert 8.2.4729. (closes vim/vim#10147)
4232dff815
2022-04-11 18:40:46 +08:00
Gregory Anders
379067d038 docs: update dev-api to include "create" 2022-04-10 20:45:17 -06:00
Gregory Anders
f94f75dc05 refactor!: rename nvim_add_user_command to nvim_create_user_command 2022-04-10 20:18:41 -06:00
Loong Wang
b2cb05b53e
feat(events): support SIGWINCH for Signal event #18029
closes #15411
2022-04-10 15:56:08 -07:00
UnkwUsr
8f3845cdb7
docs: remove mentions of removed flag '#' in 'cpoptions' (#18064) 2022-04-10 14:58:01 +02:00
Christian Clason
b438bb4343
vim-patch:8.2.4729: HEEx and Surface templates do not need a separate filetype (#18065)
Problem:    HEEx and Surface templates do not need a separate filetype.
Solution:   Use Eelixir for the similar filetypes. (Aaron Tinio, closes vim/vim#10124)
fa76a24109
2022-04-10 13:53:33 +02:00
zeertzjq
ff726cc569
vim-patch:8.2.4719: ">" marker sometimes not displayed in the jumplist (#18056)
Problem:    ">" marker sometimes not displayed in the jumplist.
Solution:   If the buffer no longer exists show "-invalid-". (Christian
            Brabandt, closes vim/vim#10131, closes vim/vim#10100)
a0f659c76e

Add a modeline to test_jumplist.vim
2022-04-10 07:13:22 +08:00
Christian Clason
61bd5426f4
vim-patch:8.2.4721: cooklang files are not recognized (#18058)
Problem:    Cooklang files are not recognized.
Solution:   recognize *.cook files. (Goc Dundar, closes vim/vim#10120)
36951ed1da
2022-04-09 17:43:33 +02:00
Christian Clason
3280dc2b60
vim-patch:8.2.4720: ABB Rapid files are not recognized properly (#18057)
Problem:    ABB Rapid files are not recognized properly.
Solution:   Add checks for ABB Rapid files. (Patrick Meiser-Knosowski,
            closes #10104)
b09c320039
2022-04-09 17:42:46 +02:00
zeertzjq
f3183a4d7c
Merge pull request #18023 from tom-anders/vim-8.2.4702
vim-patch:8.2.{4702,4703}: C++ scope labels are hard-coded
2022-04-09 22:13:34 +08:00
Tom Praschan
45f62464d3 vim-patch:8.2.4702: C++ scope labels are hard-coded
Problem:    C++ scope labels are hard-coded.
Solution:   Add 'cinscopedecls' to define the labels. (Tom Praschan,
            closes vim/vim#10109)
3506cf34c1
2022-04-09 15:39:46 +02:00
Christian Clason
8055f9857b
vim-patch:8.2.4715: Vagrantfile not recognized (#18052)
Problem:    Vagrantfile not recognized.
Solution:   Recognize Vagrantfile as ruby. (Julien Voisin, closes vim/vim#10119)
5e1792270a
2022-04-09 11:19:18 +02:00
Sean Dewar
012c055804
vim-patch:partial:cbaff5e06ec5 (#18044)
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.
2022-04-08 22:40:56 +02:00
Christian Clason
d3068d34cc
vim-patch:partial:cbaff5e06ec5 (#18042)
Update runtime files
cbaff5e06e

omit doc updates here
2022-04-08 19:53:41 +02:00
bfredl
c26d70d581
Merge pull request #17786 from gpanders/autocmd-args
feat(api)!: pass args table to autocommand callbacks
2022-04-08 16:55:47 +02:00
Gregory Anders
30bc02c636 feat(api)!: pass args table to autocommand callbacks 2022-04-08 15:12:54 +02:00
Christian Clason
8c25dbff46
vim-patch:8.2.4708: PHP test files are not recognized (#18025)
Problem:    PHP test files are not recognized.
Solution:   Add the *.phpt pattern. (Julien Voisin, closes vim/vim#10112)
177847e67a
2022-04-07 20:24:55 +02:00
Christian Clason
f85f4e25d2
vim-patch:8.2.4701: Kuka Robot Language files not recognized (#18012)
Problem:    Kuka Robot Language files not recognized.
Solution:   Recognize *.src and *.dat files. (Patrick Meiser-Knosowski,
            closes vim/vim#10096)
3ad2090316
2022-04-07 09:09:08 +02:00
Christian Clason
2a46600140
docs(options): add more missing 'nofoo' tags (#17967) 2022-04-02 15:24:10 +02:00
Christian Clason
e6bd9eee15
docs(options): add missing 'nofoo' tags (#17965) 2022-04-02 14:08:04 +02:00
Christian Clason
e45d141e28
vim-patch:8.2.4664: Elvish files are not recognized (#17963)
Problem:    Elvish files are not recognized.
Solution:   Recognize .elv files. (Bruno Roque, closes vim/vim#10058)
c1658a196b
2022-04-02 13:36:19 +02:00
Lewis Russell
3cc29b7f0d fix(keymap): don't coerce false to '' 2022-04-01 09:09:30 +01:00
bfredl
dc48330b9d
Merge pull request #17842 from lewis6991/keymap
feat(keymap): return nil from an expr keymap
2022-04-01 00:48:46 +02:00
bfredl
80d4d6b486
Merge pull request #17938 from ggandor/autocmd-api-names
refactor(api)!: use singular/plural consistently in the autocmd API
2022-04-01 00:35:21 +02:00
György Andorka
9d40b2fda9 refactor(api)!: use singular/plural consistently in the autocmd API 2022-03-31 23:58:47 +02:00
Christian Clason
38ba2a75fc
vim-patch:8.2.4658: org-mode files are not recognized (#17939)
Problem:    Org-mode files are not recognized.
Solution:   Add patterns to recognize "org" files. (closes vim/vim#10046)
3a6f952cc8
2022-03-31 22:16:25 +02:00
dundargoc
ebab51b192
docs(extmark): fix nvim_buf_get_extmarks example (#17934) 2022-03-31 18:05:17 +02:00
Christian Clason
2e85af47d2
feat(runtime): add query filetype (#17905)
used for Tree-sitter queries
uses Lisp runtime files

(in Lua to distinguish from upstream runtime files)
2022-03-31 08:46:45 -06:00
TJ DeVries
b80651eda9 feat(api): nvim_clear_autocmd
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-03-31 14:30:42 +02:00
Gregory Anders
6d648f5594
feat(treesitter): add more default groups to highlight map (#17835)
This covers some default groups listed in :h group-name.
2022-03-30 22:14:20 +02:00
Andrea Cappuccio
a18c9ba2da
docs(lsp): remove outdated offset_encoding default value for apply_text_edits 2022-03-30 21:04:17 +02:00
dundargoc
ac1dd046c0
vim-patch:46eea444d (#17920)
Update runtime files
46eea444d9

Skip repeat.txt as it only has vim9-specific changes.
2022-03-30 12:12:12 +01:00
zeertzjq
b2819eec26 docs(pattern.txt): cherry-pick latests changes from Vim runtime updates
Update runtime files
53f7fccc94

Update runtime files
2286304cdb

Update runtime files
2f0936cb9a

Update runtime files.
a2baa73d1d
2022-03-30 08:35:13 +08:00
zeertzjq
1bbe8ec282 vim-patch:8.2.3110: a pattern that matches the cursor position is complicated
Problem:    A pattern that matches the cursor position is bit complicated.
Solution:   Use a dot to indicate the cursor line and column. (Christian
            Brabandt, closes vim/vim#8497, closes vim/vim#8179)
04db26b360

Also use `n = ++vcol` in regexp_bt.c as `++vcol` alone fails lint.
2022-03-30 08:35:13 +08:00
zeertzjq
d89a80fafc
docs: update hl-Whitespace documentation (#17901) 2022-03-29 07:38:29 +02:00
Jaehwang Jung
4d3acd6beb
fix(lsp): use "text" filetype for plaintext (#17898) 2022-03-28 09:16:11 -07:00
Justin M. Keyes
72652cbc46
feat(test): use nvim_exec in helpers.source() #16064
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
2022-03-27 10:25:55 -07:00
Smitesh Patil
a8e2c45b94
fix(diagnostic): make open_float respect global diagnostic options (#17879)
* make `open_float` respect `scope` option set in `vim.diagnostic.config`
* Closes #17878
2022-03-27 08:10:03 -06:00
zeertzjq
a86d3d3780
docs: correct CursorMoved documentation (#17880)
behavior was changed in https://github.com/neovim/neovim/pull/9807
2022-03-27 11:02:44 +02:00
Javier Lopez
a490db5ba8
refactor!: rename nvim_do_autocmd to nvim_exec_autocmd (#17854)
according to established code standards (`:h dev-api`)
2022-03-26 15:34:56 +01:00
かわえもん
85821d8b6f
docs(api): fix wrong documentation of nvim_create_autocmd (#17870)
also add doc changes from typofix PR
2022-03-26 13:21:32 +01:00
dundargoc
61205c1def
chore: fix typos (#17755)
Co-authored-by: Jordan Haine <jhaine@securitycompass.com>
2022-03-25 19:57:59 +01:00
Javier Lopez
174deafcef
docs(api): improve autocommand docs (#17545)
[skip ci]
2022-03-25 19:24:53 +01:00
Jared Weakly
5e64d65df6
fix(filetype.lua): always return a string in getline helper function (#17852)
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.
2022-03-25 12:12:00 -06:00
Michael Lingelbach
69f1de86dc
feat: add vim.tbl_get (#17831)
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.
2022-03-24 12:01:04 -07:00
Gregory Anders
02fd00c042
feat(runtime): include Lua in C++ ftplugin (#17843) 2022-03-24 08:05:13 -06:00
Lewis Russell
58140a9428 feat(keymap): return nil from an expr keymap
For Lua callback expr keymaps, returning `nil` or `false` is equivalent
to an empty string
2022-03-24 13:59:20 +00:00
zeertzjq
f5a3edb0c0
refactor: remove cpo-& behavior (#17745)
cpo-& has been removed, but its behavior was accidentally made the
default behavior. That should be removed instead.
2022-03-23 19:52:50 +08:00
marvim
809dd65396 docs: regenerate [skip ci] 2022-03-20 18:00:30 +00:00
bfredl
e7391191e2
Merge pull request #17776 from bfredl/tsconceal
feat(ui): allow conceal to be defined in decorations
2022-03-20 18:59:20 +01:00
Tim Pope
af427dedf6
fix(lsp): set tabSize from 'shiftwidth', not 'softtabstop' (#17787)
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').
2022-03-20 10:41:46 -07:00
bfredl
6eca9b69c4 feat(ui): allow conceal to be defined in decorations
Unlike syntax conceal, change highlight of concealed char

Can be used in tree-sitter using "conceal" metadata.
2022-03-20 18:02:41 +01:00
Sean Dewar
315858bf67
fix(termdebug): handle exiting during startup properly (#16790)
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.
2022-03-20 10:10:01 +00:00
Christian Clason
75157d2572
vim-patch:47c532e2bc55 (#17780)
Update runtime files
47c532e2bc
2022-03-20 10:48:10 +01:00
Xiretza
f2e5f509d9
docs: reword description for nvim_buf_line_count() (#17766)
This adds a few more keywords to make the function easier to find.
2022-03-18 19:58:00 +01:00
bfredl
3c7e937a89
Merge pull request #17266 from famiu/feat/ui/global-statusline
feat(statusline): add global statusline
2022-03-17 20:16:39 +01:00
Famiu Haque
5ab1229174 feat: add support for global statusline
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.
2022-03-18 00:21:41 +06:00
dundargoc
d238b8f600
chore: fix typos (#17670)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-17 13:21:24 +08:00
James McCoy
746a29c580
Merge pull request #17707 from tesaguri/refactor-gen_vimdoc 2022-03-16 16:13:59 -04:00
Sean Dewar
fa79a016bc
chore(checkhealth/provider): style fixes (#17738) 2022-03-16 09:46:14 +00:00
dundargoc
33ada232c7
fix(checkhealth): make provider checkhealth output more consistent (#17722)
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.
2022-03-16 09:36:26 +01:00
Jade Lovelace
5a8bf31d32
vim-patch:8.2.4571: not all gdb files are recognized (#17727)
Problem:    Not all gdb files are recognized.
Solution:   Add a few more patterns for gdb.
            (closes https://github.com/vim/vim/pull/9956)
8d5e514d77
2022-03-15 22:46:32 +01:00
zeertzjq
e263afc0e9 fix(paste): escape control characters in Cmdline mode 2022-03-15 18:15:18 +08:00
zeertzjq
a6eafc77ce fix(paste): deal with trailing new line in chunk 2022-03-15 18:15:18 +08:00
zeertzjq
fcc6f66cf2 fix(paste): avoid edges cases caused by empty chunk 2022-03-15 18:15:18 +08:00
zeertzjq
21ba2d81a8 refactor(paste): do not print dots in cmdline mode 2022-03-15 18:15:18 +08:00
zeertzjq
bfb7754442 fix(paste): deal with eol and eof in Visual mode 2022-03-15 18:15:18 +08:00
zeertzjq
2601e0873f fix(paste): don't move cursor past the end of pasted text in Normal mode 2022-03-15 18:15:18 +08:00
zeertzjq
9b1e1fbc9f fix(paste): use getcmdtype() to determine whether in cmdline mode 2022-03-15 18:15:18 +08:00
Sean Dewar
c5f190e0c2
vim-patch:8.2.1401: cannot jump to the last used tabpage
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
2022-03-14 13:10:57 +00:00
Daiki Mizukami
ecc36c3d1c
docs: remove extra whitespaces 2022-03-14 08:16:01 +09:00
Daiki Mizukami
be2def4100
chore(gen_vimdoc): fall back to brief_desc_node when desc_node is empty 2022-03-14 07:53:42 +09:00
Gregory Anders
f9f843e02e
refactor: use Lua autocommands in filetype.lua (#17711) 2022-03-13 15:52:41 -06:00
adrian5
9e6bc228ec
docs(api): improve section on nvim_set_hl (#17692) 2022-03-13 06:42:12 -06:00
Jan Edmund Lazo
163ec00f44 vim-patch:8.1.1015: quickfix buffer shows up in list, can't get buffer number
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, closes vim/vim#4113)
647e24ba3d
2022-03-13 13:17:28 +08:00
dundargoc
d33aebb821
feat(runtime): import cleanadd.vim from Vim (#17699)
Latest version from Vim v7.2a.
Closes https://github.com/neovim/neovim/issues/12875
2022-03-13 04:52:45 +00:00
Gregory Anders
f291a0339c
fix: use normal! <C-L> in default <C-L> mapping (#17695) 2022-03-12 17:56:53 -07:00
zeertzjq
d4982e152c
vim-patch:partial:a2baa73d1d33 (#17675)
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.
2022-03-12 06:52:54 +08:00
dundargoc
84af45f59f
docs: remove "not in vi" notes (#17678)
[skip ci]
2022-03-11 22:25:59 +00:00
Charlie Groves
1dbf8675c7 fix(remote): respect silent in error reporting 2022-03-11 11:16:46 -05:00
Charlie Groves
29c3632285 fix(remote): report on missing wait commands, typecheck lua results
Clean up lint errors, too
2022-03-11 11:16:46 -05:00
Charlie Groves
e095a868cb docs(remote): update remote.txt for current nvim implementation 2022-03-11 11:16:46 -05:00
Charlie Groves
fcdb1f372b docs(remote): restore remote.txt from removal in f2205b83c5 2022-03-11 11:16:46 -05:00
Charlie Groves
039e94f491 test(remote): add tests for --remote
This also fixes a fair number of issues found in running the tests
2022-03-11 11:16:46 -05:00
Charlie Groves
5862176764 feat(remote): add basic --remote support
This is starting from @geekodour's work at
https://github.com/neovim/neovim/pull/8326
2022-03-11 11:16:46 -05:00
bfredl
6170574d2f
Merge pull request #17660 from bfredl/luacomplete
feat(lua): handle lazy submodules in `:lua vim.` wildmenu completion
2022-03-10 15:46:18 +01:00
dundargoc
a7b1c8893c
chore: fix typos (#17331)
Co-authored-by: Hongyi Lyu <hongyi.lyu95@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-10 14:34:55 +08:00
bfredl
5ed60804fe feat(lua): handle lazy submodules in :lua vim. wildmenu completion 2022-03-09 15:25:06 +01:00
Sean Dewar
b743e415fe
vim-patch:partial 1588bc8ebee2 (#17657)
Update runtime files
1588bc8ebe

docs only

skip :argdedupe changes (need v8.2.3888)
skip sound_playfile changes (need +sound)
skip fuzzy-matching changes in *command-attributes* (need #17536)
2022-03-09 08:44:28 +01:00
Christian Clason
a681b5eaca
vim-patch:partial 1588bc8ebee2 (#17656)
Update runtime files
1588bc8ebe

omit: doc updates
2022-03-09 08:40:16 +01:00
zeertzjq
165cf1b48e vim-patch:8.2.0997: cannot execute a register containing line continuation
Problem:    Cannot execute a register containing line continuation.
Solution:   Concatenate lines where needed. (Yegappan Lakshmanan,
            closes vim/vim#6272)
856c1110c1

According to #2542 the "Future:" part was removed intentionally.
Use size_t in more places to reduce type casts.
2022-03-09 06:25:31 +08:00
Dhruv Manilawala
2783f4cc4a
feat(api): autocmd group can be either name or id (#17559)
* 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>
2022-03-07 23:15:43 -05:00
bfredl
f39a12d629 refactor(lua): make vim submodule lazy loading declarative
This will allow us to also use the same logic for lua threads and
processes, later.
2022-03-07 09:59:22 +01:00
Gregory Anders
92349b1db0
feat(api): add 'buffer' argument to nvim_get_autocmds (#17594)
This enables retrieving autocommands defined in the given buffers. Under
the hood this simply translates the buffer numbers into '<buffer=%d>'
patterns.
2022-03-06 12:35:14 -07:00
Michael Lingelbach
3800615da9
fix(lsp): handle insertion of previous line (#17618) 2022-03-06 07:52:11 -08:00
zeertzjq
80e6f81862 docs(lua): reference runtime/lua/vim/_editor.lua 2022-03-06 22:32:22 +08:00
James McCoy
c365de1d22
Merge pull request #17589 from kchibisov/add-dashed-dotted-underline
Add support for double, dashed, and dotted underlines
2022-03-05 15:00:07 -05:00
bfredl
2de4d3c7ac
Merge pull request #17603 from bfredl/luaworld
refactor(lua): move only runtime lua file in src/ to runtime/lua
2022-03-05 19:21:34 +01:00
Michael Lingelbach
a5e475fcc2
fix(lsp): start incremental sync range at previous newline character (#17610)
This change forces the start of an incremental sync range to begin always on an existing line.
2022-03-05 09:17:56 -08:00
bfredl
186a559818 refactor(lua): move only runtime lua file in src/ to runtime/lua
reorganize so that initialization is done in lua
2022-03-04 19:07:42 +01:00
Kirill Chibisov
6795c9772b
fix(syntax): remove trailing spaces in vim.vim 2022-03-04 15:35:44 +03:00
Kirill Chibisov
4472820182
fix(docs): spelling in new underlines docs 2022-03-04 00:35:51 +03:00
Kirill Chibisov
f89fb41a7a
feat(tui): add support for CSI 4 : [2,4,5] m
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.
2022-03-03 23:35:36 +03:00
bfredl
e23af71d35
Merge pull request #17567 from bfredl/preload
refactor(lua): regularize builtin modules, phase 1
2022-03-03 21:00:00 +01:00
bfredl
f9faba88fd refactor(lua): reorganize builtin modules, phase 1 2022-03-03 20:03:30 +01:00
zeertzjq
e8107f0748 vim-patch:8.2.4498: using <Plug> with "noremap" does not work
Problem:    Using <Plug> with "noremap" does not work.
Solution:   Always remap <Plug>. (closes vim/vim#9879, closes vim/vim#9789)
1fc34225ac
2022-03-03 22:41:09 +08:00
David Shen
5d6006f9bf
feat(diagnostic): add "code" to the diagnostic structure (#17510) 2022-03-02 18:42:27 -07:00
Tim Pope
d477788cd5
fix(lsp): respect all of 'fixeol', 'eol', and 'binary' applying edits (#17574) 2022-03-02 11:33:02 -08:00
zeertzjq
4b3f920477
Merge pull request #16804 from zeertzjq/ui-aucmd-docs
docs: clarify UIEnter and UILeave docs
2022-03-02 15:05:19 +08:00
bfredl
0a9b00913f
Merge pull request #15079 from shadmansaleh/feat/verbose_lua
feat(lua): add :verbose support for lua config
2022-03-01 13:13:11 +01:00
zeertzjq
0cb9a577ed docs: clarify actual behavior of <Plug> 2022-03-01 09:28:27 +08:00
TJ DeVries
0f613482b3 feat(lua): add missing changes to autocmds lost in the rebase
Note: some of these changes are breaking, like change of API signatures
2022-02-28 19:53:50 +01:00
shadmansaleh
ebfe083337 feat(lua): show proper verbose output for lua configuration
`: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.
2022-02-28 19:18:49 +06:00
Javier Lopez
1b5767aa34
feat(lua): add <f-args> to user commands callback (#17522)
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 }
2022-02-27 12:35:06 -07:00
bfredl
c65d93e60a
Merge pull request #16969 from shadmansaleh/enhance/ingore_nore_on_plug_keymaps
feat: ignore nore on <Plug> maps
2022-02-27 16:47:55 +01:00
Christian Clason
9d3370a144
vim-patch:c51cf0329809 (#17530)
Update runtime files.
c51cf03298
2022-02-27 11:56:30 +01:00
shadmansaleh
c031e038df chore: remove <Plug> detection from vim.keymap 2022-02-27 08:21:21 +06:00
shadmansaleh
0347875a5c feat: ignore nore on <Plug> maps 2022-02-27 08:21:21 +06:00
bfredl
850b3e19c9 refactor(lua): cleanup and docs for threads 2022-02-26 15:00:13 +01:00
erw7
b87867e69e feat(lua): add proper support of luv threads 2022-02-26 14:01:38 +01:00
Christian Clason
d0f8f76224
vim-patch:8.2.4464: Dtrace files are recognized as filetype D (#17518)
Problem:    Dtrace files are recognized as filetype D.
Solution:   Add a pattern for Dtrace files. (Teubel György, closes vim/vim#9841)
            Add some more testing.
4d56b971cb
2022-02-26 14:01:37 +01:00
zeertzjq
cfcc40cd48
Merge pull request #17479 from dundargoc/docs/usr04/update-Y-description
docs: update explanation of Y to reflect new defaults
2022-02-26 20:51:47 +08:00
Gregory Anders
fdea15723f
feat(filetype): support scripts.vim with filetype.lua (#17517)
When filetype.vim is disabled, create the autocommand that runs
scripts.vim in filetype.lua.
2022-02-24 10:02:17 -07:00
Dundar Göc
1630ec742d docs: update explanation of Y to reflect new defaults
Closes https://github.com/neovim/neovim/issues/17435
2022-02-24 18:13:44 +08:00
Sean Dewar
c07b5b5de6
vim-patch:partial 944697ae196 (#17493)
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
2022-02-23 12:22:18 +00:00
Gregory Anders
11f7aeed7a
feat(api): implement nvim_buf_get_text (#15181)
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.
2022-02-22 20:19:21 +00:00
Christian Clason
30c9c8815b
vim-patch:partial 944697ae1968 (#17490)
Update runtime files
944697ae19

skip: docs
skip: translations
2022-02-21 23:01:22 +01:00
Christian Clason
10a46a20ce
refactor(highlight)!: optional arguments for highlight.range as table (#17462)
also update documentation

BREAKING CHANGE: signature of highlight.range is now
     vim.highlight.range(bufnr, ns, hlgroup, start, finish,
         { regtype = regtype, inclusive = inclusive, priority = priority })

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-02-21 21:21:42 +01:00
Aetf
aeb390e28f
docs: clarify ftdetect scripts loading during packadd (#17465)
The old description doesn't match the current behavior anymore.
2022-02-20 15:58:31 -07:00
Michael Lingelbach
d80c9b9259
fix(diagnostic): use botright copen for qflist (#17475)
This matches the LSP handlers, and forces the qflist for diagnostics to
span across the horizontal space, below all open windows.
2022-02-20 13:44:14 -08:00
Michael Lingelbach
6a3acccd8b
fix(lsp): use botright copen for all handlers (#17471) 2022-02-20 11:09:01 -08:00
Christian Clason
439a843b80
vim-patch:8.2.4424: ".gts" and ".gjs" files are not recognized (#17464)
Problem:    ".gts" and ".gjs" files are not recognized.
Solution:   Recognize Glimmer flavored typescript and javascript.
            (closes vim/vim#9799)
cdf717283c
2022-02-19 23:41:11 +01:00
Michael Lingelbach
791e400858
fix: lsp and diagnostic highlight priority (#17461)
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.
2022-02-19 08:38:14 -08:00
Christian Clason
36362ef0ae
vim-patch:8.2.4414: solidity files are not recognized (#17451)
Problem:    Solidity files are not recognized.
Solution:   Add the *.sol pattern. (Dundar Goc, closes vim/vim#9792)
97b231541d
2022-02-18 17:08:43 +01:00
Sean Dewar
592f4a7c08
Merge pull request #17433 from seandewar/vim-8.2.3492
vim-patch:8.2.{3492,3493,3570,3573,3574,3575,3577,3601}: put overflow checking shenanigans
2022-02-18 00:09:11 +00:00
Christian Clason
1fd106ca88
vim-patch:8.2.4411: bicep files are not recognized (#17447)
Problem:    Bicep files are not recognized.
Solution:   Match *.bicep files. (Dundar Goc, closes vim/vim#9791)
8e5ba693ad
2022-02-17 23:05:48 +01:00
Sean Dewar
b149665689
vim-patch:8.2.3573: cannot decide whether to skip test that fails with 64 bit
Problem:    Cannot decide whether to skip test that fails with 64 bit ints.
            (closes vim/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.
2022-02-17 14:45:22 +00:00
zeertzjq
4646ea1079
Merge pull request #17363 from zeertzjq/dirchangedpre
feat(events): add DirChangedPre
2022-02-17 06:07:19 +08:00
Stephan Seitz
8ab5ec4aaa
feat(tree-sitter): allow Atom-style capture fallbacks (#14196)
This allows falling back to `@definition` when we have no mapping
`@definition.fancy-specialization`.

This behavior is described in tree-sitter's documentation
(https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme).

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/738
2022-02-16 19:38:19 +01:00
zeertzjq
cc81a8253b docs: minor changes related to mapping description 2022-02-16 16:58:32 +08:00
Shadman
9a74c2b04a
feat(mappings): considering map description when filtering (#17423) 2022-02-16 16:39:50 +08:00
zeertzjq
8051fa1aff
Merge pull request #17394 from zeertzjq/vim-8.2.4343
vim-patch:8.2.4343: when reloading not all properties are detected
2022-02-15 08:10:21 +08:00
zeertzjq
5220891571 vim-patch:8.2.4343: when reloading not all properties are detected
Problem:    When reloading not all properties are detected.
Solution:   Add the "edit" value to v:fcs_choice. (Rob Pilling, closes vim/vim#9579)
8196e94a8b

Cherry-pick some test changes from patch 8.1.1826.
2022-02-14 11:35:25 +08:00
marvim
45e666fb92 docs: regenerate [skip ci] 2022-02-13 13:44:51 +00:00
Chinmay Dalal
e481901748
docs: treesitter.txt - fix overflowing lines, document minimum_language_version (#17286) 2022-02-13 14:43:25 +01:00
Christian Clason
f89f4b1e12
Merge pull request #17379 from clason/vim-8.2.4352
vim-patch:8.2.4352: ReScript files are not recognized
2022-02-12 20:10:26 +01:00
Sean Dewar
cdb2c10011
vim-patch:8.2.0915: search() cannot skip over matches like searchpair() can
Problem:    Search() cannot skip over matches like searchpair() can.
Solution:   Add an optional "skip" argument. (Christian Brabandt, closes vim/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, closes vim/vim#9748)
0f7ff851cb
2022-02-12 12:00:36 +00:00
Christian Clason
3b13c7fc8b vim-patch:8.2.4352: ReScript files are not recognized
Problem:    ReScript files are not recognized.
Solution:   Add the *.res and *.resi patterns. (Ananda Umamil, closes vim/vim#9752)
0c3cc2fec3
2022-02-12 12:04:09 +01:00
James McCoy
906182065b
Merge pull request #17325 from glacambre/stdioopen_doc 2022-02-11 16:21:16 -05:00
glacambre
8090753880 docs(stdioopen): add missing documentation for on_print param
This commit adds documentation for the feature introduced in #15910.
2022-02-11 19:18:47 +01:00
Christian Clason
4761dd4fc2
Merge pull request #17365 from kevinhwang91/fix-ts-empty-lines
fix(query.lua): check empty table for lines
2022-02-11 15:19:19 +01:00
Lajos Koszti
f6329ea137
fix(lsp): correct prefix when filterText is present (#17051)
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 `.`.
2022-02-11 14:04:15 +01:00
kevinhwang91
afcf64479c fix(query.lua): check empty table for lines
The range of node may make `nvim_buf_get_lines` return an empty table.
2022-02-11 14:44:37 +08:00
zeertzjq
059d36e326 feat(events): add DirChangedPre
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. (closes vim/vim#9721)
28e8f73ae2
2022-02-11 12:55:58 +08:00
zeertzjq
851252f79d
Merge pull request #17012 from EdmundsEcho/fix-checkhealth
prevent checkhealth failure when plugin's check returns void
2022-02-11 05:50:49 +08:00
zeertzjq
aea889fc06 vim-patch:8.1.2221: cannot filter :disp output
Problem:    Cannot filter :disp output.
Solution:   Support filtereing :disp output. (Andi Massimino, closes vim/vim#5117)
8fc4296436
2022-02-10 07:28:54 +08:00
zeertzjq
9b0b4829c7
Merge pull request #17345 from zeertzjq/vim-8.2.4329
vim-patch:8.2.4329: no support for end line number and column in 'errorformat'
2022-02-09 21:02:37 +08:00
zeertzjq
196160b183 vim-patch:partial:f10911e5db16
Update runtime files
f10911e5db
2022-02-09 14:21:04 +08:00
zeertzjq
d9cb3fba92 vim-patch:8.2.4242: put in Visual mode cannot be repeated
Problem:    Put in Visual mode cannot be repeated.
Solution:   Use "P" to put without yanking the deleted text into the unnamed
            register. (Shougo Matsushita, closes vim/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.
2022-02-09 14:21:04 +08:00
zeertzjq
b9732e555b vim-patch:8.2.4329: no support for end line number and column in 'errorformat'
Problem:    No support for end line number and column in 'errorformat'.
Solution:   Add %e and %k. (closes vim/vim#9624)
e023d49937

Use "\t" to represent a Tab as it looks better.
2022-02-09 13:31:06 +08:00
Edmund Cape
300b009f47 fix(healthcheck): handle empty reports 2022-02-09 10:18:22 +08:00
Sean Dewar
46c93b4304
Merge pull request #16553 from seandewar/vim-8.2.0878
vim-patch:8.2.{0882,1051,1083}: port `reduce()` function
2022-02-08 17:05:27 +00:00
dundargoc
64116d7850
chore: fix typos (#17250)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
Co-authored-by: Axel Dahlberg <git@valleymnt.com>
2022-02-08 08:19:06 +08:00
Sean Dewar
02e7431445
docs(fuzzy-match): cherry-pick latest changes
53f7fccc94
1b884a0053
4c295027a4
3ec3217f04
2022-02-07 17:39:50 +00:00
Sean Dewar
ce797e08f5
vim-patch:8.2.2813: cannot grep using fuzzy matching
Problem:    Cannot grep using fuzzy matching.
Solution:   Add the "f" flag to :vimgrep. (Yegappan Lakshmanan, closes vim/vim#8152)
bb01a1ef3a
2022-02-07 17:20:51 +00:00
Sean Dewar
715fbcbb8c
vim-patch:8.2.2280: fuzzy matching doesn't give access to the scores
Problem:    Fuzzy matching doesn't give access to the scores.
Solution:   Return the scores with a third list. (Yegappan Lakshmanan,
            closes vim/vim#7596)
9d19e4f4ba

Remove seemingly useless NULL checks.
assert that removing the li one wasn't dumb.
2022-02-07 17:20:51 +00:00
Sean Dewar
30deb14f39
vim-patch:8.2.1893: fuzzy matching does not support multiple words
Problem:    Fuzzy matching does not support multiple words.
Solution:   Add support for matching white space separated words. (Yegappan
            Lakshmanan, closes vim/vim#7163)
8ded5b647a
2022-02-07 17:20:50 +00:00
Sean Dewar
960ea01972
vim-patch:8.2.1726: fuzzy matching only works on strings
Problem:    Fuzzy matching only works on strings.
Solution:   Support passing a dict.  Add matchfuzzypos() to also get the match
            positions. (Yegappan Lakshmanan, closes vim/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.
2022-02-07 17:20:49 +00:00
Sean Dewar
fba00b5e7e
vim-patch:8.2.1665: cannot do fuzzy string matching
Problem:    Cannot do fuzzy string matching.
Solution:   Add matchfuzzy(). (Yegappan Lakshmanan, closes vim/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.
2022-02-07 17:19:59 +00:00
zeertzjq
d457168e3b vim-patch:8.2.0208: fnamemodify() does not apply ":~" when followed by ":."
Problem:    Fnamemodify() does not apply ":~" when followed by ":.".
Solution:   Don't let a failing ":." cause the ":~" to be skipped. (Yasuhiro
            Matsumoto, closes vim/vim#5577)
d816cd94d8
2022-02-07 06:48:10 +08:00
zeertzjq
e2466d84bc
Merge pull request #17305 from zeertzjq/vim-8.2.1741
vim-patch:8.2.1741: pathshorten() only supports using one character
2022-02-07 05:21:39 +08:00
Christian Clason
05f38bbede vim-patch:8.2.4305: tex filetype detection fails
Problem:    Tex filetype detection fails.
Solution:   Check value to be positive. (closes vim/vim#9704)
e5b7897585
2022-02-06 12:10:09 +01:00
zeertzjq
d65ee12914 vim-patch:8.2.1741: pathshorten() only supports using one character
Problem:    pathshorten() only supports using one character.
Solution:   Add an argument to control the length. (closes vim/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.
2022-02-06 16:29:12 +08:00
Sean Dewar
28d5face21
Merge pull request #16862 from seandewar/vim-8.2.2658
vim-patch:8.2.{2658,2661,2736}: for loop over strings
2022-02-06 00:02:30 +00:00
zeertzjq
be9dbc925c vim-patch:partial:6aa57295cfbe
Update runtime files
6aa57295cf
2022-02-06 04:46:16 +08:00
zeertzjq
46d1b8ed1f vim-patch:partial:2346a6378483
Update runtime files
2346a63784
2022-02-06 04:46:16 +08:00
zeertzjq
6ab71683d1 vim-patch:8.2.2324: not easy to get mark en cursor posotion by character count
Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
6f02b00bb0
2022-02-06 04:46:16 +08:00
zeertzjq
8ba9f19961 vim-patch:8.2.1727: a popup created with "cursorline" will ignore "firstline"
Problem:    A popup created with "cursorline" will ignore "firstline".
Solution:   When both "cursorline" and "firstline" are present put the cursor
            on "firstline". (closes vim/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.
2022-02-06 04:46:16 +08:00
Sean Dewar
7002a3433b
vim-patch:8.2.2658: :for cannot loop over a string
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
2022-02-05 19:55:11 +00:00
Sean Dewar
4f7a8991a9
vim-patch:8.2.0233: crash when using garbagecollect() in between rand()
Problem:    Crash when using garbagecollect() in between rand().
Solution:   Redesign the rand() and srand() implementation. (Yasuhiro
            Matsumoto, closes vim/vim#5587, closes vim/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).
2022-02-05 14:01:00 +00:00
Sean Dewar
c97614d98f
vim-patch:8.1.2356: rand() does not use the best algorithm
Problem:    rand() does not use the best algorithm.
Solution:   use xoshiro128** instead of xorshift. (Kaito Udagawa,
            closes vim/vim#5279)
f8c1f9200c
2022-02-05 14:00:59 +00:00
Sean Dewar
061b06a8ae
docs(rand): cherry-pick changes from rt update 0c0734d
0c0734d527
2022-02-05 14:00:59 +00:00
Sean Dewar
22f0725aac
vim-patch:8.1.2342: random number generator in Vim script is slow
Problem:    Random number generator in Vim script is slow.
Solution:   Add rand() and srand(). (Yasuhiro Matsumoto, closes vim/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).
2022-02-05 13:16:34 +00:00
zeertzjq
9b0363d365 vim-patch:8.2.1128: the write message mentions characters, but it's bytes
Problem:    The write message mentions characters, but it's actually bytes.
Solution:   Change "C" to "B" and "characters" to "bytes".
3f40ce78f5
2022-02-04 22:17:25 +08:00
zeertzjq
6775a7d98f vim-patch:8.2.3797: no good reason to limit the message history in tiny version
Problem:    No good reason to limit the message history in the tiny version.
Solution:   Always use 200.
1e78deb077
2022-02-04 09:23:54 +08:00
zeertzjq
4c4a80950e docs: update feature-list
Add "linux", "sun".
Remove "+shellslash" as it should be passed to exists().
Sort alphabetically and consistently use Tabs for indent.
2022-02-04 09:23:54 +08:00
zeertzjq
f25ab39faa vim-patch:8.1.0846: not easy to recognize the system Vim runs on
Problem:    Not easy to recognize the system Vim runs on.
Solution:   Add more items to the features list. (Ozaki Kiichi, closes vim/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.
2022-02-04 09:23:54 +08:00
zeertzjq
a87ecf5d08 fix(health): do not run external processes in a shell 2022-02-03 18:38:37 +08:00
zeertzjq
21cdecc8e0
Merge pull request #17245 from zeertzjq/vim-8.2.3219
vim-patch:8.2.3219: :find searches non-existing directories
2022-02-02 22:31:14 +08:00
zeertzjq
f4300985d3
Merge pull request #17113 from zeertzjq/vim-8.2.2569
feat(statusline): support multibyte fillchar
2022-02-01 17:57:01 +08:00
zeertzjq
7d72076a6f vim-patch:8.2.3219: :find searches non-existing directories
Problem:    :find searches non-existing directories.
Solution:   Check the path is not "..".  Update help. (Christian Brabandt,
            closes vim/vim#8612, closes vim/vim#8533)
7a4ca32175

Change STRNCAT to STRLCAT as clint doesn't like the former.

Include a typo fix from 2f0936cb9a (diff-7e9292cae1f2ba70dd5b17d2d162693a91044ada6ac99e9c3e8917f32878c097)
2022-02-01 17:08:40 +08:00
Christian Clason
a562b5771e
vim-patch:8.2.4274: Basic and form filetype detection is incomplete (#17259)
Problem:    Basic and form filetype detection is incomplete.
Solution:   Add a separate function for .frm files. (Doug Kearns, closes vim/vim#9675)
c570e9cf68
2022-02-01 08:35:28 +01:00
Christian Clason
bddce4b0ff
vim-patch:c4573eb12dba (#17258)
Update runtime files
c4573eb12d
2022-01-31 18:09:51 +01:00
Christian Clason
79b92da0d2
vim-patch:partial:f10911e5db16 (#17248)
Update runtime files
f10911e5db
2022-01-31 15:27:01 +01:00
Sean Dewar
d746f5aa41 feat(eval): partially port v8.2.0878
Problem:    No reduce() function.
Solution:   Add a reduce() function. (closes vim/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.
2022-01-31 17:38:45 +08:00
Sean Dewar
f8f0f14db2
vim-patch:8.2.3433: :delcommand does not take a -buffer option
Problem:    :delcommand does not take a -buffer option.
Solution:   Add the -buffer option.
bdcba24d85
2022-01-30 22:25:08 +00:00