Compare commits

...

4818 Commits

Author SHA1 Message Date
d367ed9b23 NVIM v0.8.0
BREAKING CHANGES
- Remove 'insertmode' 'remap' and 'terse' options
- highlight: Rename attributes to match Vim (#19159)
- highlight: Error on invalid names and allow '.' and '@'
- terminal: Drop winpty, require Windows 10 #18253
- treesitter: Use @foo.bar style highlight groups
- treesitter: Do not merge queries by default (#20105)

FEATURES
- runtime: Enable filetype.lua by default (#19216)
- Add `undo!`
- Add "prerelease" to version dict
- Click support for 'statusline', 'winbar' #18650
- Add preview functionality to user commands
- allow cmdheight=0 (EXPERIMENTAL) #16251
- Stdpath('run'), /tmp/nvim.user/ #18993
- Add 'mousescroll' option (#12355)
- Allow :wincmd to accept a count (#19815)
- Multibuffer preview support for inccommand
- Man: Port to Lua (#19912)
- api: Ui options relevant for remote TUI
- api: Add `nvim_parse_cmd` And `nvim_cmd`
- api: Support handling stdin stream in remote ui
- api: Add `group_name` to `nvim_get_autocmds`
- api: Enable nvim_exec_autocmds to pass arbitrary data (#18613)
- api: Support pattern array for exec_autocmds
- api: Add `unsilent` to command APIs
- api: Add replace_keycodes to nvim_set_keymap (#19598)
- api: Add support for :horizontal modifier
- api: Add "move" to nvim_input_mouse
- api/ui: "ui_watched" option for ui-side extmarks
- build: Add_glob_target runs only on changed files #19070
- checkhealth: Check for slow shell #17829
- defaults: Session data in $XDG_STATE_HOME #15583
- defaults: Search selection by * and # in visual mode (#18538)
- defaults: Nnoremap & :&&<CR> #19365
- defaults: enable mouse by default (set mouse=nvi)  #19290
- diagnostic: Pass diagnostics as data to DiagnosticChanged autocmd (#20173)
- docs: Gen_help_html.lua
- edit: Insert an unsimplified key using CTRL-SHIFT-V
- treesitter: Full support for spelling
- filetype: Convert more patterns to filetype.lua
- filetype: Remove side effects from vim.filetype.match (#18894)
- filetype: Expand environment variables in filetype patterns (#20145)
- fs: Add vim.fs functions: parents() dirname() basename() dir() find() normalize()
- highlight: Implement CurSearch highlight
- highlight: Support scoped @spam.eggs.baked_beans groups
- input: Delay all simplifications
- l10n: Turkish translations #19441
- l10n: Improve zh_CN translations (#19483)
- lsp: Remove capabilities sanitization (#17814)
- lsp: Show feedback on empty hover response (#18308)
- lsp: Options to filter and auto-apply code actions (#18221)
- lsp: Add vim.lsp.buf.format (#18193)
- lsp: Add logging level "OFF" (#18379)
- lsp: Add LspAttach and LspDetach autocommands
- lsp: Add filter to vim.lsp.get_active_clients()
- lsp: Option to reuse_win for jump actions (#18577)
- lsp: Add a start function (#18631)
- lsp: Send didChangeConfiguration after init (#18847)
- lsp: Defaults: tagfunc, omnifunc, formatexpr (#19003, #19677)
- lsp: Allow passing custom list handler to LSP functions that return lists (#19213)
- lsp: Provide feedback if server can't compute rename result (#19546)
- lsp: Add range option to code_action; deprecate range_code_action (#19551)
- lsp: Disable exit_timeout by default (#19672)
- lsp: Add tcp support
- lua: Vim.deprecate() #18320
- lua: Vim.cmd() with kwargs acts like nvim_cmd() #18523
- lua: Allow some vim script functions to run in fast callbacks
- lua: Measure require in --startuptime
- lua: Allow vim.cmd to be indexed (#19238)
- lua: Print source locations of lua callbacks (#19597)
- lua: Add vim.iconv (#18286)
- lua: Vim.ui_attach to get ui events from lua (EXPERIMENTAL)
- man.vim: List command flags in "gO" outline #17558
- mappings: Do not replace existing mapping for simplified form
- mappings: Allow special keys and modifiers in <Cmd> mapping
- mapset: Support restoring "replace_keycodes" and "desc"
- mapset: Support restoring Lua callback (#20024)
- marks: Restore viewport on jump #15831
- nvim_create_user_command: Pass structured modifiers to commands
- pum: Pretend 'mousemoveevent' is set when showing right-click menu
- server: Set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
- server: Instance "name", store pipes in stdpath(state)
- term: Add support for libvterm >= 0.2
- terminal: Implement <c-\><c-o> for terminal mode
- terminal: Recognize underdouble and undercurl
- terminfo: Bump built-in terminfo entries (#18570)
- treesitter: Allow customizing language symbol name
- treesitter: Add ability to retreive a tree/node given a range
- treesitter: Upstream node methods from nvim-treesitter
- treesitter: Include language in invalid query error (#14053)
- treesitter: Bundle Lua parser and queries
- treesitter: Add viml parser and queries
- treesitter: Add injections
- treesitter: Add vim.treesitter.start(), enable for Lua
- treesitter: Bundle :help parser and queries
- tui: Query terminal for CSI u support (#18181)
- tui: Recognize keypad keys when using kitty keyboard protocol
- tui: Try terminfo for [re]set_cursor_color OSC #19255
- tui: Allow grid and host to disagree on ambiguous-width chars (#19686)
- tui: Recognize sidescroll events (#19992)
- tui: Support 'mousemoveevent'
- ui: Add `'winbar'`
- ui: Clear message history explicitly with msg_history_clear event
- ui: Make right-click menu work properly with ext_multigrid
- ui: Allow to set the highlight namespace per window
- ui: Use msg_grid based implementation for cmdheight=0
- ui-ext: Make 'mousemoveevent' a ui_option
- eval: Make Lua Funcref work as method and in substitute() (#20217)
- eval: Input() support any type for "cancelreturn" in a dict (#19357)

BUG FIXES
- Show autocmd output when F is in shortmess (#18251)
- Has() should preserve v:shell_error #18280
- Suppress "is a directory" messages with shortmess 'F' (#18296)
- Display global statusline correctly with ext_messages
- Correct nlua_wait error message #18867
- Right-click in clickable statusline #19252
- Remote UI may get invalid 'pumblend' value #19379
- Assertion failure when requiring missing module in autocmd
- api: Nvim_eval_statusline should validate input #18347
- api: Check error after getting win/buf handle (#19052)
- api: Check for inclusive buffer line index out of bounds correctly (#19056)
- api: Change default value of 'pattern' in nvim_exec_autocmds (#19115)
- api: Do not switch win/buf if getting option in current win/buf (#19383)
- api: Make nvim_set_hl(ns=0, ...) redraw screen properly
- api: Nvim_set_hl bail out on invalid group name (#20021)
- api: Notify dict watchers on nvim_set_var and vim.g setter
- api/command: Fargs behavior when no arguments are passed (#19862)
- autocmds: Separate command from desc (#18617)
- buffer: Disable buffer-updates before removing from window #18933
- build: Missing definitions for sizeof macros #16393
- build: Only pass -municode if MINGW #19049
- build: Strip trailing newline from variable (#19084)
- build: Don't disable byte precompilation on debug builds
- build: Fails if git is missing #19366
- charclass: Make behavior with empty str match latest Vim (#19749)
- checkhealth: Skip vim.health #18816
- ci: Remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
- cmd: Make :-tabmove work with modifiers (#18447)
- cmdheight=0: Various issues part3 #19816
- cmdline: Fix passing -1 as char
- cmdline: Trigger CmdlineEnter and ModeChanged earlier (#19474)
- cmdline: Do not trigger completion at wrong time (#19920)
- cmdline: Don't send invalid cursor with incsearch and cmdheight=0
- column: Move sign sentinel after inserting/deleting lines (#20400)
- completion: Remove wrong FUNC_ATTR_NONNULL_ALL (#19627)
- diagnostic: Use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
- diagnostic: Check for negative column value (#18868)
- diagnostic: Remove buf from cache on `BufWipeout` (#20099)
- diagnostic: Populate data key in DiagnosticChanged autocmd in reset (#20207)
- docs: Correct obsolete note about 'writedelay' in dev docs
- docs: Remove internal function from docs
- edit.c: Indentkeys double indent after "!" #12894
- eval: Check for v:lua when calling callback (#19855)
- eval/f_getmatches: Return empty list for invalid win argument (#18893)
- events: Make CursorHold behave as documented
- ex_cmds: Correct flags for :const (#19387)
- exceptions: Restore `did_throw` (#20000)
- exmode: Do not throttle messages when pressing enter to print line
- extmarks: Make virt_lines always start at 0 virtcol
- filetype: Fix and improve filetype patterns
- fillchars: Change fallback after setcellwidths()
- float: Make `screen*()` functions respect floating windows
- float: Fix glitch when making float window with border a split
- float: Fix mouse drag position if float window turned to a split
- folds: Fix fold regression with :move (#18685)
- folds: Fix fold remains when :delete makes buffer empty (#19673)
- ftdetect: Source plugins in autogroup (#18237)
- gen_vimdoc.py: Handle missing luajit
- getchar: Flush screen before doing a blocking wait
- handlers: More specific error messages (#16772)
- health: Correct shada file path #18603
- health: Handle non-existent log file #18610
- highlight: Use ctermbg/fg instead of bg/fg when use_rgb=false #18982
- highlight: Add missing 'nocombine' to nvim_get_hl apis (#19586)
- highlight: Set the window namespace when redrawing statusline
- hl: Set Normal hl group sg_attr value #18820
- hl: Return cterm fg/bg even if they match Normal #18981
- inccommand: Do not try to preview an ambiguous command (#18827)
- inccommand: Avoid crash if callback changes inccommand option (#18830)
- inccommand: Clear cmdpreview state if preview is not shown (#18923)
- inccommand: Skip split window if not enough room #18937
- inccommand: Never preview if parsing command failed (#18944)
- inccommand: Parse the command to check if it is previewable
- inccommand: Deal with unsynced undo (#20041)
- input: Allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885)
- input: Fix macro recording with ALT and special key (#18917)
- input: Use correct grid when restoring cursor for <expr> mapping (#19047)
- input: Do no reinterpret mouse keys with ALT modifiers
- input: Use click number of last click for mouse drag (#20300)
- inspect: Escape identifiers that are lua keywords (#19898)
- keywordprg: Default to :help if set to empty string (#19983)
- l10n: Improve zh_CN and zh_TW translations (#19969)
- log: Back even again
- logging: Skip recursion, fix crash #18764
- logging: Make logmsg() thread-safe again
- logging: Try harder to resolve Nvim "name" #19016
- lsp: Unify progress message handling (#18040)
- lsp: Fix unnecessary buffers being added on empty diagnostics (#18275)
- lsp: Fix infinite loop in resolved_capabilities deprecation message (#18333)
- lsp: Add missing bufnr argument (#18382)
- lsp: Fix rename capability checks and multi client support (#18441)
- lsp: Detach spawned LSP server processes (#18477)
- lsp: Perform client side filtering of code actions (#18392)
- lsp: Only send diagnostics from current buffer in code_action() (#18639)
- lsp: Respect global syntax setting in open float preview (#15225)
- lsp: Include cancellable in progress message table (#18809)
- lsp: Adjust offset encoding in lsp.buf.rename() (#18829)
- lsp: Set buflisted before switching to buffer (#18854)
- lsp: Fix multi client handling in code action (#18869)
- lsp: Small bugs in snippet-parser #18998
- lsp: Pcall nvim_del_augroup_by_name (#19302)
- lsp: Abort pending changes after flush when debouncing (#19314)
- lsp: Don't attach a client in lsp.start() if there is none (#19328)
- lsp: Account for initializing servers in vim.lsp.start (#19329)
- lsp: Move augroup define to if statement (#19406)
- lsp: Set workspace.configuration capability (#19548)
- lsp: Send didOpen if name changes on write (#19583)
- lsp: Prevent unexpected position jumps (#19370)
- lsp: Avoid  ^M character in hover window on Windows (#19640)
- lsp: Set end_col in formatexpr (#19676)
- lsp: Handle multiple clients with incremental sync (#19658)
- lsp: Fix some type annotations in lsp.rpc (#19714)
- lsp: Avoid pipe leaks if lsp cmd isn't executable (#19717)
- lsp: Handle nil client in onexit callback (#19722)
- lsp: Fix nil value error in get_group (#19735)
- lsp: Clean the diagnostic cache when buffer delete (#19449)
- lsp: When buffer detach remove buffer from client attached buffers (#20081)
- lsp: Schedule removal of client object (#20148)
- lsp: Support `false` result in handlers (#20252)
- lsp: Out of bounds error in lsp.util.apply_text_edits (#20137)
- lsp: Use correct function name in deprecated message (#20308)
- lsp: Create missing directory before creating file (#19835)
- lua: Don't mutate opts parameter of vim.keymap.del (#18227)
- lua: Stop pending highlight.on_yank timer, if any (#18824)
- lua: Highlight.on_yank can close timer in twice #18976
- lua: Clear got_int when calling vim.on_key() callback (#18979)
- lua: Don't leak memory on error
- lua: Double entries in :lua completion #19410
- lua: Make it possible to cancel vim.wait() with Ctrl-C (#19217)
- lua: Make ui_attach()/ui_detach() take effect immediately (#20037)
- lua: Make vim.str_utfindex and vim.str_byteindex handle NUL bytes
- lua: Free vim.ui_attach callback before lua close (#20205)
- lua: Fix architecture-dependent behavior in usercmd "reg" (#20384)
- mac: Use same $LANG fallback mechanism as Vim
- mac: Add CoreServices to flake.nix #18358
- man.vim: Q in "$MANPAGER mode" does not quit #18443
- maparg: Remove double allocation (#20033)
- mappings: Fix double-free when unmapping simplifiable Lua mapping
- mapset: Remove existing abbreviation of same lhs (#20320)
- mark: Set mark fnum from buffer (#19195)
- mark: Mark without a view restores at topline #19224
- mark: Fix unexpected cursor movements (#19253)
- mark: Give correct error message when mark is in another buffer (#19454)
- menu: Make :menu still print header when there are no menus
- messages: Add color when showing nvim_echo in :messages history
- messages: Do not crash on cmdheight=0 and g< redisplay
- messages: Validate msg_grid before silent! message with cmdheight=0
- mksession: Don't store floats in session #18635
- mouse: Click on global statusline with splits (#19390)
- mouse: Fix using uninitialized memory with K_MOUSEMOVE (#19480)
- mpack: Make sure a `bool` always is a `bool`
- normal: Fix segfault with bracket command jumping to a mark
- options: Properly free string options (#19510)
- options: Mark `winhighlight` as list style  (#19477)
- packaging: Remove excess forward slash in Wix Patch (#18121)
- paste: Ignore mappings in Cmdline mode (#18114)
- path: Path_is_url returns false for "foo:/" #19797
- powershell: Filter ":!" commands with args #19268
- pum: Make right drag in anchor grid to select work in multigrid UI (#19382)
- query: Fix unnatural order for inherits in treesitter queries (#20298)
- redraw: Make sure :redraw! redraws command line
- redraw: Handle switching to a tabpage with larger p_ch value
- redraw: Avoid unnecessary redraws and glitches with floats+messages
- redraw: Make redrawdebug=nodelta handle all the cases
- rpc: Break nvim_error_event feedback loop between two nvim instances
- runtime/genvimvim: Omit s[ubstitute] from vimCommand #18480
- screen: Restart win_update() if a decor provider changes signcols (#18768)
- screen: Check for col instead of vcol when drawing fold (#19572)
- session: Respect sessionoptions=terminal #19497
- shared: Avoid indexing unindexable values in vim.tbl_get() (#18337)
- signs: Priority of extmark signs (#19718)
- source: Make changing 'shellslash' change expand() result
- source: Fix expand('<sfile>') no longer works for Lua
- spell: Make setting 'encoding' clear word list
- spell: Correct spell move behavior without "noplainbuffer" (#20386)
- startup: Nvim with --clean should not load user rplugins
- substitute: Subtract number of backslashes later
- tabpage: Check if ROWS_AVAIL changed for resize (#19620)
- terminal: Invalid pointer comparison #18453
- terminal: Do not trim whitespace that is actually in the terminal (#16423)
- terminal: Scrollback delete lines immediately #18832
- terminal: Coverity USE_AFTER_FREE #18978
- terminal: Crash if TermClose deletes own buffer #19222
- terminal: Avoid reading over the end of cell.chars (#19580)
- terminal: Skip aucmd_win when checking terminal size (#19668)
- terminal: Adopt altscreen test for libvterm 0.2 changes
- terminfo: Disable smglr for vtpcon and conemu (#18855)
- termopen: Avoid ambiguity in URI when CWD is root dir (#16988)
- tests: Fix some screen.lua warnings
- tests: Fix some issues with ui/inccommand_spec.lua causing slowness
- tests: Unreliable parser_spec #18911
- tests: Check for EOF on exit of nvim properly
- tests: Missing clear() #18927
- tests: Remove misleading $TEST_PATH segment #19050
- tests: Remove irrelevant usage of display-=msgsep
- tests: Use pending_c_parser when needed
- tests: Indicate in test logs when nvim exit times out
- tmpdir: Invalid tempname() if username has slashes #19323
- treesitter: Create new parser if language is not the same as cached parser (#18149)
- treesitter: Bump match limit up
- treesitter: Offset directive associates range with capture (#18276)
- treesitter: Correct region for string parser (#18794)
- treesitter: New iter if folded
- treesitter: Don't error when node argument of predicate is nil (#19355)
- treesitter: Free memory on removing parser (#19933)
- treesitter: More efficient node:root()
- treesitter: Make it get_captures_at_position
- treesitter: Do not link @error by default
- treesitter: Don't support legacy syntax in start()
- treesitter: Use the right loading order for base queries (#20117)
- treesitter: Prevent endless loop on self-inheritence
- treesitter: Return full metadata for get_captures_at_position (#20203)
- ts: Do not clobber spelloptions (#20095)
- tui: Update modifyOtherKeys reporting (#18158)
- tui: Disable extended keys before exiting alternate screen (#18318)
- tui: Piping nodejs to nvim breaks input handling #18932
- tui: Resize at startup #17795
- tui: Add fixups for hterm family #19078
- tui: Handle padding requirements for visual bell (#20238)
- ui: Require window-local value to show winbar on floating windows (#18773)
- ui: Do not call showmode() when setting window height (#18969)
- ui: Set redraw_cmdline when setting window height (#19630)
- ui: Don't allow decor provider with ns_id==0
- ui: Ui compositor does not correctly free event callbacks
- ui: Allow redrawing statusline when msgsep is used (#20337)
- ui: Redraw end of buffer if last line is modified (#20354)
- unittests: Coredump when running unit tests #18663
- usercmd: Also check for whitespace after escaped character (#19942)
- version.c: Mark N/A vim patches #18587
- vim.ui.input: Accept nil or empty "opts"  #19109
- window: Close floats first when closing buffer in other tab (#20284)
- window: Fix equalization with cmdheight=0 (#20369)
- windows: Stdpath("state") => "nvim-data" #18546
- windows: Exepath, stdpath return wrong slashes #19111
- winhl: Do not crash when unsetting winhl in just opened window
- Make :undo! notify buffer update callbacks (#20344)
- eval: Make Vim functions return inner window width and height (#19743)

BUILD SYSTEM
- Bump Doxyfile to minimum required version 1.9.0 #18118
- Bump msgpack to 4.0.0
- Enable EXITFREE on Debug builds (#17783)
- Add formatting targets for c and lua files (#19488)
- clang-format: Align with project style #18192
- clint: Remove all python2-isms with pyupgrade
- clint: Remove "function size is too large" warning
- clint: Remove rules for includes, whitespace, tabs #18611
- cmake: Simplify and speed up the uninstall target
- cmake: Simplify def_cmd_target function
- cmake: Use glob_wrapper instead of file(GLOB in main CMakeLists
- cmake: Fix static `libintl` test on macOS
- deps: Bump LuaJIT, Luv and libuv
- deps: Support universal builds on macOS
- deps: Bump tree-sitter to v0.20.7 (#20067)
- deps: Bump tree-sitter parsers
- deps: Bump required libvterm to v0.3 (#20222)
- deps: Require libtermkey version 0.22
- deps: update neovim-qt, win32tools.zip

PERFORMANCE
- Only redraw for CurSearch when it is currently in use
- highlight: Allocate permanent names in an arena for fun and cache locality
- highlight: Use binary search to lookup RGB color names
- map: Visit only one hash bucket instead of all, like an actual hash table
- memory: Get rid of extraneous heap allocations
- memory: implement arena memory allocation with a shared freelist
- memory: Use an arena for RPC decoding and some API return values
- messages: Don't call ui_flush() per message line in various places
- treesitter: Use a reuse list for query cursors
- ui: Reduce allocations when encoding and decoding "redraw" events
- ui: Avoid ui_flush() work in headless mode

REFACTOR
- checkhealth: Rename to vim.health, move logic to Lua #18720
- Add pure attribute to pure functions
- Replace char_u variables and functions with char
- Enable -Wconversion warning for all Nvim source files
- Add warnings for deprecated functions (#18662)
- Change type of linenr_T from long to int32_t
- Use nvim_get/set_option_value for vim.{b,w}o
- Remove functions marked for deprecation in 0.8 (#19299)
- Rename function prefix mb to the more accurate utf_cp (#19590)
- Remove some unused includes
- Change remaining sourcing_name/sourcing_lnum to exestack
- Change FALSE/TRUE to false/true
- api: Use a hashy hash for looking up api method and event names
- api: Use a unpacker based on libmpack instead of msgpack-c
- api: restructure api/vim.c and api/private/helpers.c code in separate files
- api: Remove redundant fields of CmdParseInfo
- aucmd: Call define_autocmd() directly for default autocmds
- ci: Cleanup release.yml #19132
- cmd: Format do_one_cmd()
- cmd: Hoist out some code into functions
- cmd: Unify execute_cmd with do_one_cmd
- decor: Use decor levels properly
- drawline.c: Factor out utf8 multibyte check
- eval: Use Hashy McHashFace instead of gperf
- eval.c: Resolve all clint issues (#19774)
- eval/funcs.c: Resolve all clint errors
- events: Remove unnecessary fudging of updating_screen
- ex_cd: Add an early return to fix clint warning
- ex_docmd.c: Resolve most clint errors (#19775)
- filetype: Allow vim.filetype.match to accept buf and filename (#19114)
- highlight: Make hlattrs2dict always use pre-allocated dict
- log: Simplify log_path_init #18898
- log: Use msg_schedule_semsg #18950
- lsp: Remove redundant client cleanup (#18744)
- lsp: Make the use of local aliases more consistent
- lsp: Use autocmd api (#19407)
- lsp: Factor out read_loop function
- lsp: Encapsulate rpc uv handle
- lsp: Extract rpc client from rpc.start
- lua: Replace hard-coded gsub with vim.pesc() (#18407)
- lua: Reformat with stylua 0.14.0 (#19264)
- lua: Git-blame-ignore stylua update PR (#19273)
- lua: Replace vim.cmd use with API calls (#19283)
- map: Simplify free_all_mem handling
- map: Statically initialize maphash array
- map: Simplify add_map params
- normal: Convert function comments to doxygen format
- object: Get rid of redundant FIXED_TEMP_ARRAY
- ops: Doxygen docstrings #17743
- option: DRY get/set option value #19038
- plines: Use a struct for chartabsize state
- provider: Use list comprehension #19027
- regexp_nfa.c: Match where Vim calls fopen() (#18778)
- runtime: Convert dist#ft functions to lua (#18247)
- runtime: Convert more dist#ft functions to lua (#18430)
- runtime: Convert the remaining dist#ft functions to lua (#18623)
- runtime: Port remaining patterns from filetype.vim to filetype.lua (#18814)
- runtime: Refactor filetype.lua (#18813)
- runtime: Port scripts.vim to lua (#18710)
- setcellwidths: Use TV_LIST_ITEM_NEXT properly
- signs: Handle non-sign attrs separately (#19784)
- tests: Introduce testprg()
- treesitter: Get_{nodes,captures}_at_{position,cursor}
- typval: Change FC_CFUNC abstraction into FC_LUAREF
- ui: Simplify stdin handling
- uncrustify: Format all c code under /src/nvim/
- vim.opt: Remove del arg
- vim.opt: Unify vim.bo/wo building
- vim.opt: Optimize append/prepend/remove
- Format runtime with stylua
2022-09-30 17:15:13 +02:00
892da763bb fix(dist): update neovim-qt, win32tools.zip #20413
- fix regression by #20411
  - `diff.exe` is required for non-default 'diffopt' (diffopt=filler, diffopt=context, …)
  - the names of some required nvim-qt DLLs changed
2022-09-30 07:53:10 -07:00
ad6af3c1a9 dist(win): update neovim-qt, win32tools.zip #20411
- update curl.exe (+ ca bundle), tee.exe, xxd.exe
- remove diff.exe because `diffopt=internal` is now the default
- update neovim-qt
2022-09-30 04:24:46 -07:00
1839848808 Merge pull request #20409 from bfredl/unicode-tables
feat: update unicode tables
2022-09-30 11:08:38 +02:00
37a1c0914d feat: update unicode tables 2022-09-30 10:45:51 +02:00
5399513fd0 Merge pull request #20343 from zeertzjq/virt-lines-vcol
fix(extmarks): make virt_lines always start at 0 virtcol
2022-09-30 10:15:51 +02:00
b414e9fdbb Merge pull request #20364 from zeertzjq/parse-cmd-omit
fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported
2022-09-30 09:59:45 +02:00
df646572c5 docs: fix typos (#20394)
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-30 09:53:52 +02:00
9cf252e121 Merge pull request #20387 from famiu/feat/nvim_cmd/buffer-args
feat(nvim_cmd)!: allow using first argument as count
2022-09-30 09:43:18 +02:00
cb62592bcb fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported 2022-09-30 11:24:23 +08:00
33dd917d7f fix(filetype): add missing return to changelog detection function (#20403) 2022-09-29 16:26:19 +02:00
94718e479d fix(query): fix unnatural order for inherits in treesitter queries (#20298)
close #20297
2022-09-29 16:25:07 +02:00
e46eef75ac feat(nvim_cmd): allow using first argument as count
Allows `nvim_cmd` to use the first argument as count for applicable
commands. Also adds support for non-String arguments to `nvim_cmd`.
2022-09-29 19:31:40 +06:00
f9228577e8 ci: convert CRLF to LF (#20389) 2022-09-29 14:31:12 +02:00
d9f5940997 Merge #20402 feat(docs): improve :help HTML generator 2022-09-29 07:46:14 -04:00
563bc39aac feat(docs): fixes for :help HTML generator
Generate correct leading whitespace for argument, taglink, tag, etc.
2022-09-29 13:26:12 +02:00
561c99c86a feat(treesitter): update :help parser 2022-09-29 13:08:43 +02:00
c7cc6591c1 Merge pull request #20381 from cryptomilk/asn-vterm
build(deps): require libvterm version 0.3
2022-09-29 07:00:44 -04:00
0f04c14c0d Merge pull request #20382 from cryptomilk/asn-termkey
build(deps): require libtermkey version 0.22
2022-09-29 06:59:28 -04:00
45707c1eae fix(api): fix nvim_cmd crash with filename expansion (#20397) 2022-09-29 16:04:14 +08:00
1cf44d6f57 fix(column): move sign sentinel after inserting/deleting lines (#20400) 2022-09-29 15:48:39 +08:00
a80ab395aa test: add a Lua test for #17501 (#20392) 2022-09-29 08:56:00 +08:00
e8ff432922 Merge pull request #20390 from bfredl/doc2
docs: mark cmdheight=0 and vim.ui_attach as experimental
2022-09-28 19:00:54 +02:00
268bad4798 Merge #20352 feat(gen_help_html.lua): adapt to new parser 2022-09-28 12:55:52 -04:00
16336c486e feat(gen_help_html.lua): adapt to new parser
- adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16
- numerous other generator improvements
2022-09-28 18:34:20 +02:00
7b4c49888a feat(gen_help_html.lua): put commit-id in footer 2022-09-28 17:31:59 +02:00
d9ed8d1110 feat(treesitter): update :help parser and queries 2022-09-28 17:31:56 +02:00
cd96fe06e1 build(deps): bump treesitter-vimdoc to v1.0.0 2022-09-28 16:39:42 +02:00
a5effcedd2 build(deps): bump help parser and queries (#20388) 2022-09-28 16:29:35 +02:00
47b821eccf docs: mark cmdheight=0 and vim.attach_ui as experimental
These will require further work for user experience out of the box
during the 0.9 cycle.
2022-09-28 16:18:04 +02:00
bafeb32b95 fix(spell): correct spell move behavior without "noplainbuffer" (#20386) 2022-09-28 21:55:22 +08:00
3965210055 Merge pull request #20375 from famiu/refactor/get_option
refactor: replace unnecessary helper functions in optionstr.c
2022-09-28 14:28:12 +02:00
9ca313fb96 vim-patch:9fbdbb814f4a (#20376)
Update runtime files
9fbdbb814f

Skip ftplugin/vim.vim (vim9script change)
Drop indent/vim.vim and autoload/dist/vimindent.vim (vim9script rewrite)
2022-09-28 12:48:36 +02:00
35e2c4a2ed fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384)
I don't think using an integer as a NUL-terminated string can work on
big-endian systems, at least.

This is also not tested. Add a test.

Also fix a mistake in the docs of nvim_parse_cmd.
2022-09-28 18:27:59 +08:00
eb4844b5ed build(macos): restore and test universal build (#20383)
Build tree-sitter parsers for arm64 as well as x86
Check that all created binaries contain both architectures
2022-09-28 11:06:11 +02:00
d7358118aa fix: compiler warnings from clang 15 (#20321)
Add -Wno-strict-prototypes flag to external dependencies to suppress
cjson warnings. These needs to be fixed upstream first.
2022-09-28 10:53:44 +02:00
6917a2e569 build(deps): require libvterm version 0.3 2022-09-28 10:13:48 +02:00
6427dc8ab6 build(deps): require libtermkey version 0.22
Reduces #ifdef code.
2022-09-28 09:41:18 +02:00
4b7904d16b refactor: replace unnecessary helper functions in optionstr.c
Replaces unnecessary helper functions in `optionstr.c` such as
`get_option_flags()`, `get_option_fullname()`, `set_option_flag()`,
`is_global_option()`, etc. with a single `get_option()` helper function
that allows direct access to the `options` array.

Also refactors `f_exists()` to use `get_varp_scope` instead of using
`get_option_tv`. This opens up the path for removing `getoptions_T`
altogether later down the line since the hidden option logic is no
longer needed.
2022-09-28 09:29:43 +06:00
e6c214033a fix(window): fix equalization with cmdheight=0 (#20369) 2022-09-28 06:22:11 +08:00
d84abfeb1d Merge pull request #15373 from smolck/lua-notify-dictwatcher
fix(nvim): notify dict watchers on nvim_set_var and vim.g setter
2022-09-27 18:16:58 +02:00
f46060c4cb vim-patch:9.0.0604: luacheckrc file is not recognized (#20371)
Problem:    Luacheckrc file is not recognized.
Solution:   Use lua filetype for luacheckrc. (closes vim/vim#11236)
49c311c9b1
2022-09-27 16:10:19 +02:00
6afe5cce79 ci(backport): bump to backport-action@v0.0.8 #20366
Primary bug fix is allowing backports with empty PR description.
2022-09-27 05:53:48 -07:00
c7d30c152d fix(api): notify dict watchers on nvim_set_var and vim.g setter
Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-09-27 14:47:53 +02:00
4278a2d359 Merge pull request #20368 from clason/vim-9.0.0599
vim-patch:9.0.0602: new TypeScript extensions are not recognized

Problem:    New TypeScript extensions are not recognized.
Solution:   Recognize .mts and .cts files. (closes vim/vim#11237)
7fc6c0e4da

vim-patch:9.0.0600: GYP files are not recognized

Problem:    GYP files are not recognized.
Solution:   Recognize GYP files. (closes vim/vim#11242)
d324742292

vim-patch:9.0.0599: latexmkrc files are not recognized

Problem:    Latexmkrc files are not recognized.
Solution:   Use Perl filetype for latexmkrc files. (closes vim/vim#11241)
cde0319385
2022-09-27 14:02:10 +02:00
fe0727a1bf vim-patch:9.0.0602: new TypeScript extensions are not recognized
Problem:    New TypeScript extensions are not recognized.
Solution:   Recognize .mts and .cts files. (closes vim/vim#11237)
7fc6c0e4da
2022-09-27 13:04:34 +02:00
e176f9dacf vim-patch:9.0.0600: GYP files are not recognized
Problem:    GYP files are not recognized.
Solution:   Recognize GYP files. (closes vim/vim#11242)
d324742292
2022-09-27 12:39:09 +02:00
760a8754c0 vim-patch:9.0.0599: latexmkrc files are not recognized
Problem:    Latexmkrc files are not recognized.
Solution:   Use Perl filetype for latexmkrc files. (closes vim/vim#11241)
cde0319385
2022-09-27 12:37:44 +02:00
1d337d4e2f vim-patch:9.0.0595: extra newline in messages after a verbose shell message (#20359)
Problem:    Extra newline in messages after a verbose shell message.
Solution:   Output the newline with msg_putchar_attr(). (closes vim/vim#11233)
            Make it possible to filter a screendump before comparing it.
1190139ed0

Cherry-pick Test_message_more_scrolledback() from patch 9.0.0592 because
Nvim already behaves as intended.
2022-09-27 08:29:21 +08:00
7e98821e56 fix(ui): redraw end of buffer if last line is modified (#20354) 2022-09-27 06:33:48 +08:00
9a5ac06509 fix(docs): invalid :help links #20353
ref #20159
2022-09-26 06:56:07 -07:00
be693462d5 fix(ui): allow redrawing statusline when msgsep is used (#20337) 2022-09-26 21:23:43 +08:00
c7e74f7889 Merge pull request #20351 from bfredl/cmdfix2
fix(cmdline): don't send invalid cursor with incsearch and cmdheight=0
2022-09-26 13:30:19 +02:00
be72af2f9b fix(cmdline): don't send invalid cursor with incsearch and cmdheight=0
fixes #20306
2022-09-26 13:29:55 +02:00
c815aadfcc docs: fix typos (#20150)
Co-authored-by: Miguel Carneiro <mcarneiromorenas@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-26 17:43:23 +08:00
fe045bfd5f Merge pull request #20350 from bfredl/cmdfix
fix(messages): validate msg_grid before silent! message with cmdheight=0
2022-09-26 11:25:15 +02:00
db0ea1ab44 fix(messages): validate msg_grid before silent! message with cmdheight=0
fixes #20316
2022-09-26 10:50:49 +02:00
6596f7e136 Merge pull request #20277 from reiver-dev/term-more-underline
feat(terminal): recognize underdouble and undercurl
2022-09-26 09:20:58 +02:00
4bb1d1df79 feat(terminal): recognize underdouble and undercurl 2022-09-26 11:53:20 +08:00
63be765182 fix(docs): invalid :help links #20345
Fix those naughty single quotes.

closes #20159
2022-09-25 16:58:27 -07:00
9ffa041a9a vim-patch:9.0.0586: missing change in test (#20347)
Problem:    Missing change in test.
Solution:   Add the test change.
124af71a28

vim-patch:9.0.0585: when long message test fails the error message is not visible

Problem:    When long message test fails the error message is not visible.
Solution:   Dump more lines.
6a879878f4
2022-09-26 07:46:58 +08:00
ac66f5af06 fix!: make :undo! notify buffer update callbacks (#20344)
When :undo! was introduced to Nvim the implementation of 'inccommand'
preview callback hasn't been fully decided yet, so not notifying buffer
update callbacks made sense for 'inccommand' preview callback in case it
needs to undo the changes itself.
Now it turns out that the undo-and-forget is done automatically for
'inccommand', so it doesn't make sense for :undo! to avoid notifying
buffer update callbacks anymore.
2022-09-26 07:15:07 +08:00
a6c9764eda fix(inccommand): deal with unsynced undo (#20041) 2022-09-26 07:00:37 +08:00
f8a1cadccf fix(filetype): use :setf instead of nvim_buf_set_option (#20334) 2022-09-25 16:29:25 +02:00
fded344f38 fix(extmarks): make virt_lines always start at 0 virtcol 2022-09-25 21:44:01 +08:00
91e912f8d4 refactor: move klib out of src/nvim/ #20341
It's confusing to mix vendored dependencies with neovim source code. A
clean separation is simpler to keep track of and simpler to document.
2022-09-25 06:26:37 -07:00
4686bda06c Merge #20331 refactor(treesitter)!: rename x_position => x_pos 2022-09-25 08:37:05 -04:00
1b60b5ec94 fix(gen_vimdoc.py): handle missing luajit 2022-09-25 14:31:33 +02:00
2a5692c646 vim-patch:9.0.0583: only recognizing .m3u8 files is inconsistent (#20342)
Problem:    Only recognizing .m3u8 files is inconsistent.
Solution:   Also matc .m3u files. (issue vim/vim#11204)
b9725bc7f6
2022-09-25 13:59:11 +02:00
3169fc54a1 refactor(treesitter): rename x_position => x_pos
"pos" has a long precedent as "position" in vim, and there is no reason
to use a verbose name here.
2022-09-25 13:46:15 +02:00
2a3cb0893b feat: ":write!" skips "file changed" warning #18665
Problem:
Cannot opt-out of "WARNING: The file has been changed since reading
it!!!", even with ":write!".

Solution:
Change ":write!" to skip the warning.

closes #7270
2022-09-24 18:57:10 -07:00
c7cf1232a7 vim-patch:8.2.4467: running filetype test leaves file behind (#20335)
Problem:    Running filetype test leaves file behind.
Solution:   Delete the file.
0e71b7d4ce

vim-patch:8.2.4466: MS-Windows: illegal memory access in installer

Problem:    MS-Windows: illegal memory access in installer when using
            "create-directories" as the final argument.
Solution:   Check the argument count. (Cam Sinclair, closes vim/vim#9844)
5c6edf41f9
2022-09-25 09:49:21 +08:00
b0fcdf9f09 vim-patch:9.0.0576: unused loop variables (#20326)
Problem:    Unused loop variables.
Solution:   Use a while loop instead. (closes vim/vim#11214)
b2209f213e
2022-09-25 06:07:59 +08:00
8317b9199e fix(input): use click number of last click for mouse drag (#20300) 2022-09-24 22:28:41 +08:00
dfc6c973a3 Merge pull request #20322 from zeertzjq/vim-9.0.0567
vim-patch:9.0.{0567,0572}: 'completeopt' "longest" is not used for complete()
2022-09-24 21:42:18 +08:00
0c77dba9a4 vim-patch:9.0.0572: insert complete tests leave a mapping behind
Problem:    Insert complete tests leave a mapping behind.
Solution:   Use a buffer-local mapping. (closes vim/vim#11211)
75f4bafabd
2022-09-24 21:17:03 +08:00
57b731818d vim-patch:9.0.0567: 'completeopt' "longest" is not used for complete()
Problem:    'completeopt' "longest" is not used for complete().
Solution:   Also use "longest" for complete(). (Bjorn Linse, closes vim/vim#11206)
87af60c915
2022-09-24 21:16:43 +08:00
291a649632 fix(mapset): remove existing abbreviation of same lhs (#20320) 2022-09-24 21:07:18 +08:00
db056de29a vim-patch:9.0.0568: autocmd code is indented more than needed (#20318)
Problem:    Autocmd code is indented more than needed.
Solution:   Break out sooner. (Yegappan Lakshmanan, closes vim/vim#11208)
            Also in user function code.
e9dcf13a30
2022-09-24 19:20:03 +08:00
f8b656c582 vim-patch:9.0.0566: Nim files are not recognized (#20317)
Problem:    Nim files are not recognized.
Solution:   Add patterns for Nim files. (Nbiba Bedis, closes vim/vim#11205)
9fd1583c83
2022-09-24 12:59:37 +02:00
caf5738fa9 fix(lsp): create missing directory before creating file (#19835)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-09-24 12:46:21 +02:00
24b5449b3d vim-patch:9.0.0562: HSL playlist files are not recognized (#20307)
Problem:    HSL playlist files are not recognized.
Solution:   Add a pattern to recognize HSL palylist files. (Benoît Ryder,
            closes vim/vim#11204)
35fdd9a67d
2022-09-24 10:16:30 +02:00
14610332b2 fix(lsp): use correct function name in deprecated message (#20308)
fix: use correct function name in deprecated message
2022-09-23 19:20:56 -06:00
f3c842058e vim-patch:9.0.0559: timer test may get stuck at hit-enter prompt (#20312)
Problem:    Timer test may get stuck at hit-enter prompt.
Solution:   Feed some more characters.
4ecf16bbf9
2022-09-24 08:10:49 +08:00
ede66a0b85 fix: cleanup contrib/ #20304
- YouCompleteMe is unnecessary since Nvim LSP works well.
- vim-addon-local-vimrc is not needed since we added `.editorconfig`.
- Inline flake8 arguments. Eventually we will remove all python code,
  don't need a top-level `.flake8` file meanwhile.
2022-09-23 09:02:16 -07:00
3fe43917cb ci: remove contrib/doxygen/ #20303
Problem:
- The layout of the doxygen HTML "dev docs" has been broken for 1+ years.
- There is no evidence that anyone uses the doxygen HTML.
- In the meantime since we introduced the doxygen HTML pages, the Nvim
  C docstrings have been surfaced in other ways:
  - Nvim LSP client
  - Generated :help docs like ":help api" and ":help ui".

Solution:
- Remove `contrib/doxygen/` from neovim repo.
  - Note: keep `src/Doxyfile`, it is used by `scripts/gen_vimdoc.py`. ☠️
- Remove `doc/dev/` from website. https://github.com/neovim/neovim.github.io/pull/291
- Remove doxygen job from the neovim/doc repo. https://github.com/neovim/doc/pull/28
- Future/ongoing: ":help dev" and other :help docs will continue to be
  improved as the "source of truth" for developer-related docs.

ref https://github.com/neovim/neovim/pull/824
2022-09-23 08:36:36 -07:00
600136cfb6 revert: "build: remove unnecessary policy related code" #20289
This partially reverts commit 42aeb5c5b1.

Setting cmake policies is normally not required as
cmake_minimum_required automatically sets these. One exception is cmake
script mode (-P) since it automatically resets all policy changes.

Closes: https://github.com/neovim/neovim/issues/20286
2022-09-23 07:16:17 -07:00
fcd3e53720 ci(cirrus): set clone depth to 2 instead of 1 (#20295)
Setting CIRRUS_CLONE_DEPTH to 1 occasionally results in "Failed to checkout"
error for unknown reasons. Set it to 2 as a workaround.
2022-09-23 12:57:18 +02:00
7a70e9587c test(tabpage_spec): actually test for nvim_win_hide 2022-09-23 10:17:44 +08:00
9aead1f670 Merge pull request #20299 from zeertzjq/vim-9.0.0550
vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
2022-09-23 08:02:12 +08:00
d7052e8e1f test: add tests for #13549 #20285 #20290 2022-09-23 07:38:22 +08:00
c28f00b101 vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
Problem:    Crash when closing a tabpage and buffer is NULL.
Solution:   Adjust how autocommands are triggered when closing a window.
            (closes vim/vim#11198, closes vim/vim#11197)
62de54b48d
2022-09-23 07:38:22 +08:00
0760379b41 ci(stylua): change action version to v1 (#20273)
Changing the action version to v1 allows us to automatically get patch
updates as it points to the latest stable version.
2022-09-22 20:19:38 +02:00
a867aa45f7 Merge #11967 generate :help HTML with treesitter 2022-09-22 10:03:38 -04:00
09b64d75bd feat(docs): gen_help_html.lua
Problem:
The :help docs HTML generated is driven by an old awk script
`runtime/doc/makehtml.awk` that is hard to maintain (ad hoc parser and
no one has touched it in decades) and has bugs like:
- https://github.com/neovim/neovim.github.io/issues/96
- https://github.com/neovim/neovim.github.io/issues/97

Solution:
Use Lua + treesitter (https://github.com/vigoux/tree-sitter-vimdoc) to
generate :help docs HTML.  Also validates tag links.

fix https://github.com/neovim/neovim.github.io/issues/96
fix https://github.com/neovim/neovim.github.io/issues/97

TODO:
- delete doc_html build task
- delete runtime/doc/Makefile
- delete makehtml.awk
- delete maketags.awk

OUTPUT:

    $ nvim -V1 -es --clean +"lua require('scripts.gen_help_html')"
    output dir: /…/neovim.github.io/_site/doc/
    generated (207  errors): api.txt         => api.html
    generated (122  errors): arabic.txt      => arabic.html
    generated (285  errors): autocmd.txt     => autocmd.html
    generated (641  errors): builtin.txt     => builtin.html
    generated (623  errors): change.txt      => change.html
    generated (65   errors): channel.txt     => channel.html
    generated (353  errors): cmdline.txt     => cmdline.html
    generated (3    errors): debug.txt       => debug.html
    generated (28   errors): deprecated.txt  => deprecated.html
    generated (193  errors): dev_style.txt   => dev_style.html
    generated (460  errors): develop.txt     => develop.html
    generated (19   errors): diagnostic.txt  => diagnostic.html
    generated (57   errors): diff.txt        => diff.html
    generated (818  errors): digraph.txt     => digraph.html
    generated (330  errors): editing.txt     => editing.html
    generated (368  errors): eval.txt        => eval.html
    generated (184  errors): fold.txt        => fold.html
    generated (61   errors): ft_ada.txt      => ft_ada.html
    generated (0    errors): ft_ps1.txt      => ft_ps1.html
    generated (20   errors): ft_raku.txt     => ft_raku.html
    generated (5    errors): ft_rust.txt     => ft_rust.html
    generated (41   errors): ft_sql.txt      => ft_sql.html
    generated (110  errors): gui.txt         => gui.html
    generated (79   errors): hebrew.txt      => hebrew.html
    generated (17   errors): help.txt        => index.html
    generated (104  errors): helphelp.txt    => helphelp.html
    generated (0    errors): if_cscop.txt    => if_cscop.html
    generated (23   errors): if_perl.txt     => if_perl.html
    generated (16   errors): if_pyth.txt     => if_pyth.html
    generated (9    errors): if_ruby.txt     => if_ruby.html
    generated (216  errors): indent.txt      => indent.html
    generated (634  errors): index.txt       => vimindex.html
    generated (320  errors): insert.txt      => insert.html
    generated (265  errors): intro.txt       => intro.html
    generated (9    errors): job_control.txt => job_control.html
    generated (0    errors): lsp-extension.txt => lsp-extension.html
    generated (214  errors): lsp.txt         => lsp.html
    generated (311  errors): lua.txt         => lua.html
    generated (592  errors): luaref.txt      => luaref.html
    generated (798  errors): luvref.txt      => luvref.html
    generated (663  errors): map.txt         => map.html
    generated (228  errors): mbyte.txt       => mbyte.html
    generated (228  errors): message.txt     => message.html
    generated (0    errors): mlang.txt       => mlang.html
    generated (761  errors): motion.txt      => motion.html
    generated (4    errors): nvim.txt        => nvim.html
    generated (226  errors): nvim_terminal_emulator.txt => nvim_terminal_emulator.html
    generated (988  errors): options.txt     => options.html
    generated (567  errors): pattern.txt     => pattern.html
    generated (15   errors): pi_gzip.txt     => pi_gzip.html
    generated (10   errors): pi_health.txt   => pi_health.html
    generated (27   errors): pi_msgpack.txt  => pi_msgpack.html
    generated (2177 errors): pi_netrw.txt    => pi_netrw.html
    generated (41   errors): pi_paren.txt    => pi_paren.html
    generated (9    errors): pi_spec.txt     => pi_spec.html
    generated (218  errors): pi_tar.txt      => pi_tar.html
    generated (0    errors): pi_tutor.txt    => pi_tutor.html
    generated (235  errors): pi_zip.txt      => pi_zip.html
    generated (265  errors): print.txt       => print.html
    generated (31   errors): provider.txt    => provider.html
    generated (335  errors): quickfix.txt    => quickfix.html
    generated (572  errors): quickref.txt    => quickref.html
    generated (109  errors): recover.txt     => recover.html
    generated (14   errors): remote.txt      => remote.html
    generated (14   errors): remote_plugin.txt => remote_plugin.html
    generated (351  errors): repeat.txt      => repeat.html
    generated (23   errors): rileft.txt      => rileft.html
    generated (12   errors): russian.txt     => russian.html
    generated (6    errors): scroll.txt      => scroll.html
    generated (106  errors): sign.txt        => sign.html
    generated (347  errors): spell.txt       => spell.html
    generated (784  errors): starting.txt    => starting.html
    generated (1499 errors): syntax.txt      => syntax.html
    generated (23   errors): tabpage.txt     => tabpage.html
    generated (257  errors): tagsrch.txt     => tagsrch.html
    generated (31   errors): term.txt        => term.html
    generated (0    errors): testing.txt     => testing.html
    generated (96   errors): tips.txt        => tips.html
    generated (57   errors): treesitter.txt  => treesitter.html
    generated (71   errors): uganda.txt      => uganda.html
    generated (74   errors): ui.txt          => ui.html
    generated (87   errors): undo.txt        => undo.html
    generated (17   errors): userfunc.txt    => userfunc.html
    generated (1    errors): usr_01.txt      => usr_01.html
    generated (89   errors): usr_02.txt      => usr_02.html
    generated (293  errors): usr_03.txt      => usr_03.html
    generated (46   errors): usr_04.txt      => usr_04.html
    generated (96   errors): usr_05.txt      => usr_05.html
    generated (54   errors): usr_06.txt      => usr_06.html
    generated (20   errors): usr_07.txt      => usr_07.html
    generated (241  errors): usr_08.txt      => usr_08.html
    generated (130  errors): usr_09.txt      => usr_09.html
    generated (50   errors): usr_10.txt      => usr_10.html
    generated (33   errors): usr_11.txt      => usr_11.html
    generated (32   errors): usr_12.txt      => usr_12.html
    generated (22   errors): usr_20.txt      => usr_20.html
    generated (75   errors): usr_21.txt      => usr_21.html
    generated (8    errors): usr_22.txt      => usr_22.html
    generated (3    errors): usr_23.txt      => usr_23.html
    generated (163  errors): usr_25.txt      => usr_25.html
    generated (13   errors): usr_26.txt      => usr_26.html
    generated (84   errors): usr_27.txt      => usr_27.html
    generated (173  errors): usr_28.txt      => usr_28.html
    generated (285  errors): usr_29.txt      => usr_29.html
    generated (280  errors): usr_30.txt      => usr_30.html
    generated (11   errors): usr_31.txt      => usr_31.html
    generated (13   errors): usr_32.txt      => usr_32.html
    generated (156  errors): usr_40.txt      => usr_40.html
    generated (134  errors): usr_41.txt      => usr_41.html
    generated (35   errors): usr_42.txt      => usr_42.html
    generated (19   errors): usr_43.txt      => usr_43.html
    generated (60   errors): usr_44.txt      => usr_44.html
    generated (13   errors): usr_45.txt      => usr_45.html
    generated (1    errors): usr_toc.txt     => usr_toc.html
    generated (69   errors): various.txt     => various.html
    generated (68   errors): vi_diff.txt     => vi_diff.html
    generated (437  errors): vim_diff.txt    => vim_diff.html
    generated (296  errors): visual.txt      => visual.html
    generated (181  errors): windows.txt     => windows.html
    generated 119 html pages
    total errors: 23862
    invalid tags: 537
2022-09-22 15:36:27 +02:00
40f0851bd8 docs: deprecate :checkhealth vimscript interface 2022-09-22 15:36:27 +02:00
bde6176c91 feat(treesitter): bundle :help parser and queries
parser from https://github.com/vigoux/tree-sitter-vimdoc
queries from nvim-treesitter
2022-09-22 15:36:27 +02:00
11f91ac304 Merge pull request #20287 from zeertzjq/vim-9.0.0540
vim-patch:9.0.{0540,0544}: assigning stack variable to argument confuses Coverity
2022-09-22 21:34:46 +08:00
5c1b8d7bf8 docs(lua): correct docs for option accessor metatables (#20256) 2022-09-22 14:17:49 +01:00
4371886293 vim-patch:9.0.0544: minor issues with setting a string option
Problem:    Minor issues with setting a string option.
Solution:   Adjust the code, add a test. (closes vim/vim#11192)
fcba86c031
2022-09-22 21:09:31 +08:00
33f1471472 vim-patch:9.0.0540: assigning stack variable to argument confuses Coverity
Problem:    Assigning stack variable to argument confuses Coverity.
Solution:   Use a local pointer, also makes the code simpler.
6f98114e4a
2022-09-22 21:07:54 +08:00
679f3072f6 Merge pull request #20103 from lewis6991/refactor/vim_opt 2022-09-22 13:59:04 +01:00
2083c1771a fix(window): close floats first when closing buffer in other tab (#20284) 2022-09-22 20:25:34 +08:00
a7f6f0e2dd vim-patch:9.0.0539: long message test can be flaky (#20282)
Problem:    Long message test can be flaky.
Solution:   Wait for more prompt instead of ruler.
21d393a12b

Comment N/A lines out instead of deleting in buftype tests.
2022-09-22 20:18:06 +08:00
7fc5f6605f Merge pull request #20249 from bfredl/cmdmessage
fix(redraw): avoid unnecessary redraws and glitches with floats+messages
2022-09-22 11:09:33 +02:00
02f8ca59a8 fix(tests): indicate in test logs when nvim exit times out
When it happens it wastes 2 seconds which is NOT included in the
normal busted timing info. It is hard to correct this, but we
can at least print a warning when this happens.
2022-09-22 10:38:11 +02:00
93b30582db fix(redraw): make redrawdebug=nodelta handle all the cases
Before only win_line lines were considered. this applies nodelta
to all screen elements. Causes some failures, which might indeed
indicate excessive redraws.
2022-09-22 10:38:10 +02:00
00cfc1dceb fix(redraw): avoid unnecessary redraws and glitches with floats+messages
fixes #20106
fixes #20229
2022-09-22 10:36:23 +02:00
8d13b08a03 Merge pull request #20278 from zeertzjq/vim-8.2.3428
vim-patch:8.2.{3428,3567,3568,4074,4677}
2022-09-22 13:44:42 +08:00
477cf2a6b1 vim-patch:8.2.4677: the Athena GUI support is outdated
Problem:    The Athena GUI support is outdated.
Solution:   Remove the Athena GUI code.
0b962e5685
2022-09-22 13:23:58 +08:00
1bced9bf94 vim-patch:8.2.4074: going over the end of NameBuff
Problem:    Going over the end of NameBuff.
Solution:   Check length when appending a space.
de05bb2573
2022-09-22 13:17:43 +08:00
a636e24280 vim-patch:8.2.3568: ctrl-hat test fails with Athena and Motif
Problem:    Ctrl-hat test fails with Athena and Motif. (Elimar Riesebieter)
Solution:   Run the test only with GTK. (Dominique Pellé, closes vim/vim#9069)
8753c1dd2c
2022-09-22 13:15:40 +08:00
320e56a4e0 vim-patch:8.2.3567: CTRL-I in Insert mode is not tested
Problem:    CTRL-I in Insert mode is not tested
Solution:   Add a test case. (Dominique Pellé, closes vim/vim#8866)
9cd063e319
2022-09-22 13:15:12 +08:00
3f4030e171 vim-patch:8.2.3428: using freed memory when replacing
Problem:    Using freed memory when replacing. (Dhiraj Mishra)
Solution:   Get the line pointer after calling ins_copychar().
35a9a00afc

This patch is N/A as it only applies to non-UTF-8 encoding.
2022-09-22 13:13:11 +08:00
d76017c613 Merge pull request #20276 from zeertzjq/vim-8.2.2979
vim-patch:8.2.{0712,2979,2994,3155}: options tests
2022-09-22 13:10:20 +08:00
800cda2164 vim-patch:8.2.3155: some option related code not covered by tests
Problem:    Some option related code not covered by tests.
Solution:   Add a few test cases. (Dominique Pellé, closes vim/vim#8552)
042414fa00
2022-09-22 12:40:26 +08:00
88099c1122 vim-patch:8.2.2994: various code is not fully tested
Problem:    Various code is not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8378)
2d6d718dde

Nvim does not support encoding=latin1 or compatible mode.
The two paste tests are applicable.
2022-09-22 12:40:26 +08:00
dd2b7586f3 vim-patch:8.2.2979: not all options code is covered by tests
Problem:    Not all options code is covered by tests.
Solution:   Add more tests for options. (Yegappan Lakshmanan, closes vim/vim#8369)
5958549760
2022-09-22 12:40:26 +08:00
5d1cb73e7f vim-patch:8.2.0712: various code not fully tested
Problem:    Various code not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6049)
0ff5dedf0f

Nvim does not support encoding=latin1 or setting keycodes/termcaps.
2022-09-22 12:40:26 +08:00
71e70d0c99 vim-patch:9.0.0537: the do_set() function is much too long (#20274)
Problem:    The do_set() function is much too long.
Solution:   Move setting of a string option to a separate function.
4740394f23

Cherry-pick some tests from Vim patch 8.2.0540.
2022-09-22 09:43:37 +08:00
b4b05f160d feat(filetype): expand environment variables in filetype patterns (#20145) 2022-09-21 15:58:57 -06:00
37a71d1f28 vim-patch:9.0.0018: going over the end of the typahead (#20269)
Problem:    Going over the end of the typahead.
Solution:   Put a NUL after the typeahead.
27efc62f5d

check_termcode() is N/A.
2022-09-21 11:06:39 +08:00
ad1f353fe1 vim-patch:9.0.0517: when at the command line :redrawstatus does not work well (#20266)
Problem:    When at the command line :redrawstatus does not work well.
Solution:   Only update the statuslines instead of the screen. (closes vim/vim#11180)
320d910064
2022-09-21 06:47:29 +08:00
585ab2564a refactor: suppress PVS false positives (#20264)
Some V512 warnings have changed to V1086, and PVS apparently does not
know `uv_run()` can change `*timeout_expired`.
2022-09-21 06:02:53 +08:00
ec94014cd1 fix(lsp): out of bounds error in lsp.util.apply_text_edits (#20137)
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2022-09-20 22:14:58 +02:00
62db91f06c Merge pull request #20263 from notomo/refactor-remove-unused
refactor(message): remove unused function
2022-09-20 16:38:31 +02:00
cfdc93e8ac vim-patch:9.0.0511: unnecessary scrolling for message of only one line (#20261)
Problem:    Unnecessary scrolling for message of only one line.
Solution:   Only set msg_scroll when needed. (closes vim/vim#11178)
bdedd2bcce
2022-09-20 21:58:39 +08:00
86c5d761c4 Merge pull request #20262 from zeertzjq/vim-9.0.0507
vim-patch:9.0.{0507,0512}: cmdline cleared when using :redrawstatus
2022-09-20 21:26:24 +08:00
b5a21ad8ff refactor(message): remove unused function 2022-09-20 13:07:48 +00:00
2e4532bea5 vim-patch:9.0.0512: cannot redraw the status lines when editing a command
Problem:    Cannot redraw the status lines when editing a command.
Solution:   Only postpone the redraw when messages have scrolled.
            (closes vim/vim#11170)
c14bfc31d9
2022-09-20 21:01:00 +08:00
9413f7544b vim-patch:9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Problem:    Command line cleared when using :redrawstatus in CmdlineChanged
            autocommand event.
Solution:   Postpone the redraw. (closes vim/vim#11162)
bcd6924245

Cherry-pick Test_redraw_in_autocmd() from Vim patch 8.2.4789.
2022-09-20 21:00:45 +08:00
ae30e388de vim-patch:9.0.0510: Chatito files are not recognized (#20260)
Problem:    Chatito files are not recognized.
Solution:   Add a pattern for Chatito files. (closes vim/vim#11174)
7c046ae99b
2022-09-20 14:10:00 +02:00
054c27075b vim-patch:9.0.0509: confusing error for "saveas" command with "nofile" buffer (#20258)
Problem:    Confusing error for "saveas" command with "nofile" buffer.
Solution:   Give a clearer error message. (closes vim/vim#11171)
500a1f9972
2022-09-20 19:49:00 +08:00
abe2d90693 feat(lua): move compat module from runtime to test (#20257) 2022-09-20 11:15:32 +01:00
e762158305 docs(lua): opts in vim.keymap.{set,del} can be optional (#20255) 2022-09-20 10:42:45 +01:00
10196f1b46 fix(lsp): support false result in handlers (#20252)
Closes https://github.com/neovim/neovim/issues/20111
2022-09-20 09:28:23 +02:00
a0e6e767a6 fix(tui): handle padding requirements for visual bell (#20238) 2022-09-20 11:47:04 +08:00
875b58e094 build: add basic cmake-presets integration (#19128)
This allows a more declarative way of defining targets which may be easier to those not familiar with cmake quirks.

Example usage:

# get a list of pre-configured presets
cmake --list-presets

# configure a preset
cmake . --preset=default

# build it
cmake --build --preset=default
2022-09-19 10:58:26 +02:00
7a091fdfaf ci(publish-winget): fix errors that prevents release (#20232) 2022-09-19 10:48:05 +02:00
7bd4c8e8ee fix(inccommand): avoid unnecessary redraw when not showing (#20244) 2022-09-19 12:37:25 +08:00
647da34bbd fix: assert failure when changing 'ut' while waiting for CursorHold (#20241) 2022-09-18 22:55:30 +08:00
67df3347fd vim-patch:9712ff1288f9 (#20240)
Update runtime files
9712ff1288
2022-09-18 15:20:20 +02:00
8dc61713d9 vim-patch:9.0.0497: LyRiCs files are not recognized (#20239)
Problem:    LyRiCs files are not recognized.
Solution:   Add a pattern to detect LyRiCs files. (closes vim/vim#11155)
65ee49decf
2022-09-18 14:16:24 +02:00
e63538f21c Merge pull request #20198 from zeertzjq/cursorhold
fix(events): make CursorHold behave as documented
2022-09-18 11:37:22 +02:00
6d557e324f vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
4f97475d32
2022-09-18 09:17:15 +08:00
644a3f48b1 fix(events): make CursorHold behave as documented 2022-09-17 21:48:44 +08:00
3c3f3e7353 test(remote_spec): reduce flakiness in waiting for client exit (#20230)
It is less likely for client to exit between jobstart() and jobwait() if
they are invoked in the same RPC request instead of two separate ones.
2022-09-17 16:17:51 +08:00
18139a69bc vim-patch:8.2.0690: line number of option set by modeline is wrong (#20228)
Problem:    Line number of option set by modeline is wrong.
Solution:   Do not double the line number. (Ozaki Kiichi, closes vim/vim#6035)
5125874951
2022-09-17 15:39:04 +08:00
72e1041429 vim-patch:9.0.0483: illegal memory access when replacing in virtualedit mode (#20225)
Problem:    Illegal memory access when replacing in virtualedit mode.
Solution:   Check for replacing NUL after Tab.
c249913edc

Cherry-pick Test_virtualedit_mouse() from patch 9.0.0177.
2022-09-17 10:20:06 +08:00
26b54d5c16 test(old): add a function roughly equivalent to test_setmouse() (#20224)
Mouse movement events usually have no effect, so passing "move" to
nvim_input_mouse() works in most cases.
2022-09-17 09:40:19 +08:00
c126c1f73a ci(release-winget): publish nightly winget prerelease #20209 2022-09-16 15:33:06 -07:00
6cc03b9c90 build(deps): bump libvterm to v0.3 (#20222) 2022-09-16 19:30:04 +02:00
e512d3ecf2 vim-patch:9.0.0479: in :def function all closures in loop get the sam… (#20220)
vim-patch:9.0.0479: in :def function all closures in loop get the same variables

Problem:    In a :def function all closures in a loop get the same variables.
Solution:   Use a separate list of variables for LOADOUTER and SAVEOUTER.
1aea184a0d

(note: patch description is wrong)
2022-09-16 17:52:08 +02:00
6b2f0f43b5 fix(eval)!: make Lua Funcref work as method and in substitute() (#20217)
BREAKING CHANGE: When using a Funcref converted from a Lua function as
a method in Vim script, the result of the base expression is now passed
as the first argument instead of being ignored.

vim-patch:8.2.5117: crash when calling a Lua callback from a :def function

Problem:    Crash when calling a Lua callback from a :def function. (Bohdan
            Makohin)
Solution:   Handle FC_CFUNC in call_user_func_check(). (closes vim/vim#10587)
7d149f899d
2022-09-16 23:09:26 +08:00
a0642ec75e feat(tui): support undercurl when Konsole version >= 221170 (#20219)
Support was added in 76f879cd70
2022-09-16 22:40:04 +08:00
622968d7b3 vim-patch:9.0.0476: varargs does not work for replacement function of substitute() (#20216)
Problem:    Varargs does not work for replacement function of substitute().
Solution:   Check the varargs flag of the function. (closes vim/vim#11142)
48db5dafec
2022-09-16 19:40:52 +08:00
3dda52d860 vim-patch:8.2.3796: the funcexe_T struct members are not named consistently (#20214)
Problem:    The funcexe_T struct members are not named consistently.
Solution:   Prefix "fe_" to all the members.
851f86b951

Omit fe_check_type: always NULL in legacy Vim script.
2022-09-16 17:31:42 +08:00
754822a066 fix(lua): free vim.ui_attach callback before lua close (#20205) 2022-09-16 11:06:37 +02:00
0c0071548b Merge pull request #20213 from bfredl/redisplay
fix(messages): do not crash on cmdheight=0 and g< redisplay
2022-09-16 11:04:04 +02:00
b98de0e0e5 vim-patch:8.2.0067: ERROR_UNKNOWN clashes on some systems (#20212)
Problem:    ERROR_UNKNOWN clashes on some systems.
Solution:   Rename ERROR_ to FCERR_. (Ola Söder, closes vim/vim#5415)
ef140544f6

Remove ERROR_BOTH which was removed from Vim in patch 7.4.1582.
2022-09-16 16:37:37 +08:00
b616458af9 fix(messages): do not crash on cmdheight=0 and g< redisplay
fixes #20153
2022-09-16 10:33:12 +02:00
0b7a3c173c Merge pull request #20188 from bfredl/zerocmdline
feat(ui): use msg_grid based implementation for cmdheight=0
2022-09-16 10:07:50 +02:00
279c7b11fb build(deps): bump tree-sitter-lua to v0.0.13 (#20210) 2022-09-16 09:26:37 +02:00
0f93aa12fd docs(autocmds): re-add buffer param to docstring (#20204) 2022-09-16 09:18:42 +02:00
9ec4b20be6 fix(treesitter): return full metadata for get_captures_at_position (#20203)
fix(treesitter): get_captures_at_position returns metadata

Return the full `metadata` table for the capture instead of just the
priority.

Further cleanup of related docs.
2022-09-16 09:05:05 +02:00
982fef6018 fix(diagnostic): populate data key in DiagnosticChanged autocmd in reset (#20207)
Follow up to #20173.
2022-09-15 11:03:07 -06:00
708bd68651 feat(ui): use msg_grid based implementation for cmdheight=0 2022-09-15 12:13:43 +02:00
89b9eab638 test(old): remove OpenBSD skip (#20201) 2022-09-15 11:36:13 +08:00
bf6de51f55 fix(help): add --clean to -h (#20171)
update man file to match
2022-09-14 11:11:17 +02:00
ddb762f401 docs(treesitter): clean up and update treesitter.txt (#20142)
* add type annotations to code
* clean up and expand static documentation
* consistent use of tags for static and generated docs
2022-09-14 11:08:31 +02:00
8b0b0a5c32 Merge pull request #18705 from dundargoc/fix/require-missing-module-in-autocmd
fix: assertion failure when requiring missing module in autocmd
2022-09-14 10:55:25 +02:00
bd4eca1146 refactor: move definitions from typval.h to typval_defs.h (#20194)
Taken from #20187.
2022-09-14 13:01:39 +08:00
1e5daed676 Merge pull request #20164 from bfredl/luanull
fix(lua): make vim.str_utfindex and vim.str_byteindex handle NUL bytes
2022-09-13 23:17:11 +02:00
25e4af439f fix(lua): make vim.str_utfindex and vim.str_byteindex handle NUL bytes
fixes #16290
2022-09-13 22:50:22 +02:00
a8c9e721d9 feat(fs): extend fs.find to accept predicate (#20193)
Makes it possible to use `vim.fs.find` to find files where only a
substring is known.
This is useful for `vim.lsp.start` to get the `root_dir` for languages
where the project-file is only known by its extension, not by the full
name.
For example in .NET projects there is usually a `<projectname>.csproj`
file in the project root.

Example:

    vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true })
2022-09-13 14:16:20 -06:00
1970d2ac43 feat(diagnostic): pass diagnostics as data to DiagnosticChanged autocmd (#20173) 2022-09-13 08:33:39 -06:00
f19e91acd8 vim-patch:9.0.0457: substitute prompt does not highlight an empty match (#20186)
Problem:    Substitute prompt does not highlight an empty match.
Solution:   Highlight at least one character.
a04f457a6c
2022-09-13 22:08:01 +08:00
ec1f153ddc vim-patch:9.0.0456: function called at debug prompt is also debugged (#20185)
Problem:    Function called at debug prompt is also debugged.
Solution:   Reset the debug level while entering the debug command.
            (closes vim/vim#11118)
b1842de5ca
2022-09-13 21:02:11 +08:00
37e9688802 Merge pull request #20011 from lewis6991/refactor/memline
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-13 11:56:18 +01:00
8eabbacf22 refactor(memline): resolve clint errors
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-13 10:35:52 +01:00
907fc8ac37 vim-patch:9.0.0449: there is no easy way to translate a key code into a string (#20168)
Problem:    There is no easy way to translate a string with a key code into a
            readable string.
Solution:   Add the keytrans() function. (closes vim/vim#11114)
cdc839353f

vim-patch:7b2d87220c6c

Add missing part of patch
7b2d87220c
2022-09-13 06:23:33 +08:00
91a150d0a9 test(lsp): call clear() before bufwipe test (#20170)
Otherwise this test cannot be run alone, and fails frequently on CI.
2022-09-13 06:01:35 +08:00
f6232e160b Merge pull request #20077 from dundargoc/refactor/char_u/11
refactor: replace char_u with char 11: remove `STRLEN` part 1
2022-09-12 21:50:31 +02:00
fd70e2bff2 Merge pull request #20141 from vigoux/ts-self-inherits
fix(treesitter): prevent endless loop on self-inheritence

docs(treesitter): suggest using extends to extend queries
2022-09-12 17:35:49 +02:00
a3272cf452 docs(treesitter): suggest using extends to extend queries 2022-09-12 17:14:27 +02:00
5bc0964b97 vim-patch:9.0.0299: error messages for setcmdline() could be better (#20169)
Problem:    Error messages for setcmdline() could be better.
Solution:   Use more specific error messages. (Yegappan Lakshmanan,
            closes vim/vim#10995)
25f1e55562

Cherry-pick tv_check_for_opt_number_arg() from Vim.
2022-09-12 21:47:35 +08:00
afe01842ef vim-patch:9.0.0448: SubRip files are not recognized (#20167)
Problem:    SubRip files are not recognized.
Solution:   Add a pattern for SubRip. (closes vim/vim#11113)
5a4eb55122
2022-09-12 15:12:39 +02:00
add27f2898 Merge pull request #20091 from teto/fix-flake 2022-09-12 14:07:44 +02:00
a48e42a29d vim-patch:8.2.4671: 'wildignorecase' is sometimes not used for glob() (#20165)
Problem:    'wildignorecase' is sometimes not used for glob().
Solution:   Also use 'wildignorecase' when there are no wildcards.
            (closes vim/vim#10066, closes vim/vim#8350)
a3157a476b
2022-09-12 19:09:23 +08:00
2ea6584a1b Merge pull request #20163 from zeertzjq/vim-8.2.5034
vim-patch:8.2.5034: there is no way to get the byte index from a virtual column
2022-09-12 18:10:13 +08:00
245ac6f263 vim-patch:8.2.5034: there is no way to get the byte index from a virtual column
Problem:    There is no way to get the byte index from a virtual column.
Solution:   Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477,
            closes vim/vim#10098)
5a6ec10cc8

Cherry-pick tv_check_for_number_arg() from Vim.
Cherry-pick pathshorten() doc change.
2022-09-12 17:28:07 +08:00
4448fa88ec refactor: move f_screenpos() to move.c 2022-09-12 17:20:21 +08:00
738c204523 Merge pull request #20160 from zeertzjq/vim-8.2.2646
vim-patch:8.2.{2646,2664}: string argument type check
2022-09-12 15:29:39 +08:00
49aa9e17fa vim-patch:8.2.2664: Vim9: not enough function arguments checked for string
Problem:    Vim9: not enough function arguments checked for string.
Solution:   Check in balloon functions.  Refactor function arguments.
32105ae88f

Cherry-pick removal of useless check from patch 8.2.3840.

vim-patch:8.2.3083: crash when passing null string to charclass()

Problem:    Crash when passing null string to charclass().
Solution:   Bail out when string pointer is NULL. (Christian Brabandt,
            closes vim/vim#8498, closes vim/vim#8260)
72463f883c
2022-09-12 14:56:49 +08:00
38059b4f31 vim-patch:8.2.2646: Vim9: error for not using string doesn't mention argument
Problem:    Vim9: error for not using string doesn't mention argument.
Solution:   Add argument number.
f28f2ac425
2022-09-12 14:56:42 +08:00
f98cff9575 vim-patch:9.0.0443: blueprint files are not recognized (#20155)
Problem:    Blueprint files are not recognized.
Solution:   Add a pattern for blueprint files. (Gabriele Musco, closes vim/vim#11107)
cce82a55b8
2022-09-11 16:07:54 +02:00
3ff46544c9 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-11 13:28:59 +02:00
1939518eba fix(treesitter): prevent endless loop on self-inheritence
Fixes #20139
2022-09-11 08:16:50 +02:00
9b4cab0126 fix(lsp): schedule removal of client object (#20148)
The execution of the LspDetach autocommands in the LSP client's on_exit
function are scheduled on the event loop to avoid making API calls in a
fast context; however, this means that by the time the LspDetach
autocommands finally run the client object has already been deleted.

To address this, we also schedule the deletion of the client on the
event loop so that it is guaranteed to occur after all of the LspDetach
autocommands have fired.
2022-09-10 18:56:29 -06:00
91a2e7a571 vim-patch:71b6d3397649 (#20144)
Update runtime files
71b6d33976
2022-09-10 14:54:13 +02:00
2a1c65b330 build: ensure version generation always succeeds (#19515)
Add --always flag to `git describe` so version generation succeeds if
current directory is in a git repo. If not in git repo, fall back to a
default version in the format vx.y.z-dev
2022-09-10 14:37:11 +02:00
4638fcf4fb Merge pull request #20068 from dundargoc/refactor/char_u/10
refactor: replace char_u with char 10: remove `FNAMECMP`, `FNAMENCMP` and `STRLCAT`
2022-09-10 14:33:43 +02:00
40f9f479b7 vim-patch:9.0.0434: gitignore files are not recognized (#20143)
Problem:    gitignore files are not recognized.
Solution:   Add patterns for the gitignore filetype. (closes vim/vim#11102)
9ba2786f15
2022-09-10 13:30:54 +02:00
684bc749ef refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-10 11:17:40 +02:00
82d93429e7 ci: add more reviewers based on label (#17975) 2022-09-10 11:08:46 +02:00
48e060f648 Merge pull request #20132 from JartC0ding/master
docs: remove link that has been dead for 2 years by now
2022-09-09 20:30:33 -04:00
4c6bf386c5 docs: removed outdated coverage link
Coverage jobs have not been re-added since switching from Travis to GHA,
so the coverage information is severely outdated.
2022-09-09 20:03:53 -04:00
2f385d17a0 Merge pull request #20057 from dundargoc/refactor/char_u/9
refactor: replace char_u with char 9: remove `STRCMP`
2022-09-09 21:49:41 +02:00
c5322e752e refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-09 21:02:42 +02:00
9b0e1256e2 vim-patch:9.0.0427: Drupal theme files are not recognized (#20138)
Problem:    Drupal theme files are not recognized.
Solution:   Use php filetype for Drupl theme files.  Remove trailing spaces.
            (Rodrigo Aguilera, closes vim/vim#11096)
8995c4cd4e
2022-09-09 18:48:12 +02:00
ad2d6a624b vim-patch:9.0.0424: gitattributes files are not recognized (#20134)
Problem:    gitattributes files are not recognized.
Solution:   Add patterns to match gitattributes files. (closes vim/vim#11085)
7d56cfc861
2022-09-09 17:53:15 +02:00
038c711539 refactor(vim.opt): de-nest code 2022-09-09 12:38:15 +01:00
9272d20ea4 refactor(vim.opt): use local function syntax 2022-09-09 12:38:15 +01:00
ad972990ad refactor(vim.opt): optimize append/prepend/remove 2022-09-09 12:38:15 +01:00
b364bc2c34 refactor(vim.opt): dry up and tidy 2022-09-09 12:38:10 +01:00
925a811990 refactor(vim.opt): remove value_mutator() 2022-09-09 09:54:54 +01:00
7533ceec13 refactor(vim.opt): unify vim.bo/wo building 2022-09-09 09:54:53 +01:00
22a88c425e build(deps): bump Luv to 1.44.2-1 (#20128)
https://github.com/luvit/luv/releases/tag/1.44.2-1
2022-09-09 09:44:16 +02:00
2d6735d8ce ci: move BSD jobs from sourcehut to Cirrus CI #19616
dispatch.sr.ht is being deprecated, meaning that using sourcehut CI
won't be possible (see https://github.com/neovim/neovim/issues/19609).
Since Github Actions doesn't provide any BSD runners an external service
is required and Cirrus CI seems like a good replacement for sourcehut.

Initially experimented with using FreeBSD and OpenBSD virtual machines
in GitHub Actions, but Cirrus has been a much better fit with better
performance, logs and overall experience.

Failing tests are automatically skipped on FreeBSD regardless if it's on
CI or not. Ideally these tests should only be skipped in CI with the
help of `isCI` helper function. Unfortunately, the tests don't recognize
the environment variable CIRRUS_CI even if it's set manually. This
workaround is good enough for the time being, but we might want to only
skip tests when using the CI (or even better, fix the failing tests).

Closes: https://github.com/neovim/neovim/issues/19609
2022-09-08 15:12:42 -07:00
d6233cbcdc ci(labeler): add treesitter label for query changes (#20122) 2022-09-08 21:58:50 +02:00
79a9b00671 build(deps): bump tree-sitter-viml to 0.2.0 (#20121) 2022-09-08 19:46:40 +02:00
19a3b2c26e docs(lsp): update rpc.start stdio limitations (#20120) 2022-09-08 10:25:16 -07:00
164752b380 refactor(vim.opt): remove make_meta_accessor() 2022-09-08 17:24:17 +01:00
30ca6d23a9 fix(lsp): when buffer detach remove buffer from client attached buffers (#20081)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-09-08 17:09:32 +02:00
514a1679dc refactor(vim.opt): simplify get_option_metatype 2022-09-08 15:44:00 +01:00
b8de5ada80 refactor(vim.opt): replace _setup with lazy table 2022-09-08 15:42:17 +01:00
f21e2a51ba refactor(vim.opt): remove enums 2022-09-08 15:32:26 +01:00
bc88691dbd refactor(vim.opt): remove del arg 2022-09-08 15:32:26 +01:00
08602ec1ab vim-patch:9.0.0417: Jsonnet files are not recognized (#20119)
Problem:    Jsonnet files are not recognized.
Solution:   Add a pattern for Jsonnet files. (Cezary Drożak, closes vim/vim#11073,
            closes vim/vim#11081)
2a4c885d54
2022-09-08 16:06:00 +02:00
bb35422659 Merge pull request #19958 from dundargoc/build/cmake/cleanup
build: remove ARGS from add_custom_command
It's a command that doesn't do anything, kept only for compatibility
reasons.

build: remove unnecessary policy related code
Having cmake version 3.10 as the required minimum version ensures these
are set to new by default.

build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable
Instead use the recommended form CMAKE_C_COMPILER_ID MATCHES "GNU"

build: remove unnecessary build functions
These functions serve no purpose if they're only used as intermediary
functions that passes on arguments to ExternalProject_Add.
2022-09-08 14:51:27 +02:00
7ae74998f0 build: remove unnecessary build functions
These functions serve no purpose if they're only used as intermediary
functions that passes on arguments to ExternalProject_Add.
2022-09-08 14:15:13 +02:00
b9aafb85e6 build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable
Instead use the recommended form `CMAKE_C_COMPILER_ID MATCHES "GNU"`
2022-09-08 14:15:13 +02:00
42aeb5c5b1 build: remove unnecessary policy related code
Having cmake version 3.10 as the required minimum version ensures these
are set to new by default.
2022-09-08 14:15:13 +02:00
b635f7ed41 build: remove ARGS from add_custom_command
It's a command that doesn't do anything, kept only for compatibility
reasons.
2022-09-08 14:15:13 +02:00
11167ab6d5 feat(lsp): add range option to lsp.buf.format (#19998) 2022-09-08 11:33:04 +02:00
8c59d7e6a7 Merge pull request #20093 from neovim/upstream-ts-util
* feat(treesitter): upstream get_{node,captures} utility functions
* refactor(treesitter): get_{nodes,captures}_at_{position,cursor}
2022-09-08 11:23:26 +02:00
893b659e88 fix(treesitter): use the right loading order for base queries (#20117)
Use the first, not last, query for a language on runtimepath. Typically,
this implies that a user query will override a site plugin query, which 
will override a bundled runtime query.
2022-09-08 11:17:29 +02:00
0405594399 feat(treesitter)!: do not merge queries by default (#20105)
Problem: Treesitter queries for a given language in runtime were merged together, 
leading to errors if they targeted different parser versions (e.g., bundled viml queries 
and those shipped by nvim-treesitter).
Solution:  Runtime queries now work as follows:
* The last query in the rtp without `; extends` in the header will be used as the base query
* All queries (without a specific order) with `; extends` are concatenated with the base query

BREAKING CHANGE: queries need to be updated if they are meant to extend other queries
2022-09-08 09:47:36 +02:00
36faac6241 Merge pull request #20115 from glepnir/fix_doc
fix(docs): remove duplicate word
2022-09-08 08:43:20 +02:00
4af04df844 fix(docs): remove duplicate word 2022-09-08 14:33:17 +08:00
79afdae2f3 Merge pull request #20114 from zeertzjq/ts-docs
docs(treesitter): fix doxygen comment
2022-09-08 08:20:27 +02:00
99e6e0f221 docs(treesitter): fix doxygen 2022-09-08 12:54:41 +08:00
078e49b96a Merge pull request #20112 from zeertzjq/vim-9.0.0410
vim-patch:9.0.{0410,0412}: unused cts_lnum
2022-09-08 09:22:38 +08:00
06f9da547c vim-patch:9.0.0412: compiler warning for unused argument
Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
e5a420fb33
2022-09-08 08:54:14 +08:00
80a566b55f vim-patch:9.0.0410: struct member cts_lnum is unused
Problem:    Struct member cts_lnum is unused.
Solution:   Delete it.
d7633114af
2022-09-08 08:52:10 +08:00
e93f22f28a Merge pull request #20110 from ii14/vim-7c7e1e9b98d4
vim-patch:8.2.3702,9.0.0409
2022-09-08 08:47:01 +08:00
4a67f9d386 vim-patch:9.0.0409: #{g:x} was seen as a curly-braces expression
Problem:    #{g:x} was seen as a curly-braces expression.
Solution:   Do never see #{} as a curly-braces expression. (closes vim/vim#11075)
7c7e1e9b98
2022-09-08 08:17:30 +08:00
93a0c2dd63 vim-patch:8.2.3702: first key in dict is seen as curly expression and fails
Problem:    First key in dict is seen as curly expression and fails.
Solution:   Ignore failure of curly expression. (closes vim/vim#9247)
98cb90ef86
2022-09-08 08:15:55 +08:00
ead524656d vim-patch:9.0.0403: 'equalalways' may be off when 'laststatus' is zero (#20109)
Problem:    'equalalways' may be off when 'laststatus' is zero.
Solution:   call last_status() before win_equal(). (Luuk van Baal,
            closes https://github.com/vim/vim/pull/11070)
fd7e60a33d
2022-09-07 18:08:00 +02:00
4dc4cf3467 fix(options): mark winhighlight as list style (#19477)
Also add missing fcs, lcs and winhighlight to list of key-value options for `vim.opt`.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-09-07 17:59:27 +02:00
9d1d3a6707 vim-patch:9.0.0402: javascript module files are not recoginzed (#20108)
Problem:    Javascript module files are not recoginzed.
Solution:   Recognize "*.jsm" files as Javascript. (Brett Holman,
            closes vim/vim#11069)
bb6c4073e7
2022-09-07 15:55:39 +02:00
ff9d2b17fb Merge pull request #20100 from bfredl/luafunc
refactor(typval): change FC_CFUNC abstraction into FC_LUAREF
2022-09-07 09:08:05 +02:00
fd1595514b Use weak tables in tree-sitter code (#17117)
feat(treesitter): use weak tables when possible

Also add the defaulttable function to create a table whose values are created when a key is missing.
2022-09-07 08:39:56 +02:00
f32fd19f1e fix(diagnostic): remove buf from cache on BufWipeout (#20099)
Doing so on `BufDelete` has issues:
  - `BufDelete` is also fired for listed buffers that are made unlisted.
  - `BufDelete` is not fired for unlisted buffers that are deleted.

This means that diagnostics will be lost for a buffer that becomes unlisted.

It also means that if an entry exists for an unlisted buffer, deleting that
buffer later will not remove its entry from the cache (and you may see "Invalid
buffer id" errors when using diagnostic functions if it was wiped).

Instead, remove a buffer from the cache if it is wiped out.
This means simply `:bd`ing a buffer will not clear its diagnostics now.
2022-09-06 20:55:03 -06:00
db9b8b08e7 refactor(typval): change FC_CFUNC abstraction into FC_LUAREF
"cfuncs" was only ever used to wrap luarefs. As vim8script is
finished and will not be developed further, support for "cfuncs"
for other usecases are not planned. This abstraction was immediately
broken anyway in order to get luarefs out of userfuncs again.

Even if a new kind of userfunc needs to be invented in the future,
likely just extending the FC_... flag union directy, instead of
invoking unnecessary heap object and c function pointer indirection,
will be a more straightforward design pattern.
2022-09-07 00:52:58 +02:00
b17c5c3d9c Merge pull request #20102 from e-kwsm/treesitter-c99
build(treesitter): set CMAKE_C_STANDARD to C99
2022-09-07 00:49:08 +02:00
c77bb5a528 build(treesitter): set CMAKE_C_STANDARD to C99 2022-09-07 06:33:58 +09:00
694ac26946 Merge pull request #17329 from cryptomilk/asn-vterm-0-2
build(deps): bump libvterm to 0.3-RC1
2022-09-06 22:41:37 +02:00
b76e33b598 fix(terminal): adopt altscreen test for libvterm 0.2 changes
Due to a rewrite of the resize handling logic in libvterm, the behavior
changed. It's actually fixing a bug.

16b8574575
2022-09-06 21:48:22 +02:00
9ecaa35f55 build(deps): use libvterm 0.3-rc1 2022-09-06 21:48:14 +02:00
2aeb8d976f feat(term): add support for libvterm >= 0.2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2022-09-06 21:19:55 +02:00
74a8b5982a Merge pull request #20031 from dundargoc/refactor/char_u/8
refactor: replace char_u with char 8: remove `vim_strsave`
2022-09-06 20:38:26 +02:00
707edfc9e6 fix(ts): do not clobber spelloptions (#20095) 2022-09-06 19:22:05 +01:00
aaa54a8b3e Merge pull request #20097 from clason/ts-syntax-off
fix(treesitter): don't support legacy syntax in start()
2022-09-06 19:57:07 +02:00
d01cadd82f fix(treesitter): don't support legacy syntax in start() 2022-09-06 17:33:44 +02:00
6e3a69b4cf build: consistently set build type regardless of generator or platform #19760
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.

This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.

The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run

cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run

cmake -B build
cmake --build build --config Release

Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.

Co-authored-by: dundargoc <gocundar@gmail.com>
2022-09-06 07:52:39 -07:00
73207cae61 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-06 16:44:37 +02:00
87e037e26c fix(cmdheight=0): various issues part3 #19816
And fixed in https://github.com/neovim/neovim/pull/19801 regression.

Fix #19834
Fix #19184
2022-09-06 07:33:25 -07:00
12afc344de refactor: migrate comment style 2 #20080 2022-09-06 07:23:00 -07:00
74db632c97 refactor(term): use const for title and add len to buf_set_term_title() 2022-09-06 13:23:50 +02:00
84d1094958 Merge pull request #19419 from vigoux/extmark_spell
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-09-06 11:23:01 +01:00
75adfefc85 feat(extmarks,ts,spell): full support for spelling
- Added 'spell' option to extmarks:

  Extmarks with this set will have the region spellchecked.

- Added 'noplainbuffer' option to 'spelloptions':

  This is used to tell Neovim not to spellcheck the buffer. The old
  behaviour was to spell check the whole buffer unless :syntax was set.

- Added spelling support to the treesitter highlighter:

  @spell captures in highlights.scm are used to define regions which
  should be spell checked.

- Added support for navigating spell errors for extmarks:

  Works for both ephemeral and static extmarks

- Added '_on_spell_nav' callback for decoration providers:

  Since ephemeral callbacks are only drawn for the visible screen,
  providers must implement this callback to instruct Neovim which
  regions in the buffer need can be spell checked.

  The callback takes a start position and an end position.

  Note: this callback is subject to change hence the _ prefix.

- Added spell captures for built-in support languages

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-09-06 10:14:11 +01:00
05893aea39 Merge pull request #20039 from zeertzjq/cmod-tab
fix(api)!: correctly deal with number before :tab
2022-09-06 10:32:23 +02:00
95fd1ad83e refactor(treesitter): get_{nodes,captures}_at_{position,cursor} 2022-09-06 10:15:23 +02:00
ffe98531b9 feat(treesitter): upstream get_node_at_cursor()
Util from the nvim-treesitter project.
2022-09-06 10:14:05 +02:00
5b8d6e0b32 Merge pull request #15391 from vigoux/ts-lua-builtin
feat(treesitter): highlighting for core languages, enabled for Lua
2022-09-06 10:10:01 +02:00
4bf005e9fd vim-patch:partial 0daafaa7d99e (#20083)
Update runtime files
0daafaa7d9

skip vim9script ftplugin
create userfunc.txt from Neovim content (skip section 3, needs 9.0.0379)
2022-09-06 08:57:53 +02:00
5b7213ad7f docs: update .mailmap (#20086)
Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2022-09-06 08:57:03 +02:00
0822896efc feat(treesitter): add vim.treesitter.start(), enable for Lua
* Add vim.treesitter.start() for starting treesitter highlighting via
  ftplugin or autocommand (can be extended later for fold, indent,
  matchpairs, ...)
* Add vim.treesitter.stop() for manually stopping treesitter
  highlighting
* Enable treesitter highlighting for Lua if
  `vim.g.ts_highlight_lua = true` is set in `init.lua`
2022-09-06 08:08:29 +02:00
97f38f0a9b fix(treesitter): do not link @error by default
The @error capture is used for tree-sitter's ERROR node, which indicates
a parsing error -- which can be quite frequent (and jarring) while typing.

Users can still manually `hi link @error Error` in their config.
2022-09-06 07:57:46 +02:00
64cc78c9f3 feat(treesitter): add injections 2022-09-06 07:57:46 +02:00
e85b8aa768 feat(treesitter): add viml parser and queries 2022-09-06 07:57:46 +02:00
6254b0fd3b ci(tests): don't skip parsers on functionaltest
Treesitter parsers are now a mandatory part of the installation and
should be tested on all platforms. Remove `pending_c_parser` helper.
2022-09-06 07:57:46 +02:00
905dd49fec feat(treesitter): bundle Lua parser and queries
parser from https://github.com/MunifTanjim/tree-sitter-lua
queries from nvim-treesitter
2022-09-06 07:57:46 +02:00
da34833fdf fix: assertion failure when requiring missing module in autocmd
Closes https://github.com/neovim/neovim/issues/15348
2022-09-05 19:11:25 +02:00
93f32bb0aa build(nix): removed the useless 'app'
the format changed depending on the nix version and it is useless
anyway.
2022-09-05 17:47:06 +02:00
fb39bba5a6 Merge pull request #20088 from zeertzjq/vim-9.0.0386
vim-patch:9.0.0386: some code blocks are nested too deep

N/A patches for version.c:

vim-patch:9.0.0385: GUI: when CTRL-D is mapped in Insert mode it gets inserted
2022-09-05 23:02:01 +08:00
f6a8d395a7 refactor(ex_cd): add an early return to fix clint warning
The popupmenu.c change is unrelated.
2022-09-05 22:36:09 +08:00
fc7a64291a vim-patch:9.0.0386: some code blocks are nested too deep
Problem:    Some code blocks are nested too deep.
Solution:   Bail out earlier. (Yegappan Lakshmanan, closes vim/vim#11058)
b1f471ee20
2022-09-05 22:36:09 +08:00
8570a700cc build(nix): bumped flake 2022-09-05 11:31:24 +02:00
29cd072351 build(flake): add sumneko lsp in PATH
and reformatted the file
2022-09-05 11:31:22 +02:00
a220650fd6 docs(contributing): fix broken link (#20044) 2022-09-05 08:44:52 +02:00
5ac6654334 Merge pull request #19481 from zeertzjq/vim-8.2.4674
Add 'mousemoveevent' as a UI option
2022-09-04 21:44:31 +08:00
82d128405a feat(pum): pretend 'mousemoveevent' is set when showing right-click menu 2022-09-04 21:18:23 +08:00
ceb09701f2 feat(api): add "move" to nvim_input_mouse 2022-09-04 21:18:23 +08:00
04bd700ac3 feat(tui): support 'mousemoveevent' 2022-09-04 21:18:22 +08:00
a5fe7940c8 feat(ui-ext): make 'mousemoveevent' a ui_option 2022-09-04 21:18:22 +08:00
00b49dd8dd vim-patch:8.2.4674: cannot force getting MouseMove events
Problem:    Cannot force getting MouseMove events.
Solution:   Add the 'mousemoveevent' option with implementaiton for the GUI.
            (Ernie Rael, closes vim/vim#10044)
c4cb544cd5

This only ports the docs and the option variable.
The following commits will actually implement it as a UI option.
2022-09-04 21:18:08 +08:00
900a774182 Merge pull request #20073 from zeertzjq/vim-088e8e344352
vim-patch:7.4.{1578,1624},088e8e344352
2022-09-04 20:41:01 +08:00
21dad0dcf3 vim-patch:088e8e344352
Update runtime files.
088e8e3443

Also cherry-pick "partial" tag from a later runtime update.
2022-09-04 18:39:55 +08:00
6f7d55d3d9 vim-patch:7.4.{1578,1624}
975b5271ee
03602ec28e
2022-09-04 18:39:55 +08:00
24fbda04b9 build(deps): bump tree-sitter-c to v0.20.2 (#20079) 2022-09-04 12:09:04 +02:00
ea10e0c104 ci: remove gpanders from api reviewers (#20074) 2022-09-03 21:49:45 -06:00
927d4d2a15 fix(filetype): run filetype.match on StdinReadPost (#20070)
Problem: filetype detection does not run on piped input
Solution: add `StdinReadPost` to main filetype.lua autocommand

Rationale: legacy filetype detection checked contents by sourcing
`scripts.vim` in separate autocommands, including on `StdinReadPost`.
For Lua filetype detection, this was moved into the main autocommand,
with bundled `scripts.vim` gated behind `g:do_legacy_filetype` (i.e.,
only user `scripts.vim` are sourced for compatibility by default). Adding
`StdinReadPost` to the main autocommand again runs content checks on
piped input without requiring code duplication and low-payoff
refactoring.
2022-09-03 19:27:57 +02:00
c50460cf3b feat(treesitter): include language in invalid query error (#14053) 2022-09-03 16:02:58 +02:00
ea611c7122 ci(clint): remove "Inner expression indentation should be 4" rule (#20047)
It completely breaks down in shada.c and is generally useless.
2022-09-03 12:00:00 +02:00
5296e9407d build(deps): bump tree-sitter to v0.20.7 (#20067) 2022-09-03 11:30:24 +02:00
1e3073bc35 docs: update .git-blame-ignore-revs (#20066) 2022-09-03 10:18:05 +01:00
042d5df956 Merge pull request #20063 from zeertzjq/vim-9.0.0360
vim-patch:8.2.1505,9.0.{0360,0362}
2022-09-03 09:39:13 +08:00
c62e5b5079 vim-patch:9.0.0362: expanding ":e %" does not work for remote files
Problem:    Expanding ":e %" does not work for remote files.
Solution:   If the "%" or "#" file does not exist add the expansion anyway.
f5724376ab
2022-09-03 09:01:09 +08:00
7243b1cbde vim-patch:9.0.0360: crash when invalid line number on :for is ignored
Problem:    Crash when invalid line number on :for is ignored.
Solution:   Do not check breakpoint for non-existing line.
35d21c6830

Test does not fail without the fix in Nvim as Nvim uses 0 when line
number overflows. If it is changed to MAXLNUM then the test does fail
without the fix, but using 0 seems better as E481 is still given.
2022-09-03 09:01:09 +08:00
05b49ef975 vim-patch:8.2.1505: not all file read and writecode is tested
Problem:    Not all file read and writecode is tested.
Solution:   Add a few tests. (Dominique Pellé, closes vim/vim#6764)
1b04ce2d40

Cherry-pick Test_glob() from patch 8.2.0634.
2022-09-03 09:01:08 +08:00
1ffd527c83 refactor: migrate comment style (#20012)
Done automatically using the following perl command:

  perl -pi -0777pe 's#\n\K */\*\n(.+?)\s*\*/\n#join("\n", map { $_ =~ s:^\s*\K \*://:; $_ } split("\n", $1)) . "\n"#sge' src/nvim/**/*.c

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 17:39:49 +01:00
69456f3414 Merge pull request #20026 from dundargoc/refactor/char_u/7
refactor: replace char_u with char 7: remove `vim_strnsave`
2022-09-02 17:06:00 +02:00
1ef7720567 fix(api)!: correctly deal with number before :tab
Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
2022-09-02 22:28:57 +08:00
2afcdbd63a feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
e085d0be31 Merge pull request #20055 from famiu/fix/ui-attach/memory-leak
fix(ui): ui compositor does not correctly free event callbacks
2022-09-02 15:07:39 +02:00
2dd55f81f7 fix(ui): ui compositor does not correctly free event callbacks
Prior to this PR, when freeing event callbacks, UI compositor did not
free the luarefs which could cause potential memory leaks. This PR fixes
that by freeing the luarefs properly.
2022-09-02 17:49:51 +06:00
ce80b8f50d vim-patch:9.0.0349: filetype of *.sil files not well detected (#20050)
Problem:    Filetype of *.sil files not well detected.
Solution:   Inspect the file contents to guess the filetype.
be807d5824
2022-09-02 08:16:17 +02:00
12fe197cff Merge pull request #20040 from zeertzjq/vim-9.0.0342
vim-patch:9.0.{0342,0346}: :horizontal modifier
2022-09-01 21:31:38 +08:00
689f5d604e feat(api): add support for :horizontal modifier 2022-09-01 20:53:43 +08:00
56bf026dea vim-patch:9.0.0346: :horizontal modifier not fully supported
Problem:    :horizontal modifier not fully supported.
Solution:   Also use :horizontal for completion and user commands.
            (closes vim/vim#11025)
d3de178e53
2022-09-01 20:28:23 +08:00
c65b1f3e15 vim-patch:9.0.0342: ":wincmd =" equalizes in two directions
Problem:    ":wincmd =" equalizes in two directions.
Solution:   Make ":vertical wincmd =" equalize vertically only and
            ":horizontal wincmd =" equalize horizontally only.
21c3a80a7f
2022-09-01 20:25:29 +08:00
49e893f296 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-09-01 10:47:42 +02:00
db2e5f46f5 fix(lua): make ui_attach()/ui_detach() take effect immediately (#20037) 2022-09-01 16:37:29 +08:00
48ca1d4ce8 Merge pull request #20022 from dundargoc/refactor/char_u/6
refactor: replace char_u with char 6
2022-09-01 10:25:27 +02:00
d9a873f278 Merge pull request #20038 from bfredl/unflush
perf(messages): don't call ui_flush() per message line in various places
2022-09-01 10:18:14 +02:00
5f92d9b345 perf(messages): don't call ui_flush() per message line in various places
When msgsep is used, message scrolling is emulated. To make message
output fast, inhibit emulated scrolling until the full message text
is known
2022-09-01 09:44:01 +02:00
dd8489c399 Merge pull request #20023 from bfredl/hlarena
refactor(highlight): make hlattrs2dict always use pre-allocated dict
2022-09-01 09:22:31 +02:00
a62cb406b1 fix(maparg): remove double allocation (#20033)
ASAN doesn't catch this, as it is referenced by the garbage collector.
Also remove a condition that is always true.
2022-09-01 10:22:28 +08:00
8740e0bd58 vim-patch:9.0.0343: ColorScheme autocommand triggered when colorscheme not found (#20032)
Problem:    ColorScheme autocommand triggered when colorscheme is not found.
            (Romain Lafourcade)
Solution:   Only trigger ColorScheme when loading the colorscheme succeeds.
            (closes vim/vim#11024)
5d09a401ec

Most of Test_colorscheme() is applicable to Nvim.
2022-09-01 09:12:20 +08:00
0c6b39894f feat(mapset): support restoring Lua callback (#20024)
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly

Problem:    mapset() does not restore <Nop> mapping properly.
Solution:   Use an empty string for <Nop>. (closes vim/vim#11022)
92a3d20682
2022-09-01 06:19:49 +08:00
c0050b71e5 Merge pull request #16396 from bfredl/luaevent
feat(lua): vim.ui_attach to get ui events from lua
2022-08-31 22:03:56 +02:00
bd51ac2a34 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 21:17:10 +02:00
ba8be7446d refactor(highlight): make hlattrs2dict always use pre-allocated dict
hlattrs2dict used to work with both allocated and unallocated
dicts which was quite messy. Now always delegate allocation to caller.
2022-08-31 21:15:04 +02:00
f078a3453a Merge pull request #20007 from dundargoc/refactor/char_u/5
refactor: replace char_u with char 5
2022-08-31 20:50:43 +02:00
f31db30975 feat(lua): vim.ui_attach to get ui events from lua
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-08-31 20:40:17 +02:00
933c80e8f9 refactor(mappings)!: mapblock_fill_dict() use API Dictionary (#20020)
This introduces the following breaking changes:
- nvim_get_keymap now always returns a LuaRef object as "callback" for a
  Lua mapping regardless of how it is called. The LuaRef object can be
  called from Lua and Vim script, but is lost over RPC.
- maparg() now returns a Funcref instead of a ref number as "callback"
  for a Lua mapping. The Funcref can be called from Lua and Vim script,
  but is lost over RPC.

This may also make nvim_get_keymap faster, but make maparg() slower.
2022-08-31 21:14:14 +08:00
fb1edb2f57 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-31 13:47:18 +02:00
fa747d004a fix(api): nvim_set_hl bail out on invalid group name (#20021) 2022-08-31 19:47:10 +08:00
0903702634 vim-patch:9b03d3e75b42 (#20013)
Update runtime files
9b03d3e75b
2022-08-31 08:08:51 +02:00
f4274d0f62 vim-patch:8.2.3102: test for crash fix does not fail without the fix (#20018)
Problem:    Test for crash fix does not fail without the fix.
Solution:   Adjust the test sequence. (closes vim/vim#8506)
3777d6e32b

Cherry-pick CheckUnix from patch 8.2.1432.
2022-08-31 09:41:00 +08:00
5ff2ea6687 vim-patch:8.2.0301: insufficient testing for exception handling (#20016)
Problem:    Insufficient testing for exception handling and the "attention"
            prompt.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5681)
b654103ad1

Fix memory leak from last char_u refactor.
2022-08-31 07:24:16 +08:00
518b5c65b0 vim-patch:8.1.2037: can call win_gotoid() in cmdline window (#20015)
Problem:    Can call win_gotoid() in cmdline window.
Solution:   Disallow switching windows. (Yasuhiro Matsumoto, closes vim/vim#4940)
a046b37c22
2022-08-31 06:58:28 +08:00
94a2bc5940 vim-patch:9.0.0332: overwrite check may block BufWriteCmd (#20014)
Problem:    Overwrite check may block BufWriteCmd.
Solution:   Do not use overwrite check when 'buftype' is "acwrite".
            (closes vim/vim#11011)
9c8f94636b
2022-08-31 06:27:39 +08:00
813476bf72 fix(exceptions): restore did_throw (#20000)
`!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false`
is sometimes used to defer exception handling for later (without forgetting the
exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred
to a different call (e.g: when `try_level > 0`).

In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of
`did_throw = false`, but also causes the pending exception to be lost, which
also leaks as `discard_exception()` wasn't used.

It may be possible to fix this by saving/restoring `current_exception`, but
handling all of `did_throw`'s edge cases seems messier. Maybe not worth
diverging over.

This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown
due to Windows missing `man`, but they're lost; skip these tests if `man` isn't
executable.
2022-08-30 23:13:52 +01:00
6b7eed1884 Vim 9.0.{0314,0319}: some filetypes are not recognized (#20005)
* vim-patch:9.0.0314: VDM files are not recognized

Problem:    VDM files are not recognized.
Solution:   Add patterns for VDM files. (Alessandro Pezzoni, closes vim/vim#11004)
bf26941f40

* vim-patch:9.0.0319: Godot shader files are not recognized

Problem:    Godot shader files are not recognized.
Solution:   Add patterns for "gdshader". (Maxim Kim, closes vim/vim#11006)
d5c8f11905
2022-08-30 21:16:03 +02:00
2828aae7b4 refactor: replace char_u with char 4 (#19987)
* refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2022-08-30 14:52:09 +02:00
9397e70b9e docs(lua): present vim.o as default and vim.opt as special-purpose #19982
Problem: People are confused about `vim.o` and `vim.opt`
Solution: Clarify that `vim.o` is the default interface, with `vim.opt`
          specifically meant for interacting with list-style options.
2022-08-30 05:46:38 -07:00
981ae83fad fix(docs): update lsp.rpc.start docs to match return value changes (#20003)
Follow up to https://github.com/neovim/neovim/pull/19916
2022-08-30 13:14:27 +02:00
0368ca70c4 docs(lsp): replace formatting_sync example in lsp-faq (#19994)
`formatting_sync` is deprecated
2022-08-30 13:14:09 +02:00
f9c183c0ca Merge pull request #19897 from bfredl/statushl
fix(highlight): set the window namespace when redrawing statusline
2022-08-30 10:59:58 +02:00
6ab2bf6819 fix(highlight): set the window namespace when redrawing statusline 2022-08-30 10:28:11 +02:00
568737d5b3 feat(tui): recognize sidescroll events (#19992)
Ref https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
This works in xterm and kitty.
CSI < 66 ; x ; y M sequence is for ScrollWheelLeft.
CSI < 67 ; x ; y M sequence is for ScrollWheelRight.
2022-08-30 10:55:00 +08:00
7f20d61e00 Merge pull request #19999 from zeertzjq/vim-9.0.0320
vim-patch:9.0.0320: command line type of CmdlineChange differs from getcmdtype()
2022-08-30 07:07:50 +08:00
e6e9879cb3 vim-patch:9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Problem:    Command line type of CmdlineChange differs from getcmdtype().
Solution:   Use the same type. (closes vim/vim#11005)
54acb90d9e
2022-08-30 06:33:09 +08:00
2c83d7b2dd refactor: move cmdline functions to ex_getln.c 2022-08-30 06:32:08 +08:00
f58a979599 vim-patch:9.0.0318: clearing screen causes flicker (#19993)
Problem:    Clearing screen causes flicker.
Solution:   Do not clear but redraw in more cases.  Add () to "wait_return".
13608d851a

Only 2 lines of actual code change.
2022-08-30 06:26:06 +08:00
e78e369a9d Merge pull request #19997 from bfredl/lastsep
fix(redraw): handle switching to a tabpage with larger p_ch value
2022-08-29 23:52:47 +02:00
8fd66ff5c5 fix(redraw): handle switching to a tabpage with larger p_ch value 2022-08-29 21:58:07 +02:00
efacb6e974 fix(lsp): clean the diagnostic cache when buffer delete (#19449)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-08-29 19:09:14 +02:00
68efac3683 Merge pull request #19973 from dundargoc/refactor/char_u/3
refactor: replace char_u with char 3: revenge of the unsigned
2022-08-29 18:46:38 +02:00
126fe7fbc9 Merge pull request #19916 from mfussenegger/lsp-tcp
Adds TCP support for lsp.
Usage example:

```
vim.lsp.start({ name = 'godot', cmd = vim.lsp.rpc.connect('127.0.0.1', 6008) })
```
2022-08-29 18:26:14 +02:00
58f30a326f refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-29 15:48:56 +02:00
92bc11a891 vim-patch:9.0.0316: screen flickers when 'cmdheight' is zero (#19991)
Problem:    Screen flickers when 'cmdheight' is zero.
Solution:   Redraw over existing text instead of clearing.
f73e5ba56f
2022-08-29 20:22:15 +08:00
e6af1cf250 Merge pull request #19971 from dundargoc/refactor/remove-casts
refactor: remove redundant casts
2022-08-29 13:23:43 +02:00
5fe6bde296 Merge pull request #19961 from dundargoc/refactor/char_u/2
refactor: replace char_u with char 2: electric chaaralo
2022-08-29 12:50:22 +02:00
f05cc672e3 Merge pull request #19975 from bfredl/chartabsize
refactor(plines): use a struct for chartabsize state
2022-08-29 12:48:51 +02:00
ea4e9c71cc refactor(plines): use a struct for chartabsize state
This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text

The logic for inline virtual text is going to be different in nvim than
text property based text in vim, but this refactor is still useful,
as calculation of displayed linesize is going to be stateful in a
similar way.
2022-08-29 12:05:34 +02:00
253f0ffd8d vim-patch:9.0.0285: it is not easy to change the command line from a plugin (#19979)
vim-patch:9.0.0285: it is not easy to change the command line from a plugin

Problem:    It is not easy to change the command line from a plugin.
Solution:   Add setcmdline(). (Shougo Matsushita, closes vim/vim#10869)
07ea5f1509
2022-08-29 13:11:52 +08:00
1dcaa75a65 fix(events): triggered WinScrolled when only skipcol changed (#19972)
fix(events): trigger WinScrolled when only skipcol changed

vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes

Problem:    WinScrolled is not triggered when only skipcol changes.
Solution:   Add w_last_skipcol and use it. (closes vim/vim#10998)
670ab0334b
2022-08-29 06:16:20 +08:00
b21980bd60 fix(keywordprg): default to :help if set to empty string (#19983) 2022-08-29 05:58:32 +08:00
60ec6e34d5 feat(lsp): add tcp support 2022-08-28 14:07:53 +02:00
46bb34e26b refactor(lsp): extract rpc client from rpc.start
Makes the previously inner functions re-usable for a TCP client
2022-08-28 14:07:53 +02:00
7d3e4aee6a refactor(lsp): encapsulate rpc uv handle
To prepare for different transports like TCP where the handle won't have
a kill method.
2022-08-28 14:07:53 +02:00
f9641d1ac6 refactor(lsp): factor out read_loop function 2022-08-28 14:07:53 +02:00
88c32b5eba fix(l10n): improve zh_CN and zh_TW translations (#19969) 2022-08-28 17:07:24 +08:00
7a9b593796 vim-patch:8.2.3813: confusing error when using :cc without error list (#19978)
Problem:    confusing error when using :cc without error list. (Gary Johnson)
Solution:   Give the "no errors" error.
a5d78d1f11

Cherry-pick e_quickfix -> e_no_errors rename from patch 8.2.3190.
2022-08-28 07:22:27 +08:00
691f4715c0 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-27 17:59:43 +02:00
20305494f8 refactor: remove redundant casts 2022-08-27 14:26:18 +02:00
09c6ce8c4e docs: fix typos (#19798)
Co-authored-by: adrian5 <adrian5@users.noreply.github.com>
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2022-08-27 15:56:58 +08:00
523600ea6c vim-patch:8.2.1269: language and locale code spread out (#19964)
Problem:    Language and locale code spread out.
Solution:   Move relevant code to src/locale.c. (Yegappan Lakshmanan,
            closes vim/vim#6509)
054f14bbe5

Also remove redundant <locale.h> includes.
2022-08-27 11:26:47 +08:00
814c173b9d vim-patch:8.2.0660: the search.c file is a bit big (#19963)
Problem:    The search.c file is a bit big.
Solution:   Split off the text object code to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#6007)
ed8ce057b7
2022-08-27 09:58:25 +08:00
58b29e344c Merge pull request #19962 from zeertzjq/vim-9.0.0278
vim-patch:9.0.{0278,0279,0283,0284}: cmdline completion patches
2022-08-27 07:33:29 +08:00
608134794d vim-patch:9.0.0284: using static buffer for multiple completion functions
Problem:    Using static buffer for multiple completion functions.
Solution:   Use one buffer in expand_T.
5ff595d9db
2022-08-27 07:03:07 +08:00
2676555b22 vim-patch:9.0.0283: cannot complete "syn list @cluster"
Problem:    Cannot complete "syn list @cluster".
Solution:   Recognize and handle "list @". (Björn Linse, closes vim/vim#10990)
af9a6002e0
2022-08-27 07:03:07 +08:00
cc2c8be481 vim-patch:9.0.0279: the tiny version has the popup menu but not 'wildmenu'
Problem:    The tiny version has the popup menu but not 'wildmenu'.
Solution:   Graduate the wildmenu feature.
5416232707

N/A patches for version.c:

vim-patch:9.0.0281: build failure without the +eval feature

Problem:    Build failure without the +eval feature.
Solution:   Add #ifdef.
58dcbf1c65
2022-08-27 07:03:07 +08:00
e70ef80f77 vim-patch:9.0.0278: the +wildignore feature is nearly always available
Problem:    The +wildignore feature is nearly always available.
Solution:   Graduate +wildignore for consistency.
074fbd4131
2022-08-27 07:03:06 +08:00
d5e0883712 Merge pull request #19955 from zeertzjq/vim-9.0.0272
vim-patch:9.0.{0272,0274,0275,0276}: buffer loading fixes
2022-08-27 06:32:41 +08:00
d813ef0097 vim-patch:9.0.0276: 'buftype' values not sufficiently tested
Problem:    'buftype' values not sufficiently tested.
Solution:   Add and extend tests with 'buftype' values. (closes vim/vim#10988)
93f72cc119

"terminal" and "popup" buffer types cannot be tested, and commenting
them out causes an error, so just remove them.
2022-08-27 06:12:52 +08:00
45c23a757c vim-patch:9.0.0275: BufEnter not triggered when using ":edit" in "nofile" buffer
Problem:    BufEnter not triggered when using ":edit" in "nofile" buffer.
Solution:   Let readfile() return NOTDONE. (closes vim/vim#10986)
a9b5b85068
2022-08-27 06:12:52 +08:00
52f00a6c4d vim-patch:9.0.0274: netrw plugin does not show remote files
Problem:    Netrw plugin does not show remote files.
Solution:   Do read a file when 'buftype' is "acwrite". (closes vim/vim#10983)
c312619f7c
2022-08-27 06:12:52 +08:00
900a151bf5 vim-patch:9.0.0272: BufReadCmd not triggered when loading a "nofile" buffer
Problem:    BufReadCmd not triggered when loading a "nofile" buffer. (Maxim
            Kim)
Solution:   Call readfile() but bail out before reading a file.
            (closes vim/vim#10983)
b1d2c8116c
2022-08-27 06:12:52 +08:00
b0e052a8b3 Merge pull request #19957 from dundargoc/refactor/char_u/1
refactor: replace char_u with char
2022-08-26 23:07:56 +02:00
3952770360 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-26 22:24:28 +02:00
6a13b8fa54 vim-patch:7dd543246a4c (#19960)
Update runtime files
7dd543246a
2022-08-26 19:58:10 +02:00
0b72e23bf1 vim-patch:8.2.0674: some source files are too big (#19959)
Problem:    Some source files are too big.
Solution:   Move text formatting functions to a new file. (Yegappan
            Lakshmanan, closes vim/vim#6021)
11abd09521

Cherry-pick set_can_cindent() from patch 8.1.2062.
Cherry-pick global old_indent from patch 8.2.2127.
2022-08-26 22:37:20 +08:00
2ecb4076df Merge pull request #19931 from bfredl/scopedhl
feat(highlight)!: use scoped @foo.bar.special groups for tree-sitter highlight
2022-08-26 14:43:58 +02:00
b04ef7f6b9 fix(treesitter): make it get_captures_at_position 2022-08-26 13:57:31 +02:00
064ecb9ec5 feat(treesitter): upstream get_hl_groups_at_position()
Util from the nvim-treesitter project.
2022-08-26 13:57:31 +02:00
030b422d1e feat(treesitter)!: use @foo.bar style highlight groups
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.

The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)

For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
2022-08-26 13:57:31 +02:00
914ba18a49 feat(highlight): support scoped @spam.eggs.baked_beans groups 2022-08-26 13:57:31 +02:00
6547f4397f vim-patch:8.1.2331: the option.c file is still very big (#19954)
Problem:    The option.c file is still very big.
Solution:   Move a few functions to where they fit better. (Yegappan
            Lakshmanan, closes vim/vim#4895)
7bae0b1bc8

vim-patch:9.0.0271: using INIT() in non-header files

Problem:    Using INIT() in non-header files.
Solution:   Remove INIT(). (closes vim/vim#10981)
9b7d2a9596
2022-08-26 18:49:29 +08:00
06d5c6332d Merge pull request #19947 from lewis6991/truefalse 2022-08-26 11:11:14 +01:00
2498e9feb0 refactor: change FALSE/TRUE to false/true
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-26 09:36:55 +01:00
946c0aa66f Merge pull request #19953 from zeertzjq/vim-9.0.0036
vim-patch:8.2.2524,9.0.(0036,0037,0038,0040}
2022-08-26 10:46:18 +08:00
36fdad5575 vim-patch:9.0.0040: use of set_chars_option() is confusing
Problem:    Use of set_chars_option() is confusing.
Solution:   Add "apply" argument to store the result or not.  Merge similar
            code.
b67f0c8e49
2022-08-26 10:15:02 +08:00
db28c2ca2b refactor: set_chars_option()
Rename "set" to "apply" and tidy up variable scopes.
2022-08-26 10:14:59 +08:00
752d397cae vim-patch:9.0.0038: 'listchars' test fails
Problem:    'listchars' test fails.
Solution:   Use window-local value after setting the global value
5ed26faace
2022-08-26 10:14:59 +08:00
fa1c761d62 vim-patch:9.0.0036: 'fillchars' cannot have window-local values
Problem:    'fillchars' cannot have window-local values.
Solution:   Make 'fillchars' global-local. (closes vim/vim#5206)
96ba25ac01

Cherry-pick g:run_nr from patch 8.2.0454.

N/A patches for version.c:

vim-patch:9.0.0037: build error

Problem:    Build error.
Solution:   Add missing change.
510f03738d
2022-08-26 10:14:59 +08:00
1ba3d5c712 vim-patch:8.2.2524: cannot change the characters displayed in the foldcolumn
Problem:    Cannot change the characters displayed in the foldcolumn.
Solution:   Add fields to 'fillchars'. (Yegappan Lakshmanan, Matthieu Coudron,
            closes vim/vim#7860)
3aca5a6fbc
2022-08-26 10:14:58 +08:00
c12f6002a1 Merge pull request #19950 from zeertzjq/vim-9.0.0270
vim-patch:9.0.{0262,0263,0266,0268,0270}: too many #ifdefs
2022-08-26 07:37:57 +08:00
207fe4810e vim-patch:9.0.0270: some values of 'path' and 'tags' invalid in the tiny version
Problem:    Some values of 'path' and 'tags' do not work in the tiny version.
Solution:   Graduate the +path_extra feature.
2bd9dbc19f
2022-08-26 07:00:52 +08:00
4dd34989cd vim-patch:9.0.0263: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Make some functions always available.
6d4b2f54df

N/A patches for version.c:

vim-patch:9.0.0262: build failure without the +quickfix feature

Problem:    Build failure without the +quickfix feature.
Solution:   Add #ifdef.
2e6dcbc445

vim-patch:9.0.0266: compiler warning for unused argument

Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
340dafd155

vim-patch:9.0.0268: build error without the +eval feature

Problem:    Build error without the +eval feature.
Solution:   Remove #ifdef.
0166e398d1
2022-08-26 07:00:50 +08:00
6e9980fc3b Merge pull request #19628 from dundargoc/refactor/char_u/2
refactor: replace char_u with char
2022-08-25 22:35:20 +02:00
bfd1adc62c Merge pull request #19946 from bfredl/newnode
feat: upstream some nvim-treesitter functions
2022-08-25 21:35:13 +02:00
73ee2b35d1 fix(tests): use pending_c_parser when needed 2022-08-25 20:49:27 +02:00
40855b0143 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-25 18:59:12 +02:00
e5fe41198c fix(treesitter): more efficient node:root() 2022-08-25 18:24:56 +02:00
8554164b1e fix(docs): update auto-generated documentation 2022-08-25 18:01:27 +02:00
244a115e49 feat(treesitter): clarify similar 'get_node_range' functions
The private 'get_node_range' function from the languagetree module has
been renamed and remains private as it serve a purpose that is only
relevant inside the languagetree module.

The 'get_node_range' upstreamed from nvim-treesitter in the treesitter
module has been made public as it is in itself a utlity function.
2022-08-25 18:01:15 +02:00
133ff6e11e feat(treesitter): upstream node_contains()
Util from the nvim-treesitter project.
2022-08-25 18:01:15 +02:00
f57341a4b6 feat(treesitter): upstream node_length() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
baba43681e feat(treesitter): upstream get_root_for_node() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
a577fb778a feat(treesitter): upstream get_named_children() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
6b2d42eb03 feat(treesitter): add ability to retreive a tree/node given a range 2022-08-25 18:01:14 +02:00
733b2e12b8 feat(treesitter): add opts.concat to query.get_text_node
As part of the upstream of utility functions from nvim-treesitter, this
option when set to false allows to return a table (downstream behavior).
Effectively making the switch from the downstream to the upstream
function much easier.
2022-08-25 18:01:14 +02:00
3aba4ba378 feat(treesitter): upstream is_parent()
Util from the nvim-treesitter project.
Renamed is_parent to is_ancestor for clarity.
2022-08-25 18:01:14 +02:00
22f9200302 Merge pull request #19945 from zeertzjq/vim-8.2.0911
vim-patch:8.2.{0911,0923}: cmdwin interrupted
2022-08-25 22:02:29 +08:00
22536eb527 vim-patch:8.2.0923: cmdline test is slow
Problem:    Cmdline test is slow.
Solution:   Use WaitForAssert().
c82dd86084
2022-08-25 21:38:11 +08:00
4ecea0e001 vim-patch:8.2.0911: crash when opening a buffer for the cmdline window fails
Problem:    Crash when opening a buffer for the cmdline window fails. (Chris
            Barber)
Solution:   Check do_ecmd() succeeds.  Reset got_int if "q" was used at the
            more prompt. (closes vim/vim#6211)
9b7cce28d5

Make code match latest Vim instead.
2022-08-25 21:38:11 +08:00
99f8d34c8a Merge pull request #19934 from lewis6991/prepostincr 2022-08-25 14:30:12 +01:00
cd2d3aa48f vim-patch:9.0.0261: bufload() reads a file even if the name is not a file name (#19944)
Problem:    bufload() reads a file even if the name is not a file name. (Cyker
            Way)
Solution:   Do not read the file when the buffer name is not a file name.
            (closes vim/vim#10975)
2eddbacd6d
2022-08-25 20:23:29 +08:00
93f24403f8 refactor: pre-incr to post-incr 2022-08-25 13:10:41 +01:00
1b29288709 vim-patch:8.2.4356: command line completion functions are very long (#19943)
Problem:    Command line completion functions are very long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9753)
620d8edba0

Change fifth argument of set_context_by_cmdname() to "context".
2022-08-25 19:06:26 +08:00
274e1122ad fix(usercmd): also check for whitespace after escaped character (#19942) 2022-08-25 17:57:32 +08:00
f0658fd552 refactor: suppress clang and PVS warnings (#19940) 2022-08-25 15:20:54 +08:00
5c9baa6f35 docs(contributing): add documenting guidelines from wiki (#19924)
Co-authored-by: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
2022-08-25 09:06:37 +02:00
170617c7a2 Merge pull request #19939 from zeertzjq/vim-8.2.4289
vim-patch: compiler warnings
2022-08-25 13:41:17 +08:00
6584f3a2b6 vim-patch:8.2.4289: warnings reported by MSVC
Problem:    Warnings reported by MSVC.
Solution:   Rename variables and other fixes. (Ken Takata, closes vim/vim#9689)
5411910c77

N/A patches for version.c:

vim-patch:8.2.0091: compiler warnings for size_t / int types

Problem:    Compiler warnings for size_t / int types.
Solution:   Change type to size_t. (Mike Williams)
4d7a248b64

vim-patch:8.2.1299: compiler warning for using size_t for int and void pointer

Problem:    Compiler warning for using size_t for int and void pointer.
Solution:   Add type casts.
d3bb6a82a5

vim-patch:8.2.1906: warning for signed/unsigned

Problem:    Warning for signed/unsigned.
Solution:   Use size_t instead of int. (Mike Williams)
a360dbe3b6

vim-patch:8.2.4531: LGTM warnings for condition and buffer size

Problem:    LGTM warnings for condition always true and buffer size too small.
Solution:   Remove the useless condition.  Make the buffer larger. (Goc
            Dundar, closes vim/vim#9914)
f01a653ac5

vim-patch:8.2.4624: old Coverity warning for resource leak

Problem:    Old Coverity warning for resource leak.
Solution:   Close the file if memory allocation fails.
5d46dcfeed

vim-patch:9.0.0129: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Add a type cast. (Mike Williams, closes vim/vim#10830)
ab146dac6b
2022-08-25 13:18:49 +08:00
e7dd65eea3 vim-patch:8.2.2826: compiler warnings for int to size_t conversion
Problem:    Compiler warnings for int to size_t conversion. (Randall W.
            Morris)
Solution:   Add type casts.
551c1aed65

Still keep it size_t, but avoid calculating multiple times.
2022-08-25 13:06:33 +08:00
7656cd527b vim-patch:8.2.1960: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Initialize the variable.
0fd797eacd
2022-08-25 13:02:01 +08:00
88738bd28f vim-patch:8.2.1728: compiler warning for using uninitialized variable
Problem:    Compiler warning for using uninitialized variable. (John Marriott)
Solution:   Initialize "neighbor".
c53e9c57a9
2022-08-25 12:58:36 +08:00
711635872d vim-patch:8.1.1085: compiler warning for possibly uninitialized variable
Problem:    Compiler warning for possibly uninitialized variable. (Tony
            Mechelynck)
Solution:   Make conditions more logical.
bd9bf266fc
2022-08-25 12:53:34 +08:00
e4e0e8ce6f refactor: ins_compl_show_pum() (#19938)
This marks the remaining part of Vim patch 8.2.3953 as ported, because
ins_compl_upd_pum() has been removed.

vim-patch:8.2.3953: insert completion code is too complicated

Problem:    Insert completion code is too complicated.
Solution:   More refactoring.  Move function arguments into a struct.
            (Yegappan Lakshmanan, closes vim/vim#9437)
6ad84ab3e4
2022-08-25 12:07:49 +08:00
ee02141c7b Merge pull request #19937 from zeertzjq/vim-8.2.3942
vim-patch:8.2.{3942,partial:4001}
2022-08-25 11:17:29 +08:00
b1833bb33b vim-patch:partial:8.2.4001: insert complete code uses global variables
Problem:    Insert complete code uses global variables.
Solution:   Make variables local to the file and use accessor functions.
            (Yegappan Lakshmanan, closes vim/vim#9470)
d94fbfc74a

Skip changes in comments for callback-related functions (not ported).
Also make compl_busy static again.
2022-08-25 10:15:07 +08:00
45d09b46ce vim-patch:8.2.3942: Coverity reports a possible memory leak
Problem:    Coverity reports a possible memory leak.
Solution:   Free the array if allocation fails.
8e7cc6b920
2022-08-25 10:15:07 +08:00
674d3b2d5f Merge pull request #19936 from zeertzjq/vim-8.2.3989
vim-patch:8.2.{2534,3989,4037}: Insert mode completion tests and fixes
2022-08-25 08:54:03 +08:00
3290e472c0 vim-patch:8.2.4037: Insert mode completion is insufficiently tested
Problem:    Insert mode completion is insufficiently tested.
Solution:   Add more tests.  Fix uncovered memory leak. (Yegappan Lakshmanan,
            closes vim/vim#9489)
370791465e
2022-08-25 08:27:44 +08:00
cabc1861c4 vim-patch:8.2.3989: some insert completion code is not tested
Problem:    Some insert completion code is not tested.
Solution:   Add a few tests.  Refactor thesaurus completion. (Yegappan
            Lakshmanan, closes vim/vim#9460)
e982586f8e

vim-patch:9.0.0254: typo in function name

Problem:    Typo in function name.
Solution:   Rename the function. (closes vim/vim#10971)
5fb3aabc2b
2022-08-25 08:27:44 +08:00
6c9a91bebe vim-patch:8.2.2534: missing test coverage
Problem:    Missing test coverage.
Solution:   Improve test coverage for completion with different encodings,
            mapset(), and term function failures. (Dominique Pellé,
            closes vim/vim#7877)
a1070eae77

Cherry-pick E716 -> E715 change from patch 8.2.4861.
2022-08-25 08:27:43 +08:00
6d8b64fffc Merge pull request #19927 from zeertzjq/vim-9.0.0045
vim-patch:9.0.{0045,0046,0060,0102}: Insert mode completion crash fixes
2022-08-25 07:17:52 +08:00
dd77a00621 vim-patch:9.0.0102: reading past end of line with insert mode completion
Problem:    Reading past end of line with insert mode completion.
Solution:   Check text length.
a6f9e30016
2022-08-25 06:53:59 +08:00
6680002169 vim-patch:9.0.0060: accessing uninitialized memory when completing long line
Problem:    Accessing uninitialized memory when completing long line.
Solution:   Terminate string with NUL.
b9e717367c
2022-08-25 06:53:59 +08:00
5d1f0c3eca vim-patch:9.0.0046: reading past end of completion with duplicate match
Problem:    Reading past end of completion with duplicate match.
Solution:   Check string length
baefde1455
2022-08-25 06:53:59 +08:00
c366a63e4c vim-patch:9.0.0045: reading past end of completion with a long line
Problem:    Reading past end of completion with a long line and 'infercase'
            set.
Solution:   Allocate the string if needed.
caea66442d

Cherry-pick the deletion of a blank line from patch 9.0.0027.

N/A patches for version.c:

vim-patch:9.0.0054: compiler warning for size_t to int conversion

Problem:    Compiler warning for size_t to int conversion.
Solution:   Add type cast. (Mike Williams, closes vim/vim#10741)
c7bd2f08e5
2022-08-25 06:53:59 +08:00
d3cd79709b vim-patch:fd999452adaf (#19929)
Update runtime files
fd999452ad
2022-08-25 00:49:33 +02:00
6b9ff5491d fix(treesitter): free memory on removing parser (#19933)
This fixes the ASAN failure.
2022-08-25 06:41:04 +08:00
c545d514df Merge pull request #19830 from lewis6991/hlgroup_name
feat(highlight)!: error on invalid names and allow '.' and '@'
2022-08-24 21:08:21 +02:00
3b2121cedf Merge pull request #19928 from vigoux/ts-fix-c-parser
test(treesitter): make internal lang test pending when necessary
2022-08-24 19:05:58 +02:00
61be343ec8 feat(highlight)!: error on invalid names and allow '.' and '@'
Previously if a highlight group with a name outside the regexp
[a-zA-Z0-9_] was defined, Nvim would emit an "invalid character"
warning message. This was annoying for Lua scripts, as it was very hard
to debug what line of code was triggering this message since it didn't
produce a stack trace.

This has now been promoted to an error with the code E5248.

Additionally the ASCII character period ('.') and at-sign ('@') have
been added to the allowed list of characters of a highlight group name
to support the application of defining hierarchical highlight groups,
e.g. 'TS.keyword'.

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-08-24 17:13:18 +01:00
26ebf67c39 test(treesitter): make internal lang test pending when necessary 2022-08-24 16:59:13 +02:00
b1eaa2b9a3 feat(lua): add vim.iconv (#18286)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-08-24 14:41:31 +01:00
9be4bfc5f4 Merge pull request #19496 from vigoux/ts_internal_lang
feat(treesitter): allow customizing language symbol name
2022-08-24 15:36:58 +02:00
f1ea126a6e Merge pull request #19906 from bfredl/bigstage
perf(api): allow to use an arena for return values
2022-08-24 15:22:30 +02:00
f91b1885dd feat(eval)!: make Vim functions return inner window width and height (#19743)
In non-multigrid UI the only change is that the returned height now
excludes winbar, and this is compatible with Vim.

In multigrid UI this means the return value of these functions now
reflect the space available for buffer lines in a window.

No change in nvim_win_get_height() and nvim_win_get_width().
2022-08-24 21:02:45 +08:00
b0fdce55d0 vim-patch:partial:8.2.3953: insert completion code is too complicated (#19923)
Problem:    Insert completion code is too complicated.
Solution:   More refactoring.  Move function arguments into a struct.
            (Yegappan Lakshmanan, closes vim/vim#9437)
6ad84ab3e4

Skip most pum-related refactoring.
Cherry-pick rename to match_at_original_text() from patch 8.2.4001.
2022-08-24 20:36:10 +08:00
7784dc9e0d refactor(api): provide a temporary copy solution for nvim_call_atomic
Make the copy_object() family accept an optional arena. More than
half of the callsites should be refactored to use an arena later
anyway.
2022-08-24 14:22:26 +02:00
bcf5ee328e refactor(arena): use a shared block freelist
This is both simpler in client code and more effective (always reuse
block hottest in cache)
2022-08-24 14:22:26 +02:00
b0569f5813 vim-patch:9.0.0020: with some completion reading past end of string (#19922)
Problem:    With some completion reading past end of string.
Solution:   Check the length of the string.
f12129f171
2022-08-24 16:59:03 +08:00
79f32c20f0 Merge pull request #19921 from zeertzjq/vim-8.2.3937
vim-patch:8.2.{3937,3944}: Insert mode completion refactoring
2022-08-24 16:12:15 +08:00
9ac44c7f5d vim-patch:8.2.3944: insert mode completion functions are too long
Problem:    Insert mode completion functions are too long.
Solution:   Split up into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9431)
5d2e007ccb

Cherry-pick can_cindent_get() -> get_can_cindent() from patch 8.1.2062.
2022-08-24 15:47:15 +08:00
ef748af01d vim-patch:8.2.3937: Insert mode completion function is too long
Problem:    Insert mode completion function is too long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9423)
edc6f10390

Cherry-pick a typo fix from patch 8.2.3637.
2022-08-24 15:47:14 +08:00
a4e4609d62 fix(path): path_is_url returns false for "foo:/" #19797
Problem:
path_to_url() returns false for single-slash URIs ("foo:/" vs "foo://").
This is not compliant with the URI spec. https://url.spec.whatwg.org/#url-representation
LSP in particular allows single-slash URIs.

Solution:
Relax path_to_url() to accept single-slash URIs. This is not fully
compliant (only ":" is required by the spec), but it is hopefully good
enough without causing false-positives in typical text files.

ref https://url.spec.whatwg.org/#windows-drive-letter
ref https://github.com/neovim/neovim/pull/19773
ref https://github.com/neovim/neovim/pull/19773#issuecomment-1214763769
2022-08-23 23:38:06 -07:00
9a100ee169 fix(cmdline): do not trigger completion at wrong time (#19920)
Cherry-picked from Vim patches 8.2.4339, 9.0.0238.
2022-08-24 10:28:32 +08:00
64d147b471 vim-patch:9.0.0248: duplicate code in finding a script in the execution stack (#19917)
Problem:    Duplicate code in finding a script in the execution stack.
Solution:   Reduce duplicate code. (closes vim/vim#10961)
a247142ae4
2022-08-24 06:28:37 +08:00
c0d6052654 perf(api): allow to use an arena for return values 2022-08-23 18:34:24 +02:00
6cc6e11929 vim-patch:9.0.0206: redraw flags are not named specifically (#19913)
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
a4d158b3c8
2022-08-23 22:00:19 +08:00
779a25f040 refactor(spell.c): resolve clint errors (#19875)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-23 14:30:02 +01:00
0c0a426e40 doc(CONTRIBUTING): update #19891
- add section for managing includes via IWYU
- recommend clangd over ctags
- tidy up links
- remove ./scripts/check-includes.py
2022-08-23 06:18:05 -07:00
e892b7b383 fix(inspect): escape identifiers that are lua keywords (#19898)
A lua keyword is not a valid table identifier
2022-08-23 13:02:55 +02:00
df4709ddf6 Merge pull request #19905 from zeertzjq/vim-8.2.4726
vim-patch:8.2.{4726,4740,4741,4749,4841,4842}: expand('<script>')
2022-08-23 18:12:28 +08:00
d459b66877 vim-patch:8.2.4842: expand("%:p") is not empty when there is no buffer name
Problem:    expand("%:p") is not empty when there is no buffer name.
Solution:   When ignoring errors still return NULL. (closes vim/vim#10311)
211a5bb235
2022-08-23 17:48:12 +08:00
f1b8683b8c vim-patch:8.2.4841: empty string considered an error for expand()
Problem:    Empty string considered an error for expand() when 'verbose' is
            set. (Christian Brabandt)
Solution:   Do not give an error for an empty result. (closes vim/vim#10307)
a96edb736d
2022-08-23 17:48:12 +08:00
d0b9fe2d5a vim-patch:8.2.4749: <script> is not expanded in autocmd context
Problem:    <script> is not expanded in autocmd context.
Solution:   Add the context to the pattern struct. (closes vim/vim#10144)
            Rename AutoPatCmd to AutoPatCmd_T.
eca7c60d68

Omit AutoPatCmd -> AutoPatCmd_T rename as it is inconsistent.
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Omit acp_script_stx(), use member directly.
2022-08-23 17:48:12 +08:00
7afc17dec1 vim-patch:8.2.4741: startup test fails
Problem:    Startup test fails.
Solution:   Avoid an error for verbose expansion.  Fix that the "0verbose"
            command modifier doesn't work.
60895f3e36

Most code changes has already been ported.
2022-08-23 17:48:12 +08:00
a9e6cf0e64 vim-patch:8.2.4740: when expand() fails there is no error message
Problem:    When expand() fails there is no error message.
Solution:   When 'verbose' is set give an error message.
575445200b
2022-08-23 17:48:12 +08:00
ffa1335047 vim-patch:8.2.4726: cannot use expand() to get the script name
Problem:    Cannot use expand() to get the script name.
Solution:   Support expand('<script>'). (closes vim/vim#10121)
6013d0045d

Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
2022-08-23 17:47:46 +08:00
42e9fe7d95 test: add test for using :normal to stop Visual mode in cmdwin (#19904) 2022-08-23 11:39:25 +08:00
63df91c10a vim-patch:8.2.1046: insufficient tests for src/buffer.c (#19903)
Problem:    Insufficient tests for src/buffer.c.
Solution:   Add more tests.  Move comments related tests to a separate file.
            (Yegappan Lakshmanan, closes vim/vim#6325)
b7e2483655
2022-08-23 11:24:46 +08:00
d5328ea408 vim-patch:8.2.0522: several errors are not tested for (#19901)
Problem:    Several errors are not tested for.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5892)
ee4e0c1e9a

Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
2022-08-23 10:38:53 +08:00
48a4657aee vim-patch:8.1.{1915,1921,1953} (#19900)
vim-patch:8.1.1915: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
1a3a89168d

Move debugbreak() to the right place.

vim-patch:8.1.1921: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
a4208966fb

vim-patch:8.1.1953: more functions can be used as a method

Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.
f9f24ce7a0

Omit test_termcodes.vim: cannot be used and superseded by later patches.
Cherry-pick test_bufline.vim change from patch 8.1.1993.
2022-08-23 08:36:22 +08:00
2fd25fb909 vim-patch:8.1.0832: confirm() is not tested (#19896)
Problem:    confirm() is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3868)
2e05009218
2022-08-23 07:20:23 +08:00
baaaa1f2b3 vim-patch:8.2.3421: a bit of code is not covered by tests (#19895)
Problem:    A bit of code is not covered by tests.
Solution:   Add a few more test cases. (Dominique Pellé, closes vim/vim#8857)
d176ca3dde

Cherry-pick Test_trim() change from patch 8.2.0448.
Cherry-pick Test_History() change from patch 8.2.1736.
Cherry-pick charidx() and trim() type checks from patch 8.2.3135.
2022-08-22 22:09:53 +08:00
3c1d70f20b feat(treesitter): allow customizing language symbol name 2022-08-22 15:34:10 +02:00
15a768eeb0 fix(api): avoid side effects with nvim_parse_cmd (#19890)
Save and restore the cursor and last search pattern and do not change
search history.
2022-08-22 18:06:18 +08:00
2bed0d1d97 vim-patch:8.2.4753: error from setting an option is silently ignored (#19888)
Problem:    Error from setting an option is silently ignored.
Solution:   Handle option value errors better.  Fix uses of N_().
31e5c60a68
2022-08-22 13:56:50 +08:00
d4d27c41b3 fix(edit.c): indentkeys double indent after "!" #12894
which is both unexpected and different from the Vim behaviour.

Indent was triggered once by the '!' check in insert_execute(), and
inserting the char was correctly skipped, but then triggered again in
insert_check() (provided that cindent was not being ignored after manual
indentation, i.e. `can_cindent == true`).

While this is the smallest fix, another solution would be to remove
VimState#check and instead move that to *_enter()/-_execute(), since the
control flow is pretty unnecessarily convoluted as is. That would also
have the benefit of differing less from the Vim source code.
2022-08-21 21:48:18 -07:00
4f6d0d6da9 vim-patch:8.2.2289: Vim9: 'cpo' can become empty (#19887)
Problem:    Vim9: 'cpo' can become empty.
Solution:   Use empty_option instead of an empty string.  Update quickfix
            buffer after restoring 'cpo'.  (closes vim/vim#7608)
e5a2dc87fd

Omit test as it is Vim9 script.
2022-08-22 12:02:45 +08:00
d5cc161dea Merge pull request #19886 from zeertzjq/vim-8.2.2030
vim-patch:8.2.{2030,2031}: some tests fail
2022-08-22 10:15:00 +08:00
b94cfaf080 vim-patch:8.2.2031: some tests fail when run under valgrind
Problem:    Some tests fail when run under valgrind.
Solution:   Avoid timing problems.
18dc355395
2022-08-22 09:53:09 +08:00
af2b078258 vim-patch:8.2.2030: some tests fail on Mac
Problem:    Some tests fail on Mac.
Solution:   Avoid Mac test failures.  Add additional test for wildmenu.
            (Yegappan Lakshmanan, closes vim/vim#7341)
4b2ce1297e
2022-08-22 09:53:07 +08:00
72b03792b6 Merge pull request #19885 from zeertzjq/vim-8.2.4328
vim-patch:8.2.{4328,4334}: wildmenu tests
2022-08-22 09:27:55 +08:00
06a53ab2cb vim-patch:8.2.4334: command line popup menu not positioned correctly
Problem:    Command line popup menu not positioned correctly.
Solution:   Also use vim_strsize() on the existing text. (Naruhiko Nishino,
            closes vim/vim#9727)
68cc2b8a37
2022-08-22 09:08:47 +08:00
99bd895956 vim-patch:8.2.4328: command line complete matches cleard when typing character
Problem:    Command line complete matches cleard when typing character.
            (Dominique Pellé)
Solution:   Only remove a popup menu if there is one.
73a16c22a4
2022-08-22 08:55:54 +08:00
c086bf6079 Merge pull request #19864 from lewis6991/decorfix
fix(ui): don't allow decor provider with ns_id==0
2022-08-21 21:11:56 +02:00
2379699b1e vim-patch:9.0.0236: popup menu not removed when 'wildmenu' reset while visible (#19882)
Problem:    Popup menu not removed when 'wildmenu' reset while it is visible.
Solution:   Do not check p_wmnu, only pum_visible(). (closes vim/vim#10953)
b82a2ab8ad
2022-08-21 22:03:26 +08:00
e3eb6967bc vim-patch:8.2.4325: 'wildmenu' only shows few matches (#19876)
Problem:    'wildmenu' only shows few matches.
Solution:   Add the "pum" option: use a popup menu to show the matches.
            (Yegappan Lakshmanan et al., closes vim/vim#9707)
3908ef5017

Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
2022-08-21 21:31:25 +08:00
dde90f0ca4 fix(api/command): fargs behavior when no arguments are passed (#19862)
Problem: A command defined with `nargs="?"` returns `fargs={""}` to
a Lua callback when executed with no arguments, which is inconsistent
with how`nargs="*"` behaves.

Solution: Pass `fargs={}` for no argument with `nargs="?"` as well.
2022-08-21 15:19:29 +02:00
5928d5c2f1 vim-patch:9.0.0234: cannot make difference between :normal end and argument char (#19879)
Problem:    Cannot make difference between the end of :normal and a character
            in its argument.
Solution:   Add the "typebuf_was_empty" flag. (closes vim/vim#10950)
8d69637133
2022-08-21 19:37:11 +08:00
6b9852cc41 vim-patch:8.2.4754: using cached values after unsetting some environment variables (#19872)
Problem:    Still using cached values after unsetting some known environment
            variables.
Solution:   Take care of the side effects. (closes vim/vim#10194)
7714231bb5

Cherry-pick vim_setenv_ext() from patch 8.2.0200.
2022-08-21 11:37:13 +08:00
506a3ec913 refactor: make wildmenu code closer to Vim (#19870)
This is a small refactor that makes `compl_match_array` static and
doesn't change any behavior.
2022-08-21 11:06:07 +08:00
61ff37952a vim-patch:8.2.1587: loop for handling keys for the command line is too long (#19868)
Problem:    Loop for handling keys for the command line is too long.
Solution:   Move wild menu handling to separate functions. (Yegappan
            Lakshmanan, closes vim/vim#6856)
eadee486c7
2022-08-21 09:18:47 +08:00
741ef87876 vim-patch:8.1.1914: command line expansion code is spread out (#19867)
Problem:    Command line expansion code is spread out.
Solution:   Move set_one_cmd_context(). (Yegappan Lakshmanan, closes vim/vim#4855)
d019039ccd
2022-08-21 08:05:39 +08:00
76d35a5a36 vim-patch:9.0.0231: expanding "**" may loop forever with directory links (#19866)
Problem:    Expanding "**" may loop forever with directory links.
Solution:   Check for being interrupted. (closes vim/vim#10946)
57e95179ab
2022-08-21 07:08:09 +08:00
0d0a336c53 vim-patch:8.1.1886: command line expansion code is spread out (#19861)
Problem:    Command line expansion code is spread out.
Solution:   Move the code to cmdexpand.c. (Yegappan Lakshmanan, closes vim/vim#4831)
66b51420e0
2022-08-21 06:33:24 +08:00
5e15452043 fix(ui): don't allow decor provider with ns_id==0
Fixes #19831
2022-08-20 19:05:22 +01:00
ff5cfcdeab vim-patch:8.1.2045: the option.c file is too big (#19854)
Problem:    The option.c file is too big.
Solution:   Split off the code dealing with strings. (Yegappan Lakshmanan,
            closes vim/vim#4937)
dac1347b4d

Cherry-pick set_string_option_direct_in_win() from patch 8.1.1405.
Cherry-pick shift_line() comment change from patch 8.1.2096.
Move 'clipboard' default parsing to didset_string_options().
Reorder option flags to put Nvim-only flags at the end.
2022-08-20 17:26:44 +08:00
1cc4706e94 vim-patch:e80086446cc2 (#19848)
* vim-patch:e80086446cc2

Update runtime files
e80086446c

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-08-20 10:04:55 +02:00
bffaf1e27e fix(eval): check for v:lua when calling callback (#19855)
This makes callback_call() match call_vim_function() when calling a function.
2022-08-20 15:52:35 +08:00
1a57cd3836 Merge pull request #19852 from zeertzjq/vim-8.2.3623
vim-patch:8.2.{3623,4667}: expandcmd() fixes
2022-08-20 07:49:31 +08:00
15ca01b649 vim-patch:8.2.4667: expandcmd() fails on an error
Problem:    expandcmd() fails on an error.
Solution:   On failure return the command unmodified. (yegappan Lakshmanan,
            closes vim/vim#10063)
5018a836c0
2022-08-20 07:25:22 +08:00
6d6e9c5d51 vim-patch:8.2.3623: "$*" is expanded to "nonomatch"
Problem:    "$*" is expanded to "nonomatch".
Solution:   Only add "set nonomatch" when using a csh-like shell. (Christian
            Brabandt, closes vim/vim#9159, closes vim/vim#9153)
8b8d829faf

Cherry-pick a line from patch 8.2.0522.
2022-08-20 07:25:22 +08:00
f342194396 Merge pull request #19847 from lewis6991/utfmb
refactor(drawline.c): factor out utf8 multibyte check
2022-08-19 23:28:20 +01:00
e8618df7f8 vim-patch:8.2.3619: cannot use a lambda for 'operatorfunc' (#19846)
Problem:    Cannot use a lambda for 'operatorfunc'.
Solution:   Support using a lambda or partial. (Yegappan Lakshmanan,
            closes vim/vim#8775)
777175b0df

Omit duplicate docs. It's removed in patch 8.2.3623.
Nvim doesn't seem to need callback_set() as it was omitted when patch 8.1.1437
was first ported.
2022-08-20 06:12:02 +08:00
ebd5720901 Merge pull request #19841 from bfredl/drawstatus
refactor: move statusline code from buffer.c and [draw]screen.c to new file
2022-08-20 00:05:32 +02:00
6adc2ae7e0 refactor: move statusline code from buffer.c and [draw]screen.c to new file
problem: code for drawing statusline is arbitrarily spreadout between drawscreen.c, screen.c and buffer.c
solution: move it to a new file statusline.c

- rename archaic internal name "status match" to public name "wildmenu"
- showruler() does not show the ruler. it show anything which displays
  info about the cursor. Rename it accordingy.
2022-08-19 22:48:03 +02:00
b2f979b30b fix(filetype): only check first 100 and last line of buffer (#19819)
fix(filetype): only pass first 100 and last lines to contents check

sufficient for current content checks and avoids performance issues for
buffers with a large number of lines

fixes #19817
2022-08-19 19:30:35 +02:00
7e980a4df4 docs(lua): update vim.{g,b,w}o documentation (#19844)
docs(lua): update vim.{go,bo,wo} documentation

* document indexing by buffer/window handle
* correct wrapper information (`nvim_buf_{g,s}et_value` now)
* make clear what is considered "invalid key" (consistently)
2022-08-19 19:05:28 +02:00
7d815eb4d9 refactor(drawline.c): factor out utf8 multibyte check 2022-08-19 16:54:27 +01:00
3c545b9c62 Merge pull request #19360 from famiu/feat/multibuffer-inccommand
feat: multibuffer preview support for inccommand
2022-08-19 17:21:18 +02:00
dc32cc5acf Merge pull request #19845 from zeertzjq/vim-8.2.0982
vim-patch:8.2.{partial:0425,0982}: insufficient tests
2022-08-19 22:27:43 +08:00
b7c86e24f7 vim-patch:8.2.0982: insufficient testing for reading/writing files
Problem:    Insufficient testing for reading/writing files.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6257)
            Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f

Omit test_override().
Reorder test_writefile.vim to match Vim.
2022-08-19 22:05:26 +08:00
efebf30784 vim-patch:partial:8.2.0425: code for modeless selection not sufficiently tested
Problem:    Code for modeless selection not sufficiently tested.
Solution:   Add tests.  Move mouse code functionality to a common script file.
            (Yegappan Lakshmanan, closes vim/vim#5821)
515545e11f

Skip termcode tests for now.
2022-08-19 22:05:23 +08:00
7ff283b1b7 Merge pull request #19843 from zeertzjq/vim-9.0.0227
vim-patch:8.2.3946,9.0.0227: internal error improvements
2022-08-19 21:02:38 +08:00
4edf967050 vim-patch:9.0.0227: cannot read error message when abort() is called
Problem:    Cannot read error message when abort() is called.
Solution:   Output a newline before calling abort().
213e70e284

Add emsg_not_now() check to make code equivalent.
2022-08-19 20:39:17 +08:00
aa96a80d5d vim-patch:8.2.3946: when an internal error makes Vim exit the error is not seen
Problem:    When an internal error makes Vim exit the error is not seen.
Solution:   Add the error to the test output.
1c67f3a977

Add emsg_not_now() check to make code equivalent.
2022-08-19 20:38:59 +08:00
2af9be3db5 vim-patch:8.1.1966: some code in options.c fits better elsewhere (#19840)
Problem:    Some code in options.c fits better elsewhere.
Solution:   Move functions from options.c to other files. (Yegappan
            Lakshmanan, closes vim/vim#4889)
e677df8d93
2022-08-19 19:20:39 +08:00
5dc43265b1 Merge pull request #19802 from lewis6991/drawscreen 2022-08-19 10:41:45 +01:00
51063a90df vim-patch:8.1.2057: the screen.c file is much too big
Problem:    The screen.c file is much too big.
Solution:   Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943)
7528d1f6b5

This is an approximation vim-patch 8.1.2057. Applying the patch directly
isn't feasible since our version of screen.c has diverged too much,
however we still introduce drawscreen.c and drawline.c:
- screen.c is now a much smaller file used for low level screen functions
- drawline.c contains everything needed for win_line()
- drawscreen.c contains everything needed for update_screen()

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-19 10:01:40 +01:00
c2f7a2a18d feat: multibuffer preview support for inccommand
Allows preview callbacks to modify multiple buffers in order to show the
preview. Previously, if multiple buffers were modified, only the current
buffer would have its state restored. After this change, all buffers
have their state restored after preview.

Closes #19103.
2022-08-19 09:27:52 +06:00
a5ed89c972 refactor(undo.c): resolve clint issues (#19827) 2022-08-18 15:16:52 +01:00
36f0b508c5 revert: "jobstart(): Fix hang on non-executable cwd #9204" (#19826)
This reverts commit c4c74c3883.

LibUV already gives an error for this, so this isn't needed.
2022-08-18 22:09:50 +08:00
700a6fb9d4 Merge pull request #19822 from bfredl/hldef
fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
2022-08-18 12:16:27 +02:00
39494be2a4 ci: add codeql action (#19810)
replaces deprecated LGTM workflow:
https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/
2022-08-18 11:55:15 +02:00
7a2be8cc17 Merge pull request #19828 from bfredl/nullhl
fix(winhl): do not crash when unsetting winhl in just opened window
2022-08-18 11:12:50 +02:00
fbcce2b2ca vim-patch:8.1.2082: rename popupmnu.* to popupmenu.* (#19829)
vim-patch:8.1.2082: some files have a weird name to fit in 8.3 characters

Problem:    Some files have a weird name to fit in 8.3 characters.
Solution:   Use a nicer names.
30e8e73506
2022-08-18 17:06:39 +08:00
e29156356b fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
fixes #18160
2022-08-18 10:57:46 +02:00
341ef46d00 docs(lsp): remove lsp.buf_request from docs (#19738)
This starts a soft phase-out of `buf_request`.

`buf_request` is quite error prone:

- Positional `params` depend on the client because of the
  `offset_encoding`. Currently if there is one client using UTF-8 offset
  encoding and another using UTF-16, the positions in the request are
  wrong for one of the clients. To solve this the params would need to
  be created per client instead of once for all of them.

- `handler` is called *per* client but many users of it assume it is
  only called once.

  This can lead to a "select n + 1"
  kind of problem, where the handler makes another call to `buf_request`,
  multiplying the amount of requests.
  (There are in fact still some places where this happens in core)

  Or it leads to erratic behavior if called multiple times (E.g. the
  quicklist list flickering & being overwritten)
  (See hover or references implementation)

  `buf_request_all` returns an aggregate of the responses which is more
  sensible as it avoids this problem.

  For off-spec extensions it also has the problem that it sends requests to
  clients which cannot handle a given request.

Given that `buf_request` is in use by a lot of plugins this starts a
soft-phase out. Planned Steps:

- Remove from docs
- Provide an alternative, either `buf_request_all`, maybe with
  extensions (params being a function), or an entirely new method.
- Mark as deprecated in 0.9
- Remove in 0.10

To note:

- `buf_request_all` currently isn't ideal either because it suffers from
the `params` problem as well.

- This implies that the `vim.lsp.with` pattern will die, because the
  global handlers as they are don't fit a multi-client model, as most of
  the time an aggregate is needed.
2022-08-18 10:57:17 +02:00
21b2906c9c fix(winhl): do not crash when unsetting winhl in just opened window
fixes #19823
2022-08-18 09:43:07 +02:00
02e9b5a8ee Merge pull request #19824 from bfredl/msgsep_allthethings
fix(tests): remove irrelevant usage of display-=msgsep
2022-08-18 00:12:28 +02:00
068a998e60 fix(tests): remove irrelevant usage of display-=msgsep
These were just added to avoid churn when changing the default
of 'display'. To simplify message handling logic, we might want
to remove support for printing messages in default_grid later on.
This would allow things like printing error messages safely in the
middle of redraw, or a future graduation of the 'multigrid' feature.
2022-08-17 23:44:49 +02:00
35653e6bcd Merge pull request #13457 from bfredl/färgtema
feat(highlight): support highlight namespaces per window
2022-08-17 16:45:35 +02:00
d879331b0d feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces
- check for EOF in screen tests (to indicate a likely crash)
2022-08-17 16:20:39 +02:00
f7cfca49d6 refactor: remove some unused includes (#19820)
Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
2022-08-17 22:18:34 +08:00
f5588ee896 feat: allow :wincmd to accept a count (#19815)
Let :wincmd command accept a count like what its documentation suggests.
Previously it could only accept a range, which led to some ambiguity on
which attribute should be used when executing :wincmd using nvim_cmd.

Closes #19662.

Also fix a typo in a related Vim test:

vim-patch:9.0.0223: typo in diffmode test

Problem:    Typo in diffmode test.
Solution:   Fix the typo. (closes vim/vim#10932)
5fd6ab820b
2022-08-17 19:50:40 +08:00
7a076306e4 docs(lsp): rename on-list-handler to lsp-on-list-handler (#19813)
This makes it easier to find documentation about the on-list-handler
when starting the search term with "lsp".
2022-08-17 12:39:38 +02:00
5d8278591a vim-patch:8.2.1262: src/ex_cmds.c file is too big (#19811)
Problem:    src/ex_cmds.c file is too big.
Solution:   Move help related code to src/help.c. (Yegappan Lakshmanan,
            closes vim/vim#6506)
f868ba8903
2022-08-17 17:29:06 +08:00
bccb5de89d vim-patch:8.2.3699: the +title feature adds a lot of #ifdef but little code (#19809)
Problem:    The +title feature adds a lot of #ifdef but little code.
Solution:   Graduate the +title feature.
651fca85c7
2022-08-17 12:44:31 +08:00
5c1eb02b05 Merge pull request #19801 from Shougo/vim-9.0.0190
vim-patch:9.0.{0190,0191,0192}: cmdheight=0 fixes
2022-08-17 10:19:16 +08:00
9a6d3bd76e vim-patch:9.0.0191: messages test fails; window size incorrect
Problem:    Messages test fails; window size incorrect when 'cmdheight' is
            made smaller.
Solution:   Properly cleanup after test with cmdheight zero.  Resize windows
            correctly when 'cmdheight' gets smaller.
d4cf9fc53e

N/A patches for version.c:

vim-patch:9.0.0192: possible invalid memory access when 'cmdheight' is zero

Problem:    Possible invalid memory access when 'cmdheight' is zero. (Martin
            Tournoij)
Solution:   Avoid going over the end of w_lines[] when w_height is Rows.
            (closes vim/vim#10882)
fdc5d17d58
2022-08-17 09:35:07 +08:00
5977a96b3f vim-patch:9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Problem:    The way 'cmdheight' can be made zero is inconsistent.
Solution:   Only make 'cmdheight' zero when setting it explicitly, not when
            resizing windows. (closes vim/vim#10890)
f797e309ca
2022-08-17 09:34:13 +08:00
d74f9c3b94 Merge pull request #19808 from zeertzjq/vim-9.0.0220
vim-patch:9.0.{0220,0222}
2022-08-17 09:32:46 +08:00
dd15fa7096 vim-patch:9.0.0222: no good reason why text objects are only in larger builds
Problem:    No good reason why text objects are only in larger builds.
Solution:   Graduate +textobjects.
887748742d
2022-08-17 09:07:12 +08:00
65bcec9e9b vim-patch:9.0.0220: invalid memory access with for loop over NULL string
Problem:    Invalid memory access with for loop over NULL string.
Solution:   Make sure mb_ptr2len() consistently returns zero for NUL.
f6d39c31d2
2022-08-17 09:07:12 +08:00
542fa8a9cc refactor: change pre-decrement/increment to post (#19799)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-16 12:26:08 +01:00
9a4b8dc603 refactor(signs): handle non-sign attrs separately (#19784) 2022-08-16 11:03:44 +01:00
4f0a0a2933 docs: update .gitattributes (#19800) 2022-08-16 10:51:30 +01:00
03fddfd928 fix(api): nvim_exec and nvim_cmd restore msg_col when capturing output (#19789)
This matches the code in execute_common(), preventing messages after the
API call from being printed at the wrong column.
2022-08-16 17:30:39 +08:00
dee96f4725 refactor(eval.c): resolve all clint issues (#19774) 2022-08-16 09:47:16 +01:00
e8caaab6bf vim-patch:e1f3fd1d02e3 (#19796)
Update runtime files
e1f3fd1d02
2022-08-16 09:53:04 +02:00
da13ed43cb vim-patch:8.2.3888: the argument list may contain duplicates (#19795)
Problem:    The argument list may contain duplicates.
Solution:   Add the :argdedeupe command. (Nir Lichtman, closes vim/vim#6235)
73a024209c

Use latest index.txt :argdedupe doc from Vim.
2022-08-16 15:29:36 +08:00
cf3b871fa9 test: use poke_eventloop() instead of sleep(10) where possible (#19794)
Using sleep(10) to wait for typeahead to finish is flaky, especially on
macOS, where legacy/global_spec.lua has failed several times.
2022-08-16 15:21:46 +08:00
a63eea3d23 vim-patch:8.1.2042: the evalfunc.c file is too big (#19792)
Problem:    The evalfunc.c file is too big.
Solution:   Move getchar() and parse_queued_messages() to getchar.c.
9c658c9eac

Omit parse_queued_messages(): Nvim does not have MESSAGE_QUEUE.
2022-08-16 15:09:59 +08:00
5e98a41872 vim-patch:8.1.1869: code for the argument list is spread out (#19791)
Problem:    Code for the argument list is spread out.
Solution:   Put argument list code in arglist.c. (Yegappan Lakshmanan,
            closes vim/vim#4819)
4ad62155a1
2022-08-16 14:16:03 +08:00
d5d6ed311b vim-patch:9.0.0216: undo earlier test sometimes fails on MS-Windows (#19790)
Problem:    Undo earlier test sometimes fails on MS-Windows.
Solution:   Use another file name.
cce293f87b
2022-08-16 11:23:49 +08:00
63e4436d8e Merge pull request #19781 from zeertzjq/source-lua-estack
fix(source): fix expand('<sfile>') no longer works for Lua
2022-08-16 06:04:09 +08:00
d1464d16d6 fix(source): fix expand('<sfile>') no longer works for Lua 2022-08-16 05:39:44 +08:00
1d28bbf1e5 vim-patch:9.0.0217: 'shellslash' works differently when sourcing a script again
Problem:    'shellslash' works differently when sourcing a script again.
Solution:   Use the name from the script item. (closes vim/vim#10920)
5a4fff4d94
2022-08-16 05:39:12 +08:00
e954d62527 Merge pull request #19635 from dundargoc/build/windows
build: windows-specific cmake fixes
2022-08-15 17:49:33 +02:00
6b686e7e1e Merge pull request #19785 from zeertzjq/vim-8.2.1803
vim-patch:8.2.{1803,3345,3392}
2022-08-15 22:17:05 +08:00
747dec7925 vim-patch:8.2.3392: augroup completion escapes regexp pattern characters
Problem:    augroup completion escapes regexp pattern characters.
Solution:   Do not escape the augroup name. (closes vim/vim#8826)
b4d82e2a8d
2022-08-15 21:19:50 +08:00
e73517e34e vim-patch:8.2.3345: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add a few more tests. (Dominique Pellé, closes vim/vim#8757)
bfb2bb16bc
2022-08-15 21:19:50 +08:00
535e423a6a vim-patch:8.2.1803: a few failures are not tested
Problem:    A few failures are not tested.
Solution:   Test a few failures. (Dominique Pellé, closes vim/vim#7075)
afe8cf6170

Cherry-pick a line in Test_argdelete() from patch 8.2.1736.
2022-08-15 21:19:35 +08:00
cbb2e634c9 Merge pull request #19440 from zeertzjq/vim-8.2.1786
vim-patch:8.2.{1786,1799}: Normal mode commands not fully tested
2022-08-15 20:50:04 +08:00
18b457ebbb fix(redraw): make sure :redraw! redraws command line
In Vim :redraw! uses CLEAR, which calls screenclear(), which sets
redraw_cmdline. In Nvim :redraw! uses NOT_VALID, which does not set
redraw_cmdline automatically, so set it explicitly.
2022-08-15 20:24:43 +08:00
76b4b1977b vim-patch:8.2.1799: some Normal mode commands not fully tested
Problem:    Some Normal mode commands not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#7073)
d1ad99b654

Cherry-pick test_registers.vim change from patch 8.2.0644.
2022-08-15 20:24:43 +08:00
37586eac42 vim-patch:8.2.1786: various Normal mode commands not fully tested
Problem:    Various Normal mode commands not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7059)
8a9bc95eae

Cherry-pick Test_normal_gdollar_cmd() change from patch 8.2.0540.
2022-08-15 20:24:42 +08:00
d334249833 Merge pull request #19098 from zeertzjq/vim-8.1.0822
vim-patch:8.1.{partial:0822,1189,1192},8.2.5109: 'showmode' fixes
2022-08-15 18:38:46 +08:00
55da52963b vim-patch:8.2.5109: mode not updated after CTRL-O CTRL-C in Insert mode
Problem:    Mode not updated after CTRL-O CTRL-C in Insert mode.
Solution:   Set redraw_mode and use it. (closes vim/vim#10581)
7a1d32809b
2022-08-15 17:58:35 +08:00
93ba821831 vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem:    Mode is not cleared when leaving Insert mode with mapped Esc.
Solution:   Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
4c25bd785a
2022-08-15 17:58:35 +08:00
53b0688ac0 vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem:    Mode is not cleared when leaving Insert mode.
Solution:   Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270)
abc7c7fc5a
2022-08-15 17:58:35 +08:00
b47f313151 fix(getchar): flush screen before doing a blocking wait 2022-08-15 17:58:35 +08:00
95b8e2c55f vim-patch:partial:8.1.0822: peeking and flushing output slows down execution
Problem:    Peeking and flushing output slows down execution.
Solution:   Do not update the mode message when global_busy is set.  Do not
            flush when only peeking for a character. (Ken Takata)
cb574f4154

Omit inchar() change: it breaks too many tests.

N/A patches for version.c:

vim-patch:8.2.5170: tiny issues

Problem:    Tiny issues.
Solution:   Tiny improvements.
944cc9ceba
2022-08-15 17:58:35 +08:00
9a3877ff9d refactor(ex_docmd.c): resolve most clint errors (#19775)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-15 08:54:40 +01:00
6264aa521e ci(build.ps1): restore comment removed in #19336 2022-08-15 12:41:00 +08:00
93ae183810 docs: update Vim differences (#19780)
Patch 8.2.4594 (36a5b6867b) added support for sourcing a buffer without a name.

Patch 8.2.4325 (3908ef5017) added support for using a popup menu for wildmode completion.
2022-08-15 10:40:41 +08:00
a6f0e32d23 Merge pull request #19763 from zeertzjq/vim-8.2.1297
vim-patch:8.2.{1297,1653,1658}: expand('<stack>')
2022-08-15 10:39:41 +08:00
9ab9eb1220 fix(source): make changing 'shellslash' change expand() result 2022-08-15 10:14:53 +08:00
d6a6adf708 vim-patch:8.2.1658: expand('<stack>') has trailing ".."
Problem:    Expand('<stack>') has trailing "..".
Solution:   Remove the "..". (closes vim/vim#6927)
a810db3f17
2022-08-15 10:14:53 +08:00
ed65724e57 vim-patch:8.2.1653: expand('<stack>') does not include the final line number
Problem:    Expand('<stack>') does not include the final line number.
Solution:   Add the line nuber. (closes vim/vim#6927)
4f25b1aba0
2022-08-15 10:14:53 +08:00
98ab0bb5f7 vim-patch:8.2.1297: when a test fails it's often not easy to see where
Problem:    When a test fails it's often not easy to see what the call stack
            is.
Solution:   Add more entries from the call stack in the exception message.
a5d0423fa1

Use docs from latest Vim.
2022-08-15 10:14:52 +08:00
1c164689a4 refactor: move menu non-symbols to menu_defs.h (#19778) 2022-08-15 10:04:05 +08:00
36acb803c6 Merge pull request #19772 from lewis6991/uncrust_suggest
ci(lint): various improvements
2022-08-14 19:20:06 -04:00
d3569e8337 vim-patch:8.1.1960: fold code is spread out (#19777)
Problem:    Fold code is spread out.
Solution:   Move fold functions to fold.c.
db022f3ffb
2022-08-15 06:33:30 +08:00
41d6b8a6d0 vim-patch:9.0.0207: stacktrace not shown when debugging (#19776)
Problem:    Stacktrace not shown when debugging.
Solution:   Set msg_scroll in msg_source(). (closes vim/vim#10917)
28c162f6f1
2022-08-15 06:01:38 +08:00
f38c05bece Merge pull request #19771 from lewis6991/clint/eval/funcs.c
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-14 16:53:31 +01:00
47aba12593 refactor(eval/funcs.c): resolve all clint errors
... and tidy up local variable declarations

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-14 15:51:03 +01:00
0cd39c2f50 ci(lint): separate lintc from lint
All steps in lint now do now require a Neovim build.
2022-08-14 15:47:46 +01:00
27c3919a48 ci(lint): move some steps before build 2022-08-14 15:41:43 +01:00
49e691f58f ci(line): lintcfull -> lintc
lintcfull == lintc + uncrustify

We are already running uncrustify separately so can just run lintc
instead.
2022-08-14 15:41:07 +01:00
0fcc32b707 ci(lint): run uncrustify earlier 2022-08-14 15:37:23 +01:00
1dc984eaab ci(lint): generate PR suggestions from uncrustify 2022-08-14 15:37:22 +01:00
b1faf5f0b9 vim-patch:8.2.4249: the timeout limit for spell suggestions is always 5000 (#19769)
Problem:    The timeout limit for spell suggestions is always 5000 milli
            seconds.
Solution:   Add the "timeout" entry to 'spellsuggest'.
585ee07cfe
2022-08-14 19:11:36 +08:00
c77cce615b vim-patch:8.1.2081: the spell.c file is too big (#19767)
Problem:    The spell.c file is too big.
Solution:   Move the code for spell suggestions to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#4988)
46a426c9ac
2022-08-14 18:30:37 +08:00
c96020b2bf vim-patch:8.2.3675 (#19766)
vim-patch:8.2.3675: using freed memory when vim_strsave() fails

Problem:    Using freed memory when vim_strsave() fails.
Solution:   Clear "last_sourcing_name".  Check for msg_source() called
            recursively. (closes vim/vim#8217)
ba8c92687d

Although xstrdup() cannot fail in Nvim, it may still be possible that an
error appears (e.g. in regexp engine) when printing the message.
2022-08-14 15:15:43 +08:00
5854103dad docs(lua): clarify vim.keymap.set() opts (#19761) 2022-08-14 06:38:31 +08:00
fa8fde99e6 vim-patch:9.0.0203: confusing variable name (#19762)
Problem:    Confusing variable name.
Solution:   Use "prim_aep" instead of "spell_aep".
c9b6570fab
2022-08-14 06:19:12 +08:00
8cd116729f Merge pull request #19752 from zeertzjq/vim-8.2.0056
vim-patch:8.2.{0056,0061,0078,0097,0823}: execution stack
2022-08-14 05:18:21 +08:00
1ca2247639 vim-patch:8.2.0823: Vim9: script reload test is disabled
Problem:    Vim9: script reload test is disabled.
Solution:   Compile a function in the context of the script where it was
            defined.  Set execution stack for compiled function.  Add a test
            that an error is reported for the right file/function.
25e0f5863e

Omit stack_top_is_ufunc(): only used by Vim9 script.
2022-08-14 04:29:44 +08:00
a10a23aae9 vim-patch:8.2.0097: crash with autocommand and spellfile
Problem:    Crash with autocommand and spellfile. (Tim Pope)
Solution:   Do not pop exestack when not pushed. (closes vim/vim#5450)
ce6db0273f
2022-08-14 04:29:44 +08:00
3a8b859147 vim-patch:8.2.0078: expanding <sfile> works differently the second time
Problem:    Expanding <sfile> works differently the second time.
Solution:   Keep the expanded name when redefining a function. (closes vim/vim#5425)
b9adef79ec
2022-08-14 04:29:44 +08:00
de72f9098a vim-patch:8.2.0061: the execute stack can grow big and never shrinks
Problem:    The execute stack can grow big and never shrinks.
Solution:   Reduce the size in gargage collect.
3fbcc128cb
2022-08-14 04:29:44 +08:00
ded2925b40 refactor: change remaining sourcing_name/sourcing_lnum to exestack
Co-Authored-By: VVKot <volodymyr.kot.ua@gmail.com>
2022-08-14 04:29:44 +08:00
f52c236c5b vim-patch:8.2.0056: execution stack is incomplete and inefficient
Problem:    Execution stack is incomplete and inefficient.
Solution:   Introduce a proper execution stack and use it instead of
            sourcing_name/sourcing_lnum.  Create a string only when used.
1a47ae32cd

Omit test_debugger.vim: superseded by later patches.
Omit check_map_keycodes(): N/A.
Omit kword_test.c: N/A (converted to a unit test).
2022-08-14 04:29:44 +08:00
11837e9b29 build: only use CMAKE_BUILD_TYPE for single-config generators
CMAKE_BUILD_TYPE is ignored for multi-config generators and creates a
warning that it's unused.
2022-08-13 21:22:07 +02:00
2dde701115 build(MSVC): don't add non-MSVC compiler options
This will prevent warnings of the type "ignoring unknown option '-fPIC'"
when using MSVC.
2022-08-13 21:22:07 +02:00
d56ddf9583 build(windows): fix target check-single-includes
Add missing includes and exclude os-specific files depending on platform
when using the target.
2022-08-13 21:22:07 +02:00
bf0d7ed1f6 build: bump minimum cmake version for all dependencies to 3.10
This removes cmake policy warning for CMP0053 on windows and ensures the
build works correctly for newer cmake policies.
2022-08-13 21:22:07 +02:00
c1cbe3fb3d refactor(screen.c): resolve all clint errors (#19754)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2022-08-13 16:59:15 +02:00
3cf629022b vim-patch:9.0.0198: ml_get error when switching buffer in Visual mode (#19756)
Problem:    ml_get error when switching buffer in Visual mode.
Solution:   End Visual mode when switching buffer. (closes vim/vim#10902)
cfeb8a584b
2022-08-13 21:47:52 +08:00
f9a9956837 ci(release): move release-winget steps into release job #19689 2022-08-13 06:34:28 -07:00
02a4974418 vim-patch:7.4.1168 (#19645)
Problem:    This doesn't give the right result: eval(string(v:true)). (Nikolay
            Pavlov)
Solution:   Make the string "v:true" instead of "true".
f48aa160fd
2022-08-13 21:31:00 +08:00
33b49d5f55 vim-patch:9.0.0197: astro files are not detected (#19755)
Problem:    Astro files are not detected.
Solution:   Add a pattern to match Astro files. (Emilia Zapata, closes vim/vim#10904)
6a76e84f55
2022-08-13 15:11:03 +02:00
9dec3815d2 Merge pull request #19751 from bfredl/tabbar
fix(winbar): do not always assume cursor is valid
2022-08-13 11:17:42 +02:00
33f4ba7379 fix(winbar): do not always assume cursor is valid. fixes #19458 2022-08-13 10:45:21 +02:00
a850b15e19 vim-patch:9.0.0195: metafun files are not recogized (#19746)
Problem:    Metafun files are not recogized.
Solution:   Add filetype detection patterns.
9032b9ceb6
2022-08-13 10:26:12 +02:00
1de62b9ea1 fix(charclass): make behavior with empty str match latest Vim (#19749)
Later Vim patches changed to return 0 for empty string and null string.
Also update setcellwidth() docs to match latest Vim.
2022-08-13 12:25:01 +08:00
754892e59d vim-patch:8.2.{1536,1540}: charclass() (#19748)
vim-patch:8.2.1536: cannot get the class of a character; emoji widths are wrong

Problem:    Cannot get the class of a character; emoji widths are wrong in
            some environments.
Solution:   Add charclass(). Update some emoji widths.  Add script to check
            emoji widths.
4e4473c927

Use latest charclass() docs from Vim.
Rewrite DoIt() in emoji_list.vim in Lua.
Omit emoji table updates:
- emoji_width update looks wrong as these added ranges are only double-width when followed by 0xFE0F.
- Other updates are too old.

vim-patch:8.2.1540: the user cannot try out emoji character widths

Problem:    The user cannot try out emoji character widths.
Solution:   Move the emoji script to the runtime/tools directory.
98945560c1
2022-08-13 11:29:38 +08:00
6f14c5d2dd refactor: remove some unused includes (#19747)
- Remove autocmd.h from fileio.h
- Remove normal.h from main.h
- Move bufinfo_T from undo_defs.h to undo.c
2022-08-13 08:59:11 +08:00
e23c5fda0a build libuv cmake (#19632)
Co-authored-by: Daniel Hahler <git@thequod.de>
2022-08-12 16:59:40 +01:00
b6a963bded Merge pull request #19713 from lewis6991/rmccache
ci(cache): remove ccache
2022-08-12 15:42:59 +02:00
342d18b91e refactor: remove some unused includes (#19740)
Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other
headers.
2022-08-12 21:16:28 +08:00
5b80d20271 ci(cache): remove ccache
It was never in action since migrating from travis to github actions.
2022-08-12 14:07:23 +01:00
ac78639de8 docs: .git-blame-ignore-revs (#18579)
add "refactor(uncrustify): enable formatting for regexp and indent files" (#18549)
2022-08-12 15:05:08 +02:00
54a165d9a6 Merge pull request #19592 from dundargoc/refactor/char_u-to-char
refactor: replace char_u with char
2022-08-12 14:44:28 +02:00
094cdf2d69 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-08-12 14:22:02 +02:00
f79773a3b4 refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)
This avoids including ex_eval.h in any other header, thus preventing
future circular includes.
2022-08-12 19:16:24 +08:00
1cf3a4b409 docs: clarify that cursorline will be disabled before command preview (#19710) 2022-08-12 10:21:50 +02:00
02289ab898 fix(lsp): fix nil value error in get_group (#19735)
`server_capabilities` can be nil until the server is initialized.
Reproduced with:

    vim.lsp.stop_client(vim.lsp.start_client {
      cmd = { vim.v.progpath, '-es', '-u', 'NONE', '--headless' };
    })
2022-08-12 10:10:03 +02:00
103f10d901 refactor: move code dealing with script files to runtime.c (#19734)
vim-patch:8.1.1927: code for dealing with script files is spread out

Problem:    Code for dealing with script files is spread out.
Solution:   Move the code to scriptfile.c. (Yegappan Lakshmanan, closes vim/vim#4861)
307c5a5bb7
2022-08-12 15:41:43 +08:00
d4f5e0db3c Merge pull request #19733 from zeertzjq/vim-8.1.1684
vim-patch:8.1.{1684,1689}: profiling code is spread out
2022-08-12 14:39:47 +08:00
a93d29589a vim-patch:8.1.1689: profiling code is spread out
Problem:    Profiling code is spread out.
Solution:   Move more profiling code to profiler.c. (Yegappan Lakshmanan,
            closes vim/vim#4668)
660a10ad41
2022-08-12 14:15:03 +08:00
c7ca94ba7f vim-patch:8.1.1684: profiling functionality is spread out
Problem:    Profiling functionality is spread out.
Solution:   Put profiling functionality in profiling.c. (Yegappan Lakshmanan,
            closes vim/vim#4666)
fa55cfc69d

Move proftime_T to types.h for now to avoid recursive #include.
2022-08-12 13:44:37 +08:00
0d9e09bf67 test: make Ex mode exit test test what it wants to test (#19728) 2022-08-12 09:04:08 +08:00
33b77eb728 fix(lsp): handle nil client in onexit callback (#19722)
Follow up to https://github.com/neovim/neovim/pull/19658
2022-08-11 19:21:57 +02:00
a27756cc24 fix(signs): priority of extmark signs (#19718) 2022-08-11 17:26:17 +01:00
996fc2256b fix(lsp): avoid pipe leaks if lsp cmd isn't executable (#19717)
The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
2022-08-11 17:04:55 +02:00
8b67f37798 fix(lsp): fix some type annotations in lsp.rpc (#19714) 2022-08-11 15:17:05 +02:00
6669fc94ae docs: add reformat commit to .git-blame-ignore-revs (#19715)
followup to #19685
2022-08-11 14:41:15 +02:00
d1fb0dd8b9 Merge pull request #19685 from ii14/gen_vimdoc_indentation
docs: change gen_vimdoc indentation level
2022-08-11 14:34:00 +02:00
ea333badd2 docs: regenerate 2022-08-11 14:25:48 +02:00
d2975d58cb docs: change gen_vimdoc indentation to 4 spaces 2022-08-11 14:25:18 +02:00
94c3176478 refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)
vim-patch:8.2.0559: clearing a struct is verbose

Problem:    Clearing a struct is verbose.
Solution:   Define and use CLEAR_FIELD() and CLEAR_POINTER().
a80faa8930
2022-08-11 15:44:55 +08:00
252dea5927 build(deps): bump LuaJIT to HEAD - 633f265f6 (#19703) 2022-08-11 08:53:15 +02:00
b4b22318a1 Merge pull request #19704 from bfredl/ceci-nest-pas-un-bool
fix(mpack): make sure a `bool` always is a `bool`
2022-08-10 22:31:53 +02:00
faccae47fc fix(mpack): make sure a bool always is a bool
before, RelWithDebInfo linking gave this warning:

    src/mpack/conv.h:36:16: warning: type of ‘mpack_unpack_boolean’ does not match original declaration [-Wlto-type-mismatch]
       36 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t) FUNUSED FPURE;
          |                ^
    src/mpack/conv.c:196:16: note: return value type mismatch
      196 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t)
          |                ^
2022-08-10 20:36:28 +02:00
ff1266aaaa vim-patch:9.0.0182: quarto files are not recognized (#19702)
Problem:    Quarto files are not recognized.
Solution:   Recognize quarto files by the extension. (Jonas Strittmatter,
            closes vim/vim#10880)
3a9687fb27
2022-08-10 13:44:57 +02:00
78658ef383 fix(api): vim.cmd.make crashes when argument count isn't 1 (#19701)
Closes #19696
2022-08-10 18:37:59 +08:00
3ee6c05b4b Merge pull request #19693 from clason/bump-gha-ubuntu 2022-08-10 08:55:25 +02:00
512e0441f1 docs: fix some mistakes and missing docs (#19699) 2022-08-10 12:47:38 +08:00
bebfbfab3b fix(lsp): handle multiple clients with incremental sync (#19658)
The change tracking used a single lines/lines_tmp table to track
changes to a buffer.

If multiple clients using incremental sync are connected to a buffer,
they both made changes to the same lines table. That resulted in an
inconsistent state.

This commit changes the didChange handling to group clients by
synchronization scheme and offset encoding.
This avoids computing the diff multiple times for clients using the
same scheme and resolves the lines/lines_tmp conflicts.

Fixes https://github.com/neovim/neovim/issues/19325
2022-08-09 22:20:40 +02:00
d212dfd676 ci(release): build with standard gcc on Ubuntu
Ubuntu-20.04 ships with GCC 10.3.0, which is enough to avoid #14150
2022-08-09 18:10:18 +02:00
48241c3b23 ci(release): bump deprecated ubuntu image to 20.04
`ubuntu-18.04` is now deprecated and subject to outages, see
  https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/
2022-08-09 18:10:18 +02:00
3030b4d653 feat(tui): allow grid and host to disagree on ambiguous-width chars (#19686)
Note: This only applies to ambiguous-width characters.
2022-08-09 21:08:46 +08:00
24bf0490ea vim-patch:9.0.0176: checking character options is duplicated and incomplete (#19690)
Problem:    Checking character options is duplicated and incomplete.
Solution:   Move checking to check_chars_options(). (closes vim/vim#10863)
8ca29b6a35
2022-08-09 20:35:34 +08:00
33ddca6fa0 docs(lua): add luv (vim.loop) reference manual (#19679)
Upstreamed from https://github.com/nanotee/luv-vimdocs with kind
permission from @nanotee.
2022-08-09 13:21:50 +02:00
cd14efd281 vim-patch:8.1.1823: command line history code is spread out (#19688)
Problem:    Command line history code is spread out.
Solution:   Put the code in a new file. (Yegappan Lakshmanan, closes vim/vim#4779)
            Also graduate the +cmdline_hist feature.
d7663c22c6
2022-08-09 17:13:44 +08:00
a5e846b996 vim-patch:partial: 48c3f4e0bff7 (#19684)
vim-patch:partial:48c3f4e0bff7

Update runtime files
48c3f4e0bf

partially skip `options.txt` (needs 9.0.0138)
2022-08-09 10:43:28 +02:00
e6680ea7c3 docs(lua): add Lua 5.1 reference manual (#19663)
based on http://www.vim.org/scripts/script.php?script_id=1291
reformatted to match Nvim documentation style; removed irrelevant sections

Co-authored-by: dundargoc <gocundar@gmail.com>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2022-08-08 18:58:32 +02:00
68c674af0f feat(lsp): set formatexpr by default (#19677)
Follow up to https://github.com/neovim/neovim/pull/19003
2022-08-08 18:30:17 +02:00
d31ee6664d test: increse expect_exit() timeouts (#19680)
A timeout of 100 milliseconds is sometimes still too short for macOS.
Change it to 1000 milliseconds.
2022-08-08 22:04:21 +08:00
d36c2fa713 Merge pull request #19674 from zeertzjq/vim-8.2.1535
vim-patch:8.2.{1535,1537,3545}: setcellwidths()
2022-08-08 21:20:27 +08:00
603f7bd253 fix(fillchars): change fallback after setcellwidths() 2022-08-08 20:03:40 +08:00
9fedb6fd78 vim-patch:8.2.3545: setcellwidths() may make 'listchars' or 'fillchars' invalid
Problem:    setcellwidths() may make 'listchars' or 'fillchars' invalid.
Solution:   Check the value and give an error. (closes vim/vim#9024)
94358a1e6e

Cherry-pick f_setcellwidths() change from patch 9.0.0036.
Cherry-pick 'ambiwidth' docs update from runtime update 079ba76ae7a7.
2022-08-08 20:03:40 +08:00
01a7009af9 refactor(setcellwidths): use TV_LIST_ITEM_NEXT properly 2022-08-08 20:03:40 +08:00
967415d527 vim-patch:8.2.1537: memory acccess error when using setcellwidths()
Problem:    Memory acccess error when using setcellwidths().
Solution:   Use array and pointers correctly.
b06a6d59d1
2022-08-08 20:03:40 +08:00
53c9500c1d vim-patch:8.2.1535: it is not possible to specify cell widths of characters
Problem:    It is not possible to specify cell widths of characters.
Solution:   Add setcellwidths().
08aac3c619

Co-Authored-By: delphinus <me@delphinus.dev>
2022-08-08 20:03:40 +08:00
bc8fbb7c1d refactor: move non-symbols in mbyte.h to mbyte_defs.h
This just avoids including mbyte.h in eval/typval.h, so that mbyte.h can
include eval/typval.h in Vim patch 8.2.1535.
2022-08-08 20:03:40 +08:00
a46e6afb8b fix(lsp): set end_col in formatexpr (#19676)
The last line was excluded from formatting via formatexpr because the
character in the params was set to 0 instead of the end of line.
2022-08-08 13:02:15 +02:00
2d5fce2cdb feat(lsp): disable exit_timeout by default (#19672)
The lsp client used to wait up to 500ms for a language server to
shutdown before sending a TERM signal.

The intention behind the 500ms grace period was to ensure the language
server exits to prevent stale processes, but it has the side-effect that
it can interrupt language-servers which are too slow to shutdown within
500ms. Language servers tend to write out index files or project files
on shutdown, and being interrupted during this process can cause
corruption of those files.

This changes the default to not wait at all, at the risk of leaving
stale processes around if the language server isn't well behaved.

An alternative would be to wait indefinitely, but that can cause neovim
to take several seconds to exit.
2022-08-08 12:34:37 +02:00
18766e742b fix(folds): fix fold remains when :delete makes buffer empty (#19673) 2022-08-08 06:07:59 +08:00
629169462a fix(terminal): skip aucmd_win when checking terminal size (#19668) 2022-08-07 19:43:29 +08:00
fa8b2b4c50 vim-patch:8.2.4492: no error if an option is given a value with ":let &opt = val" (#19670)
Problem:    No error if an option is given an invalid value with
            ":let &opt = val".
Solution:   Give the error. (closes vim/vim#9864)
8ccbbeb620
2022-08-07 17:11:03 +08:00
fea15adad3 Merge pull request #19669 from zeertzjq/vim-8.2.1278
vim-patch:8.2.{1278,1280,1281}: error message improvements
2022-08-07 15:22:48 +08:00
48051ed62c vim-patch:8.2.1281: the "trailing characters" error can be hard to understand
Problem:    The "trailing characters" error can be hard to understand.
Solution:   Add the trailing characters to the message.
2d06bfde29
2022-08-07 14:39:19 +08:00
d0686540f5 vim-patch:8.2.1280: Ex command error cannot contain an argument
Problem:    Ex command error cannot contain an argument.
Solution:   Add ex_errmsg() and translate earlier.  Use e_trailing_arg where
            possible.
8930caaa1a

Remove duplicate test file 062_tab_pages_spec.lua
2022-08-07 14:38:57 +08:00
3b7fc5f793 vim-patch:8.2.1278: Vim9: line break after "->" only allowed in :def function
Problem:    Vim9: line break after "->" only allowed in :def function.
Solution:   Only allow line break after "->". (closes vim/vim#6492)
dd1a9af00f
2022-08-07 13:47:40 +08:00
0fdf59ac9d fix(api): nvim_cmd handle 0 range (#19655)
Fixes #19608
2022-08-06 13:53:37 +01:00
0df1418ffa vim-patch:8.2.1873: Vim9: missing white space when using <f-args> (#19657)
Problem:    Vim9: missing white space when using <f-args>.
Solution:   Add spaces. (Christian J. Robinson)
20d89e0ac6
2022-08-06 20:05:46 +08:00
5eb8119dce vim-patch:8.2.3282: Vim9: error about using -complete without -nargs is confusing (#19656)
Problem:    Vim9: error about using -complete without -nargs is confusing.
Solution:   Change the wording.
41a3485dd6
2022-08-06 19:18:43 +08:00
ad7064bd83 vim-patch:8.1.1210: support for user commands is spread out (#19653)
Problem:    Support for user commands is spread out. No good reason to make
            user commands optional.
Solution:   Move user command support to usercmd.c.  Always enable the
            user_commands feature.
ac9fb18020
2022-08-06 17:14:37 +08:00
5f0fbe7c2f vim-patch:8.1.0942: options window still checks for the multi_byte feature (#19652)
Problem:    Options window still checks for the multi_byte feature.
Solution:   Remove the unnecessary check. (Dominique Pelle, closes vim/vim#3990)
76cbe811da
2022-08-06 08:29:57 +08:00
a308f53525 fix(api): fix nvim_buf_set_text heap-use-after-free (#19644)
The line returned but ml_get_buf() may be freed by another call to
ml_get_buf(), so it is necessary to make a copy.
2022-08-06 06:22:01 +08:00
85ad0e6b43 fix(lsp): avoid ^M character in hover window on Windows (#19640) 2022-08-05 15:23:01 +02:00
58e1c6fbff test(old): clear builtin menus before running tests (#19647)
Otherwise Test_menu_expand() fails when run alone.
2022-08-05 18:50:20 +08:00
21f5aee777 vim-patch:9.0.0141: "delmenu" does not remove autocmmands (#19646)
Problem:    "delmenu" does not remove autocmmands. Running menu test function
            alone fails.
Solution:   Delete autocommands Make sure there is at least one menu.
            (closes vim/vim#10848)
206fce307b
2022-08-05 12:23:41 +02:00
7ebcb9b333 docs: improve example in incremental preview section (#19613)
- Separate preview and callback functions to make the example easier to understand
- Use false instead of 0 for boolean arguments in API function calls
- Remove explicit nil checks for consistency
- Format with stylua
2022-08-05 10:16:26 +08:00
a78606ec53 test(let_spec): increase expect_exit() timeout
Test ":unlet self-referencing node in a List graph #6070" feeds many characters into typeahead, so a timeout of only 100 milliseconds sometimes fails. Change that timeout to 1000 milliseconds.
2022-08-05 08:32:54 +08:00
37ab823e6e Merge pull request #19642 from zeertzjq/vim-8.2.0413
vim-patch:8.2.{0413,0478},9.0.0009: menu patches
2022-08-05 08:27:40 +08:00
3aef2b8bdf vim-patch:9.0.0009: going past the end of a menu item with only modifier
Problem:    Going past the end of a menu item with only modifier.
Solution:   Check for NUL.
083692d598
2022-08-05 07:58:38 +08:00
57fbcc6929 vim-patch:8.2.0478: new buffers are not added to the Buffers menu
Problem:    New buffers are not added to the Buffers menu.
Solution:   Turn number into string. (Yee Cheng Chin, closes vim/vim#5864)
5908fdf72f
2022-08-05 07:56:56 +08:00
d985323c55 vim-patch:8.2.0413: buffer menu does not handle special buffers properly
Problem:    Buffer menu does not handle special buffers properly.
Solution:   Keep a dictionary with buffer names to reliably keep track of
            entries.
            Also trigger BufFilePre and BufFilePost for command-line and
            terminal buffers when the name changes.
5e94a29ebb
2022-08-05 07:53:54 +08:00
c1e1d16fca Merge pull request #19638 from zeertzjq/vim-8.2.0385
vim-patch:8.2.{0385,0392,3459}: menu_info()
2022-08-05 07:25:23 +08:00
5170a4a369 vim-patch:8.2.3459: Vim9: need more tests for empty string arguments
Problem:    Vim9: need more tests for empty string arguments.
Solution:   Add more tests.  Also use empty argument with menu_info() to get
            the top-level menu names. (Yegappan Lakshmanan, closes vim/vim#8925)
51491adfa8
2022-08-05 06:47:24 +08:00
93649cefab vim-patch:8.2.0392: Coverity warns for using array index out of range
Problem:    Coverity warns for using array index out of range.
Solution:   Add extra "if" to avoid warning.
56cb337872
2022-08-05 06:47:24 +08:00
77926b6493 vim-patch:8.2.0385: menu functionality insufficiently tested
Problem:    Menu functionality insufficiently tested.
Solution:   Add tests.  Add menu_info(). (Yegappan Lakshmanan, closes vim/vim#5760)
0eabd4dc8f

Omit feedkeys() change: even if "L" flag is implemented it will likely
use input_enqueue(), which already checks for interrupts.

Omit Test_mouse_popup_menu(): already tested in Lua.
2022-08-05 06:47:24 +08:00
69299380ca fix(menu): make :menu still print header when there are no menus 2022-08-05 06:29:05 +08:00
27ce21ac85 vim-patch:partial:8.2.0897: list of functions in patched version is outdated (#19637)
Problem:    List of functions in patched version is outdated.
Solution:   Update the function lists only.
ebacddbc16
2022-08-04 11:05:49 +08:00
7c997dbc5d fix(lsp): prevent unexpected position jumps (#19370) 2022-08-03 21:44:33 +02:00
43cd91a4f4 Merge #19626 build: cleanup old cmake files 2022-08-03 07:54:53 -07:00
0a29267514 fix(completion): remove wrong FUNC_ATTR_NONNULL_ALL (#19627) 2022-08-03 21:50:14 +08:00
3df8d9b8c5 feat(lua): print source locations of lua callbacks (#19597)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-08-03 13:41:17 +01:00
c57e133e50 fix(ui): set redraw_cmdline when setting window height (#19630) 2022-08-03 19:25:03 +08:00
5ee56f95c7 Merge pull request #19540 from lewis6991/cmd_refactor 2022-08-03 11:44:17 +01:00
d3bfc03c5d build: remove InstallClintErrors.cmake
Replace its functionality by copying the entire directory where the
reports are instead.
2022-08-03 09:52:05 +02:00
ba3742ed0d build: remove unused file i386-linux-gnu.toolchain.cmake
It was used in .travis.yml which has been removed.
2022-08-03 09:52:05 +02:00
6e2c6114f9 build: replace deprecated cmake features with their modern alternatives
- Use DIRECTORY instead of PATH in get_filename_component
- Use COMPILE_OPTIONS instead of COMPILE_FLAGS. COMPILE_FLAGS is treated
  as a single string while COMPILE_OPTIONS is a list, meaning that cmake
  will take care of any escaping and quoting automatically.
2022-08-03 09:52:05 +02:00
b8dcbcc732 docs: fix typos (#19588)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: notomo <notomo.motono@gmail.com>
2022-08-03 09:47:16 +08:00
cc1ceebf8f refactor: quickfix.c (#19603)
Simplify variable declarations

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-08-02 23:16:07 +01:00
0806c882cd Merge pull request #19584 from bfredl/terminal_c_BSL_c_O
implement <c-\><c-o> key for terminal mode
2022-08-02 14:53:20 +02:00
def0ced4c7 fix(tabpage): check if ROWS_AVAIL changed for resize (#19620)
N/A patches for version.c:

vim-patch:9.0.0135: comment about tabpage line above the wrong code

Problem:    Comment about tabpage line above the wrong code.
Solution:   Move the comment. (closes vim/vim#10836)
0b0ccbbfb0
2022-08-02 20:48:41 +08:00
9092540315 feat(terminal): implement <c-\><c-o> for terminal mode
this works similar to <c-o> or <c-\><c-o> in insert mode
2022-08-02 13:54:41 +02:00
8ce7e7409f build: add formatting targets for c and lua files (#19488)
The targets will only format files that have been changed in current
branch compared to the master branch. This includes unstaged, staged and
committed files.

Add following make and cmake targets:
formatc   - format changed c files
formatlua - format changed lua files
format    - run formatc and formatlua

Remove scripts/uncrustify.sh as this deprecates it.
2022-08-02 12:32:57 +02:00
c223875a65 refactor: rename function prefix mb to the more accurate utf_cp (#19590)
The "cp" stands for codepoint.

Closes https://github.com/neovim/neovim/issues/7401
2022-08-02 11:52:33 +02:00
dc2745e9ea refactor(cmd): unify execute_cmd with do_one_cmd 2022-08-02 10:46:14 +01:00
dc24cb668c refactor(cmd): hoist out some code into functions 2022-08-02 10:32:00 +01:00
1f847edc63 refactor(cmd): format do_one_cmd()
- Comment style
- Minimise scope of locals
2022-08-02 10:32:00 +01:00
0a049c322f test: improve mapping tests and docs (#19619) 2022-08-02 11:13:22 +08:00
9c91d5c613 Merge pull request #19617 from zeertzjq/vim-8.2.4956
vim-patch:8.2.{4899,4956,5013}
2022-08-02 06:57:49 +08:00
50672e3850 vim-patch:8.2.5013: after text formatting cursor may be in an invalid position
Problem:    After text formatting the cursor may be in an invalid position.
Solution:   Correct the cursor position after formatting.
78d52883e1
2022-08-02 05:58:51 +08:00
4f576be881 vim-patch:8.2.4956: reading past end of line with "gf" in Visual block mode
Problem:    Reading past end of line with "gf" in Visual block mode.
Solution:   Do not include the NUL in the length.
395bd1f6d3

Omit trailing space: removed in patch 9.0.0126.
2022-08-02 05:58:51 +08:00
c57c25649b vim-patch:8.2.4899: with latin1 encoding CTRL-W might go before the cmdline
Problem:    With latin1 encoding CTRL-W might go before the start of the
            command line.
Solution:   Check already being at the start of the command line.
ef02f16609
2022-08-02 05:58:51 +08:00
d4b9f8186d vim-patch:9.0.0126 (#19612)
vim-patch:9.0.0126: expanding file names fails in dir with more than 255 entries

Problem:    Expanding file names fails in directory with more than 255
            entries.
Solution:   Use an int instead of char_u to count. (John Drouhard,
            closes vim/vim#10818)
95fca12b0e
2022-08-02 05:39:23 +08:00
e99de3f12f fix(lsp): send didOpen if name changes on write (#19583)
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.

Closes https://github.com/neovim/neovim/issues/18688
2022-08-01 22:32:53 +02:00
711ef4eac9 vim-patch:05a8061eecd9 (#19610)
Update runtime files
05a8061eec
2022-08-01 17:13:53 +02:00
c6181a672a feat(node): add pnpm support #19461 2022-08-01 07:21:54 -07:00
8d1c55e422 Merge pull request #19602 from zeertzjq/vim-8.2.0807
vim-patch:8.2.{0807,0809,0812,0815,0832,1773,2804,4831,5106},9.0.0127: first part of mapset()
2022-08-01 22:19:30 +08:00
d954e8da62 feat(mapset): support restoring "replace_keycodes" and "desc" 2022-08-01 21:54:18 +08:00
cabb23ea4d test: fix api/keymap_spec.lua tests 2022-08-01 21:54:18 +08:00
8a032a6866 vim-patch:8.2.5106: default cmdwin mappings are re-mappable
Problem:    Default cmdwin mappings are re-mappable.
Solution:   Make the default mappings not re-mappable. (closes vim/vim#10580)  Use
            symbols for the first do_map() argument.
44068e97db
2022-08-01 21:54:18 +08:00
9cebfbe6ab vim-patch:8.2.4831: crash when using maparg() and unmapping simplified keys
Problem:    Crash when using maparg() and unmapping simplified keys.
Solution:   Do not keep a mapblock pointer. (closes vim/vim#10294)
2c8a7ebdad

N/A patches for version.c:

vim-patch:8.2.0832: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Add initial value.
a55ba06f69
2022-08-01 21:54:18 +08:00
34e7dc5d05 vim-patch:8.2.2804: setting buffer local mapping with mapset() changes global
Problem:    Setting buffer local mapping with mapset() changes global mapping.
Solution:   Only set the local mapping. (closes vim/vim#8143)
7ba1e4d363
2022-08-01 21:54:18 +08:00
7d45f1a5e8 vim-patch:8.2.1773: crash when calling mapset() with a list as first argument
Problem:    Crash when calling mapset() with a list as first argument.
Solution:   Check for NULL. (closes vim/vim#7040)
1b9129809d
2022-08-01 21:54:18 +08:00
6963c2bdcd vim-patch:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

vim-patch:9.0.0127: unused variable

Problem:    Unused variable.
Solution:   Remove the variable. (closes vim/vim#10829)
e95f22f63a
2022-08-01 21:54:18 +08:00
5c72640bc2 vim-patch:8.2.0812: mapset() does not properly handle <> notation
Problem:    mapset() does not properly handle <> notation.
Solution:   Convert <> codes. (closes vim/vim#6116)
c94c1467b9
2022-08-01 21:54:18 +08:00
083865071b vim-patch:8.2.0807: cannot easily restore a mapping
Problem:    Cannot easily restore a mapping.
Solution:   Add mapset().
4c9243f9fb

Use MapArgument to reduce number of arguments of map_add().

N/A patches for version.c:

vim-patch:8.2.0809: build failure with small features

Problem:    Build failure with small features. (Tony Mechelynck)
Solution:   Move "expr" inside #ifdef.
5a80f8ad5d
2022-08-01 21:54:18 +08:00
db6e93c48d feat(api): add replace_keycodes to nvim_set_keymap (#19598) 2022-08-01 21:35:08 +08:00
9f5d5aa3da Use Strings instead of Tables in vim.filetype.matchregex Doc (#19604)
docs: use strings instead of tables in vim.filetype.matchregex doc
2022-08-01 06:45:43 -06:00
ece0850b73 fix(session): respect sessionoptions=terminal #19497
fixes #13078

Co-authored-by: Yuta Katayama <8683947+yutkat@users.noreply.github.com>
2022-08-01 05:13:46 -07:00
bcb4186cf6 refactor: replace_makeprg (#19570) 2022-08-01 12:02:53 +01:00
8952def50a Merge pull request #19595 from zeertzjq/vim-9.0.0124
vim-patch:9.0.0124: code has more indent than needed
2022-08-01 07:22:24 +08:00
975a273125 test(old): unskip test that already passes 2022-08-01 06:54:35 +08:00
c9ca90229b vim-patch:9.0.0124: code has more indent than needed
Problem:    Code has more indent than needed.
Solution:   Use continue and return statements. (closes vim/vim#10824)
101d57b34b
2022-08-01 06:18:52 +08:00
68ec497d52 Merge pull request #19437 from dundargoc/refactor/char_u-to-char
refactor: replace char_u with char
2022-07-31 15:55:01 +02:00
86110ec933 fix(highlight): add missing 'nocombine' to nvim_get_hl_* apis (#19586) 2022-07-31 13:38:00 +02:00
380417c1dd Merge pull request #19587 from Shougo/vim-9.0.0114
vim-patch:9.0.{0114,0115,0118}
2022-07-31 19:13:45 +08:00
2c522854c7 vim-patch:9.0.0118: no test for what patch 9.0.0155 fixes
Problem:    No test for what patch 9.0.0155 fixes.
Solution:   Add a test. Fix typos.  (closes vim/vim#10822)
750209459c
2022-07-31 18:51:06 +08:00
63244f68e7 vim-patch:9.0.0115: when 'cmdheight' is zero pressing ':' may scroll a window
Problem:    When 'cmdheight' is zero pressing ':' may scroll a window.
Solution:   Add the made_cmdheight_nonzero flag and set 'scrolloff' to zero.
6747cf1671
2022-07-31 17:15:36 +08:00
81a1d26c3e vim-patch:9.0.0114: the command line takes up space even when not used
Problem:    The command line takes up space even when not used.
Solution:   Allow for 'cmdheight' to be set to zero. (Shougo Matsushita,
            closes vim/vim#10675, closes vim/vim#940)
f39cfb7262

Omit win_redr_ruler() change: winbar may still need redraw.
Omit win_update() changes: Nvim doesn't use `Rows` there.
Omit redraw_asap(): removed.
2022-07-31 17:15:36 +08:00
abc087f4c6 docs: fix typos (#19024)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
2022-07-31 16:46:38 +08:00
c1652bdcb5 cmdheight=0: fix bugs part2 (#19185) 2022-07-31 13:13:19 +08:00
7f4c50f8c4 Merge pull request #19582 from clason/vim-9.0.0111
vim-patch:9.0.0111: "nocombine" is missing from synIDattr()
2022-07-31 09:19:10 +08:00
0ae94a128f test: rewrite Test_missing_attr() in Lua 2022-07-31 08:51:20 +08:00
824a729628 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-07-31 00:52:59 +02:00
29d5ca7d66 vim-patch:9.0.0111: "nocombine" is missing from synIDattr()
Problem:    "nocombine" is missing from synIDattr().
Solution:   Add "nocombine". (Munif Tanjim, closes vim/vim#10816)
de78632c41
2022-07-31 06:25:57 +08:00
9511faa819 vim-patch:9.0.0109: writing over the end of a buffer on stack (#19581)
Problem:    Writing over the end of a buffer on stack when making list of
            spell suggestions.
Solution:   Make sure suggested word is not too long. (closes vim/vim#10812)
1eead4cf1d
2022-07-31 05:48:24 +08:00
fc5ed5b672 Merge pull request #19524 from dundargoc/refactor/conversion-screen
refactor: enable -Wconversion warning for screen.c
2022-07-30 22:53:51 +02:00
aa9ba05d70 refactor: enable -Wconversion warning for screen.c
Closes https://github.com/neovim/neovim/issues/567
2022-07-30 17:15:27 +02:00
6237ac8402 vim-patch:2ecbe53f452e (#19577)
Update runtime files
2ecbe53f45
2022-07-30 15:48:32 +02:00
d36d9be8ff fix(terminal): avoid reading over the end of cell.chars (#19580) 2022-07-30 21:40:30 +08:00
c34d72bf7c refactor: enable -Wconversion warning for spell.c (#19538)
Work on https://github.com/neovim/neovim/issues/567
2022-07-30 20:59:34 +08:00
e59bc078de fix(screen): check for col instead of vcol when drawing fold (#19572) 2022-07-29 21:47:21 +08:00
02efdb4d58 refactor: fix clang and PVS warnings (#19569)
The last commit didn't actually disable V1028 because of a typo.
Fix the typo so it is actually disabled.
2022-07-29 14:44:18 +08:00
0b8bade493 build(pvscheck): disable PVS/V1028 (#19553)
Most casts where PVS warns for V1028 aren't added to prevent overflows
in the first place, but to avoid other warnings, like printf argument or
-Wconversion warnings. PVS/V1028 is more annoying than useful.
2022-07-29 10:32:00 +08:00
1ebe7cd160 refactor: enable -Wconversion warning for syntax.c (#19533)
Work on https://github.com/neovim/neovim/issues/567
2022-07-29 10:05:29 +08:00
88ed33230a vim-patch:9.0.0101: invalid memory access in diff mode with "dp" and undo (#19568)
Problem:    Invalid memory access in diff mode with "dp" and undo.
Solution:   Make sure the line number does not go below one.
4e677b9c40
2022-07-29 07:31:54 +08:00
352a177dae vim-patch:9.0.0026: accessing freed memory with diff put (#19564)
Problem:    Accessing freed memory with diff put.
Solution:   Bail out when diff pointer is no longer valid.
c5274dd122
2022-07-29 06:53:32 +08:00
b25abbf4b8 docs(lsp): use direct link to formattingOptions in format docs (#19558)
Also changes `@see` to `See` to avoid the break to a dedicated "See
also" block in the generated vimdoc
2022-07-28 19:41:30 +02:00
98915f88b2 feat(lsp): add range option to code_action; deprecate range_code_action (#19551)
`code_action` gained extra functions (`filter` and `apply`) which
`range_code_action` didn't have.

To close this gap, this adds a `range` option to `code_action` and
deprecates `range_code_action`.

The option defaults to the current selection if in visual mode.
This allows users to setup a mapping like `vim.keymap.set({'v', 'n'},
'<a-CR>', vim.lsp.buf.code_action)`

`range_code_action` used to use the `<` and `>` markers to get the
_last_ selection which required using a `<Esc><Cmd>lua
vim.lsp.buf.range_code_action()<CR>` (note the `<ESC>`) mapping.
2022-07-28 19:19:07 +02:00
468b1a689a build(deps): bump LuaJIT to HEAD - a7d026548 (#19565) 2022-07-28 18:02:26 +02:00
161efc9ea4 Merge pull request #19486 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for lua/treesitter.c
2022-07-28 14:31:26 +02:00
f254fc67a5 vim-patch:9.0.0099: scrollback can be wrong after redrawing the command line (#19562)
Problem:    Scrollback can be wrong after redrawing the command line.
Solution:   Clear unfinished scrollback when redrawing. (closes vim/vim#10807)
46af7bc08d
2022-07-28 20:07:32 +08:00
9cb8b5f8db vim-patch:9.0.0097: long quickfix line is truncated for :clist (#19561)
Problem:    Long quickfix line is truncated for :clist.
Solution:   Allocate a buffer if needed.
5f30e26f69
2022-07-28 19:49:18 +08:00
b4e12bfa00 refactor: enable -Wconversion warning for spellfile.c (#19527)
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 18:49:46 +08:00
7304b7eee3 refactor: enable -Wconversion warning for lua/treesitter.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 12:13:06 +02:00
b971547c54 build(deps): bump LuaJIT to HEAD - e1339aed3 (#19536) 2022-07-28 09:18:22 +02:00
fe254fb7e7 Merge pull request #19556 from zeertzjq/vim-9.0.0061
vim-patch:9.0.{0061,partial:0077,0094}
2022-07-28 12:22:00 +08:00
0134a2cb3e vim-patch:9.0.0094: cursor restored unexpected with nested autocommand
Problem:    Cursor restored unexpected with nested autocommand.
Solution:   Do not restore the cursor when it was moved intentionally.
            (closes vim/vim#10780)
3d6ee8bda0
2022-07-28 11:40:35 +08:00
394d65494a vim-patch:partial:9.0.0077: wrong restored cursor position when switching window in autocmd
Problem:    When switching window in autocmd the restored cursor position may
            be wrong.
Solution:   Do not restore the cursor if it was not set. (closes vim/vim#10775)
b03950fafa

This patch cannot be fully ported because it depends on patch 8.2.3518.
2022-07-28 11:38:02 +08:00
8e67af1b20 vim-patch:9.0.0061: ml_get error with nested autocommand
Problem:    ml_get error with nested autocommand.
Solution:   Also check line numbers for a nested autocommand. (closes vim/vim#10761)
5fa9f23a63
2022-07-28 11:38:02 +08:00
bdbf843031 vim-patch:8.2.3912: the ins_complete() function is much too long (#19555)
Problem:    The ins_complete() function is much too long.
Solution:   Split it up into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9414)
bf7ff61af4
2022-07-28 11:35:13 +08:00
f1c01e5f94 Merge pull request #19554 from zeertzjq/vim-9.0.0095
vim-patch:9.0.{0095,0096}: remove dead code
2022-07-28 07:17:11 +08:00
721ea8fab2 vim-patch:9.0.0096: flag "new_value_alloced" is always true
Problem:    Flag "new_value_alloced" is always true.
Solution:   Remove "new_value_alloced". (closes vim/vim#10792)
f6782732ab
2022-07-28 06:48:36 +08:00
e6b7f70294 vim-patch:9.0.0095: conditions are always true
Problem:    Conditions are always true.
Solution:   Remove useless conditions. (closes vim/vim#10802)
122dea7007
2022-07-28 06:45:22 +08:00
e0eebe3087 refactor: enable -Wconversion warning for window.c (#19537)
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 23:39:52 +01:00
dadb0d6f01 refactor: enable -Wconversion warning for eval/funcs.c (#19541)
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 23:37:39 +01:00
d27e4d657b perf(api): optimize nvim_cmd (#19513)
Reduce the amount of string allocations and length calculations.

With the following benchmark:

```lua
total = 0
for _ = 1, loops do
  local start = now()
  vim.api.nvim_cmd({cmd = 'let', args = {'a', '=', '1'}}, {})
  total = total + (now() - start)
end
print('nvim_cmd', total / loops)
```

```
hyperfine 'nvim --clean test.lua +source +q'
```

Before: 234.5ms
After:  173.8ms
2022-07-27 23:35:01 +01:00
48608a1f46 refactor: enable -Wconversion warning for regexp files (#19521)
Work on https://github.com/neovim/neovim/issues/567
2022-07-28 06:08:20 +08:00
e0c433833f refactor: fix clang and PVS warnings (#19532) 2022-07-28 06:05:33 +08:00
7d9e68669c vim-patch:9.0.0092: plugins cannot change v:completed_item (#19542)
Problem:    Plugins cannot change v:completed_item.
Solution:   Make v:completed_item writeable. (Shougo Matsushita,
            closes vim/vim#10801)
61021aa318
2022-07-28 05:19:38 +08:00
b6b9f46041 Merge pull request #19525 from dundargoc/refactor/conversion-search
refactor: enable -Wconversion warning for search.c
2022-07-27 19:07:45 +02:00
18755c6b89 Merge pull request #19516 from dundargoc/refactor/conversion-mbyte
refactor: enable -Wconversion warning for mbyte.c
2022-07-27 19:00:40 +02:00
f5d558c8ea feat(lsp): provide feedback if server can't compute rename result (#19546)
Without some form of feedback a user cannot easily tell if the server is
still computing the result (which can take a while in large projects),
or whether the server couldn't compute the rename result.
2022-07-27 18:56:27 +02:00
888f12858a fix(lsp): set workspace.configuration capability (#19548)
Neovim implements `workspace/configuration`
It should set the capability accordingly.

From https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities:

    /**
     * The client supports `workspace/configuration` requests.
     *
     * @since 3.6.0
     */
    configuration?: boolean;
2022-07-27 18:55:44 +02:00
4c3104819b vim-patch:9.0.0093: sway config files are recognized as i3config (#19545)
Problem:    Sway config files are recognized as i3config.
Solution:   Recognize swayconfig separately. (James Eapen, closes vim/vim#10672)
7abd1c6d8e
2022-07-27 18:11:59 +02:00
9b447c7ce5 vim-patch:9.0.0088: pattern for detecting bitbake files is not sufficient (#19547)
Problem:    Pattern for detecting bitbake files is not sufficient.
Solution:   Adjust the pattern. (Gregory Anders, closes vim/vim#10743)
30e212dac1
2022-07-27 10:06:09 -06:00
3a40d4b759 refactor: enable -Wconversion warning for search.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 16:51:25 +02:00
f57432af4d vim-patch:9.0.0090: no error when assigning bool to a string option (#19539)
Problem:    No error when assigning bool to a string option with setwinvar().
Solution:   Give an error (closes vim/vim#10766)
28f84e17b0
2022-07-27 20:59:43 +08:00
335b49e129 refactor: enable -Wconversion warning for mbyte.c
Work on https://github.com/neovim/neovim/issues/567
2022-07-27 13:14:33 +02:00
e0f32abb1c Merge pull request #19518 from dundargoc/build/openbsd/no-versions
ci(openbsd): don't specify versions for dependencies if possible
2022-07-27 06:27:51 -04:00
57ce6c2b8f Merge pull request #19531 from zeertzjq/vim-8.2.4623
vim-patch:8.2.{4623,4625}: coverity warnings
2022-07-27 12:27:42 +08:00
bbad7371db vim-patch:8.2.4625: old Coverity warning for resource leak
Problem:    Old Coverity warning for resource leak.
Solution:   Call FreeWild() if expanding matches did not fail.
90da27b927
2022-07-27 12:00:56 +08:00
f586131e57 vim-patch:8.2.4623: Coverity warns for using uninitialized field
Problem:    Coverity warns for using uninitialized field.
Solution:   Initialize he field to zero.
03a297c63f

Also only initialize used fields in f_fullcommand().
2022-07-27 12:00:52 +08:00
79872f3770 fix(options): properly free string options (#19510) 2022-07-27 07:26:32 +08:00
890d4023cd vim-patch:9.0.0081: command line completion of user command may have duplicates (#19529)
Problem:    Command line completion of user command may have duplicates.
            (Dani Dickstein)
Solution:   Skip global user command if an identical buffer-local one is
            defined. (closes vim/vim#10797)
c2842adfb2
2022-07-27 07:25:47 +08:00
2fdb0de197 Merge pull request #19528 from zeertzjq/vim-9.0.0051
vim-patch:9.0.{0051,0082,0083,0086}: cmdline fixes
2022-07-27 07:25:13 +08:00
fc55f8263c vim-patch:9.0.0086: tabline is not redrawn when entering command line
Problem:    Tabline is not redrawn when entering command line.
Solution:   Set "redraw_tabline". (closes vim/vim#10771)
6791adca53
2022-07-27 06:32:40 +08:00
0c0a2e4e52 vim-patch:9.0.0083: ModeChanged event not triggered when leaving cmdline window
Problem:    ModeChanged event not triggered when leaving the cmdline window.
Solution:   Call may_trigger_modechanged(). (closes vim/vim#10791)
c9e8fd6fc7

Code is already present in Nvim. Add some other related missing changes.
2022-07-27 06:23:47 +08:00
9f1dc1466e vim-patch:9.0.0082: cannot interrupt global command from command line
Problem:    Cannot interrupt global command from command line.
Solution:   Reset got_int in another place. (closes vim/vim#10739)
3cfae39b08
2022-07-27 06:19:43 +08:00
45e2bbae83 vim-patch:9.0.0051: using CTRL-C wih :append may hang Vim
Problem:    Using CTRL-C wih :append may hang Vim.
Solution:   Reset got_int. (closes vim/vim#10729, closes vim/vim#10728)
f754fe6a3d
2022-07-27 06:19:43 +08:00
49d2256ae5 build(gen_vimdoc): fall back to lua if luajit doesn't exist (#19498)
It currently falls back to texlua if luajit doesn't exist. However,
the documentation generation does not work with texlua. Instead use lua
as a fall back instead.
2022-07-27 00:17:11 +02:00
289256337a Merge pull request #19523 from ii14/vim-9.0.0085
vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
2022-07-27 05:58:27 +08:00
7e939ddb87 vim-patch:9.0.0084: using "terraform" filetype for .tfvars file is bad (#19526)
Problem:    Using "terraform" filetype for .tfvars file is bad.
Solution:   use "terraform-vars", so that different completion and other
            mechanisms can be used. (Radek Simko, closes vim/vim#10755)
15b87b6610
2022-07-26 23:08:48 +02:00
4225e6ee46 vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
Problem:    ":write" fails after ":file name" and the ":edit".
Solution:   Reset BF_NOTEDITED when using ":edit". (closes vim/vim#10790)
1f0dc5e84f
2022-07-26 20:57:57 +02:00
d61a5a08ac ci(openbsd): don't specify versions for dependencies if possible
It's more convenient to not specify the version and let openbsd's
package manager figure it out. This will help us avoid manually bumping
dependency versions when a new version of openbsd is released.

Some packages have multiple versions and not specifying a version in
those cases fails the CI job, so providing a version seems to be
necessary for some key packages.
2022-07-26 17:27:26 +02:00
2a9c9371bc vim-patch:9.0.0073: too many files recognized as bsdl (#19504)
Problem:    Too many files recognized as bsdl.
Solution:   Use pattern "*.bsd" instead of "*bsd". (Martin Tournoij,
            closes vim/vim#10783)
1b67f07f76
2022-07-26 14:16:46 +02:00
1a4753f25a Merge pull request #19514 from zeertzjq/vim-8.1.1424
vim-patch:8.1.1424,9.0.0076: crash when popup menu is deleted while waiting for char
2022-07-26 20:03:02 +08:00
27116a0159 vim-patch:9.0.0076: no test for what patch 8.1.1424 fixes
Problem:    No test for what patch 8.1.1424 fixes.
Solution:   Add a test. (closes vim/vim#10789)
92a1678d48
2022-07-26 19:37:17 +08:00
ee8606d31f vim-patch:8.1.1424: crash when popup menu is deleted while waiting for char
Problem:    Crash when popup menu is deleted while waiting for char.
Solution:   Bail out when pum_array was cleared.
5c3fb04623
2022-07-26 19:36:24 +08:00
cbfae548e8 Merge pull request #19512 from dundargoc/build/version-fix
build: fix version generation to its previous behavior
2022-07-26 06:47:56 -04:00
4cbeedf57b vim-patch:b529cfbd04c0 (#19501)
Update runtime files
b529cfbd04
2022-07-26 11:26:23 +02:00
46bf1ec791 build: fix version generation to its previous behavior
This will change the version format from

v0.8.0-dev-nightly-12-g1a07044c1

to

v0.8.0-dev-698-ga5920e98f

Closes https://github.com/neovim/neovim/issues/19499
2022-07-26 11:22:31 +02:00
1a07044c1c revert: "vim-patch:9.0.0061: ml_get error with nested autocommand" (#19509)
This reverts commit 6cee15da72.

Port this again when https://github.com/vim/vim/issues/10780 is fixed.
2022-07-26 11:53:17 +08:00
147cce29a6 fix(cmdline): trigger CmdlineEnter and ModeChanged earlier (#19474)
Match Vim's ordering in code.
These tests are unrelated to ext_cmdline. Move them out of that block.
2022-07-26 10:21:30 +08:00
88c6e02c12 Merge pull request #19508 from ii14/fix_older_cmake_makefiles
build: fix git version generation on makefiles with older cmake versions
2022-07-25 21:41:03 -04:00
ba662efb17 build: fix git version generation on makefiles with older cmake versions
When using a Makefile generator, older CMake versions are not building
custom targets when depending on their byproducts, making version
generation fail. (works on 3.19.4, fails on 3.10.2) As a workaround,
add a dependency on the custom target explicitly.
2022-07-26 02:03:13 +02:00
fe159d23fd vim-patch:9.0.0071: command overlaps with printed text in scrollback (#19505)
Problem:    Command overlaps with printed text in scrollback.
Solution:   Clear until end-of-line and use correct message chunk.
            (closes vim/vim#10765, closes vim/vim#10764)
ecdc82e74e

N/A patches for version.c:

vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative

Problem:    Using utfc_ptr2char_len() when length is negative.
Solution:   Check value of length. (closes vim/vim#10760)
4dc513a22c
2022-07-26 07:30:33 +08:00
3ded2ab55a feat(lsp): allow passing custom list handler to LSP functions that return lists (#19213)
Currently LSP allows only using loclist or quickfix list window. I
normally prefer to review all quickfix items without opening quickfix
window. This fix allows passing `on_list` option which allows full
control what to do with list.

Here is example how to use it with quick fix list:

```lua
local function on_list(options)
  vim.fn.setqflist({}, ' ', options)
  vim.api.nvim_command('cfirst')
end

local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', '<leader>ad', function() vim.lsp.buf.declaration{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>ai', function() vim.lsp.buf.implementation{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>at', function() vim.lsp.buf.type_definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>af', function() vim.lsp.buf.references(nil, {on_list=on_list}) end, bufopts)
```

If you prefer loclist do something like this:

```lua
local function on_list(options)
  vim.fn.setloclist(0, {}, ' ', options)
  vim.api.nvim_command('lopen')
end
```

close #19182

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2022-07-25 23:02:51 +02:00
7961f79904 Merge pull request #19494 from zeertzjq/vim-8.2.5155
vim-patch:8.2.{5155,5163,5164,5166}: diff fixes
2022-07-25 21:32:30 +08:00
e12035fc0c build(lint): check uncrustify version #19468
This to prevent the user from accidentally using the wrong uncrustify
version.
2022-07-25 06:18:49 -07:00
e4079f3b5a vim-patch:8.2.5166: test for DiffUpdated fails
Problem:    Test for DiffUpdated fails.
Solution:   Also accept a count of two.
f65cc665fa
2022-07-25 20:48:21 +08:00
771564b00e vim-patch:8.2.5164: invalid memory access after diff buffer manipulations
Problem:    Invalid memory access after diff buffer manipulations.
Solution:   Use zero offset when change removes all lines in a diff block.
c101abff4c
2022-07-25 20:48:21 +08:00
8543de3a86 vim-patch:8.2.5163: crash when deleting buffers in diff mode
Problem:    Crash when deleting buffers in diff mode.
Solution:   Recompute diffs later.  Skip window without a valid buffer.
cd38bb4d83
2022-07-25 20:48:21 +08:00
611b43369e vim-patch:8.2.5155: in diff mode windows may get out of sync
Problem:    In diff mode windows may get out of sync. (Gary Johnson)
Solution:   Avoid that the other window scrolls for 'cursorbind'.
a315ce1f32
2022-07-25 20:30:35 +08:00
e12c62c1f7 Merge pull request #19470 from zeertzjq/vim-8.2.4866
vim-patch:8.2.4866,9.0.0066: duplicate code in "get" functions
2022-07-25 20:29:34 +08:00
ad57610ac7 vim-patch:9.0.0066: switching window uneccarily when getting buffer options
Problem:    Switching window uneccarily when getting buffer options.
Solution:   Do not switch window when getting buffer options. (closes vim/vim#10767)
cd6ad6439d
2022-07-25 20:01:59 +08:00
56ed5a0403 vim-patch:8.2.4866: duplicate code in "get" functions
Problem:    Duplicate code in "get" functions.
Solution:   Use get_var_from() for getwinvar(), gettabvar(), gettabwinvar()
            and getbufvar(). (closes vim/vim#10335)
47d4e317f8

f_setbufvar() can use tv_get_buf_from_arg() as it sets emsg_off.
2022-07-25 20:01:59 +08:00
6e9a7e7db8 Merge pull request #19493 from zeertzjq/vim-8.2.1469
vim-patch:8.2.{1469,2254,2284,2285,2969,4228}: option fixes and refactorings
2022-07-25 19:01:48 +08:00
6c26d0b068 ci(distribution): auto-release winget #19121
- forked winget-pkgs to https://github.com/neovim/winget-pkgs
- key stored in WINGET_TOKEN at https://github.com/neovim/neovim/settings/secrets/actions
- deploy key public key stored at https://github.com/neovim/winget-pkgs/settings/keys
2022-07-25 03:58:16 -07:00
aba3147cb6 vim-patch:8.2.4228: no tests for clicking in the GUI tabline
Problem:    No tests for clicking in the GUI tabline.
Solution:   Add test functions to generate the events.  Add tests using the
            functions. (Yegappan Lakshmanan, closes vim/vim#9638)
b0ad2d92fd
2022-07-25 18:20:47 +08:00
d8df9afad6 vim-patch:8.2.2969: subtracting from number option fails when result is zero
Problem:    Subtracting from number option fails when result is zero. (Ingo
            Karkat)
Solution:   Reset the string value when using the numeric value.
            (closes vim/vim#8351)
a42e6e0082

Cherry-pick Test_compound_assignment_operators() changes from patch 8.2.1593
2022-07-25 18:20:47 +08:00
963ea726da vim-patch:8.2.2285: Vim9: cannot set an option to a false
Problem:    Vim9: cannot set an option to a false.
Solution:   For VAR_BOOL use string "0". (closes vim/vim#7603)
b0d8182fa3
2022-07-25 18:20:47 +08:00
8921035fc7 vim-patch:8.2.2284: Vim9: cannot set an option to a boolean value
Problem:    Vim9: cannot set an option to a boolean value.
Solution:   Check for VAR_BOOL. (closes vim/vim#7603)
31a201a04a
2022-07-25 18:20:47 +08:00
2241fd3211 vim-patch:8.2.2254: Vim9: bool option type is number
Problem:    Vim9: bool option type is number.
Solution:   Have get_option_value() return a different value for bool and
            number options. (closes vim/vim#7583)
dd1f426bd6
2022-07-25 18:20:47 +08:00
3ea45a2caf vim-patch:8.2.1469: Vim9: cannot assign string to string option
Problem:    Vim9: cannot assign string to string option.
Solution:   Change checks for option value. (closes vim/vim#6720)
0aae4809fd
2022-07-25 18:20:45 +08:00
e9b58a619e Merge pull request #18992 from zeertzjq/alt-mouse
fix(input): do no reinterpret mouse keys with ALT modifiers
2022-07-25 10:15:44 +08:00
0cc41a61d1 test: improve some input tests 2022-07-25 09:47:28 +08:00
eb77122823 fix(input): do no reinterpret mouse keys with ALT modifiers
Remove check for MOD_MASK_META as it is for <T- which never appears in TUI.
Make small changes to docs.
2022-07-25 09:47:28 +08:00
46e3e1c728 fix(api): make nvim_cmd mods.silent work correctly (#19489) 2022-07-25 09:43:39 +08:00
d529523027 vim-patch:8.1.1763: evalfunc.c is still too big (#17952) 2022-07-24 15:02:39 +01:00
2a56cc5230 feat(l10n): improve zh_CN translations (#19483) 2022-07-24 20:33:07 +08:00
ea13dce3bf fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)
Fix a mistake in the porting of Vim patch 8.0.1309.
2022-07-24 09:29:28 +08:00
1849cf0e4c Merge pull request #19476 from zeertzjq/vim-9.0.0059
vim-patch:9.0.{0059,0061}
2022-07-23 18:12:37 +08:00
6cee15da72 vim-patch:9.0.0061: ml_get error with nested autocommand
Problem:    ml_get error with nested autocommand.
Solution:   Also check line numbers for a nested autocommand. (closes vim/vim#10761)
5fa9f23a63
2022-07-23 17:50:25 +08:00
264791925a vim-patch:9.0.0059: test file has wrong name
Problem:    Test file has wrong name.
Solution:   Rename the file.  Various small fixes. (closes vim/vim#10674)
bb404f5ad5
2022-07-23 14:22:08 +08:00
d0ced2a127 Merge pull request #19471 from zeertzjq/vim-8.2.4731
vim-patch:8.2.{4731,5035}: changelist patches
2022-07-23 10:15:57 +08:00
9d556fc81f vim-patch:8.2.5035: when splitting a window the changelist position moves
Problem:    When splitting a window the changelist position moves.
Solution:   Set the changelist index a bit later. (closes vim/vim#10493)
e6f13b473c

Cherry-pick Test_nv_hat_count() change from patch 8.2.1593.
2022-07-23 09:48:24 +08:00
91c99eed54 vim-patch:8.2.4731: the changelist index is not remembered per buffer
Problem:    The changelist index is not remembered per buffer.
Solution:   Keep the changelist index per window and buffer. (closes vim/vim#10135,
            closes vim/vim#2173)
db0ea7f2b0

Cherry-pick FOR_ALL_BUF_WININFO from patch 8.2.0500.
Cherry-pick test_changelist.vim change from patch 8.2.3795.
2022-07-23 09:48:24 +08:00
ed6bbc03af Merge pull request #19467 from zeertzjq/vim-8.2.1489
vim-patch:8.2.1489
2022-07-22 23:03:52 +08:00
232cdbb880 vim-patch:8.2.1489: Vim9: error when setting an option with setbufvar()
Problem:    Vim9: error when setting an option with setbufvar().
Solution:   Do not get a number from a string value. (closes vim/vim#6740)
191929b182

Vim9 is N/A, so this just refactors the code without changing behavior.
2022-07-22 22:38:05 +08:00
271739c830 refactor: move f_getbufvar() and f_setbufvar() to eval/vars.c
Vim moved them there in patch 8.1.1943.
2022-07-22 22:38:05 +08:00
790f8b0e16 fix(build): non-git ("tarball") build fails #19448
Problem:
Build fails without git or .git/.
ref #19289

Solution:
Fix the version generation logic.

Test cases:
If `git` is missing:
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `.git/` is missing:
    -- Git tag extraction failed:
       fatal: not a git repository (or any of the parent directories): .git
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev
If `git describe` fails
    -- Git tag extraction failed:
       fatal: ...
    -- Using NVIM_VERSION_MEDIUM: v0.8.0-dev

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-07-22 07:10:24 -07:00
3f2e1c1db9 ci(release): use cpack on macOS #19459
We use `cpack` to generate the release tarballs on Linux. Now that we
don't need to bundle `libintl`, we can do the same on macOS.
2022-07-22 07:08:11 -07:00
a7b9920930 refactor: move FunPtr to types.h (#19466)
This type itself is not eval-specific. Moving it to types.h can avoid
including eval/funcs.h in many headers, and types.h is already included
by many headers.
2022-07-22 22:05:02 +08:00
ac690f457e feat(l10n): Turkish translations #19441 2022-07-22 07:04:40 -07:00
9d4a4f49ef vim-patch:8.1.1933: the eval.c file is too big (#19462)
Problem:    The eval.c file is too big.
Solution:   Move code related to variables to evalvars.c. (Yegappan
            Lakshmanan, closes vim/vim#4868)
0522ba0359

Name the new file eval/vars.c instead.
2022-07-22 21:14:17 +08:00
bb7853a62d test(mksession_spec): use %bwipeout! instead of qall! to close terminal (#19465)
Avoid expect_exit, session will be closed when a new one is spawned.
2022-07-22 12:59:34 +08:00
8af3d641da fix(grid): don't use utfc_ptr2char_len() when printing until NUL (#19456) 2022-07-22 06:41:51 +08:00
946c8fd288 ci(labeler): do not add "column" label for mark.{c,h} (#19455) 2022-07-21 17:44:44 +08:00
77b9f1eac5 refactor: fix clang warnings (#19453) 2022-07-21 17:42:59 +08:00
c15e9d3746 fix(mark): give correct error message when mark is in another buffer (#19454) 2022-07-21 17:42:17 +08:00
6a7d00469b vim-patch:9.0.0047: using freed memory with recursive substitute (#19457)
Problem:    Using freed memory with recursive substitute.
Solution:   Always make a copy for reg_prev_sub.
32acf1f1a7
2022-07-21 16:00:45 +08:00
1f1863ed54 vim-patch:8.2.4502 (#19439)
vim-patch:8.2.4502: in the GUI a modifier is not recognized after CTRL-X

Problem:    In the GUI a modifier is not recognized for the key typed after
            CTRL-X, which may result in a mapping to be used. (Daniel
            Steinberg)
Solution:   Recognize a modifier starting with CSI. (closes vim/vim#9889)
d979d64fa2

Code is N/A. This just ports the test change.
Test depends on README.txt in testdir. Add that file.
Reorder test_ins_complete.vim to match upstream.
2022-07-21 06:00:16 +08:00
598cbcae4a Merge pull request #19445 from famiu/fix/local_winbar_tabs
fix: local winbar with tabs
2022-07-20 16:57:38 +02:00
9879fd5d08 fix: local winbar with tabs
Closes #19396
2022-07-20 20:32:22 +06:00
1a2560c2dc test(old): set 'display' to an empty string (#19450) 2022-07-20 19:58:08 +08:00
559ef3e903 feat(lua): allow vim.cmd to be indexed (#19238) 2022-07-20 12:29:24 +01:00
243038188b Merge pull request #19446 from bfredl/fixarray
refactor(object): get rid of redundant FIXED_TEMP_ARRAY
2022-07-20 10:36:44 +02:00
c65e73f2d6 refactor(object): get rid of redundant FIXED_TEMP_ARRAY
use the MAXSIZE_TEMP_ARRAY + ADD_C pattern instead, as exemplified
by the changes in this commit.
2022-07-20 10:04:06 +02:00
1ef84547a8 Merge pull request #19415 from zeertzjq/vim-8.1.1076
vim-patch:8.1.{1076,1849}: file for Insert mode is much too big
2022-07-20 06:33:55 +08:00
420bb2eb8a vim-patch:8.1.1849
9bca58f36d
2022-07-20 06:08:41 +08:00
f357c9bca5 vim-patch:8.1.1076: file for Insert mode is much too big
Problem:    File for Insert mode is much too big.
Solution:   Split off the code for Insert completion. (Yegappan Lakshmanan,
            closes vim/vim#4044)
7591bb39d5

Cherry-pick ins_compl_len() -> get_compl_len() from patch 8.2.4001.

Revert a71c5e9eb9: ctrl_x_mode is no
longer a global variable, so l_ctrl_x_mode is no longer needed.
2022-07-20 06:08:41 +08:00
8620dfc5bd fix(tmpdir): invalid tempname() if username has slashes #19323
fix #19240

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-07-19 09:03:12 -07:00
61302fb391 docs: fix vim.filetype.add by avoiding quotes (#19433)
* Problem

Quotes are special in doxygen, and should be escaped. *Sometimes* they
cause doc generation issues. Like in #17785

* Solution

Replace double quotes with single quotes
2022-07-19 09:12:10 -06:00
b154d951e6 Merge pull request #19434 from zeertzjq/vim-8.2.0509
vim-patch:8.2.{0509,2632}: startup tests
2022-07-19 22:27:36 +08:00
9e15bdde3b build(macos): use consistent MACOSX_DEPLOYMENT_TARGET (#19430)
Use the same logic for both deps (including LuaJIT, for which setting
this variable is mandatory) and Nvim: either the eponymous environment
variable if set, or the current software version if not.

Removes annoying warnings when building locally on macOS.
2022-07-19 16:10:59 +02:00
358f9b776b vim-patch:8.2.2632: not all command line arguments are tested
Problem:    Not all command line arguments are tested.
Solution:   Add tests for -D and -serverlist. (Dominique Pellé, closes vim/vim#7992)
c5cf369e95

Cherry-pick two deletions from patch 8.2.1799.
2022-07-19 22:02:49 +08:00
2e790e9ad1 vim-patch:8.2.0509: various code is not properly tested.
Problem:    various code is not properly tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5871)
cde0ff39da

Cherry-pick test_clientserver.vim change from patch 8.1.1826.
Cherry-pick a comment from patch 8.2.0301.
Omit test_viminfo.vim.
2022-07-19 22:02:46 +08:00
871ff8d62f Merge pull request #19428 from jamessan/deps-cmake-version
build: bump minimum CMake version in cmake.deps
2022-07-19 08:52:14 -04:00
078e446181 Merge pull request #19429 from zeertzjq/fix-flaky-tests
fix flaky tests
2022-07-19 20:27:25 +08:00
72dfd57e5f test: deal with RPC call causing Nvim to exit later 2022-07-19 19:41:07 +08:00
366e90cdc8 test: avoid timing-sensitive undo message 2022-07-19 19:41:07 +08:00
101fd04ee2 Merge pull request #19409 from bfredl/uiunpack
perf(ui): some ui_client fixes/optimizations before externalized TUI
2022-07-19 13:08:11 +02:00
0a716fc776 build: bump minimum CMake version in cmake.deps
The minimum version for the main project was bumped in 035d82e0d3.
Align cmake.deps to the same version for consistency.
2022-07-19 07:02:51 -04:00
f87c824513 fix(rpc): break nvim_error_event feedback loop between two nvim instances
In case nvim A sends nvim_error_event to nvim B, it would
respond with another nvim_error_event due to unknown
request name. Fix this by adding dummy request handler for now.
2022-07-19 12:38:37 +02:00
0b63f5afad perf(ui): unpack grid_line (screen contents) directly 2022-07-19 12:38:37 +02:00
93bd6fb2c8 Merge pull request #19427 from Maverun/maveBranchDoc
fix(docs): remove internal function from docs (nvim__*)
2022-07-19 12:10:03 +02:00
4e3699d13a fix(docs): remove internal function from docs (nvim__*) 2022-07-19 05:03:22 -04:00
7b835ba796 vim-patch:8.2.1147 (#19425)
vim-patch:8.2.1147: :confirm may happen in cooked mode

Problem:    :confirm may happen in cooked mode. (Jason Franklin)
Solution:   Switch to raw mode before prompting. (Brandon Pfeifer)
27321dbeed

Code is N/A, but this improves tests. Port the improved tests to Lua.
2022-07-19 13:00:22 +08:00
JP
1a655b71a8 fix(lua): make it possible to cancel vim.wait() with Ctrl-C (#19217) 2022-07-19 09:11:13 +08:00
a80d447b47 fix(mouse): click on global statusline with splits (#19390) 2022-07-19 06:35:04 +08:00
3340728c72 fix(powershell): filter ":!" commands with args #19268
Problem:
Since 0b9664f524 powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."

Solution:
Pass args to Start-Process via `-ArgumentList`.
closes #19250
2022-07-18 13:26:09 -07:00
d73c31a41f Merge pull request #19167 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for memline.c
2022-07-18 20:22:18 +01:00
e8c94697bc ci: test only a single macos version (#19418)
The differences in MacOS releases are smaller since they're now upgraded
yearly, meaning the need to test each version is reduced.
2022-07-18 18:39:41 +02:00
d15a66d803 ci(windows): config and build before publish step (#19416)
Problem: Windows package step failed (silently).
Solution: Make sure to configure cmake before attempting to build the package target.
2022-07-18 15:18:15 +02:00
be3d2f5125 perf(ui): avoid ui_flush() work in headless mode 2022-07-18 14:08:44 +02:00
45bee1dafd perf(ui): eliminate spurious memory allocations for hl_attr_define event 2022-07-18 14:08:44 +02:00
67a04fe6cb perf(ui): unpack a single ui event at a time, instead of a "redraw" batch
This reduces the memory overhead for large redraw batches, as a much smaller
prefix of the api object buffer is used and needs to be hot in cache.
2022-07-18 14:08:44 +02:00
1b462705d0 fix(windows):exepath, stdpath return wrong slashes #19111
exepath and stdpath should respect shellslash and return path with
proper file separator.
Closes #13787
2022-07-17 17:00:08 -07:00
776913e32e fix: add group in autocmd api #19412
regression from PR #19283: custom close autocommands for the preview window were
not cleaned up after the window was closed.
2022-07-17 16:11:41 -07:00
9169fb8f07 fix(lua): double entries in :lua completion #19410
`:lua vim.ls<tab>` would list `lsp` twice.
2022-07-17 15:40:18 -07:00
9f4b19b6d0 ci: refactor build.ps1 #19336
Refactor `build.ps1` into a more modular design

9728f3b558/.github/workflows/ci.yml (L283-L296)

- Separate CI steps.
- Remove unneeded code related to setting up CMake.
- Use parallel/incremental builds.
- Fix github's cache.
- Clear the way for the possibility of replacing this file with a cmake-preset:
  https://github.com/neovim/neovim/pull/19128
2022-07-17 15:07:35 -07:00
13abe20b5f refactor(lsp): use autocmd api (#19407)
* refactor(lsp): use autocmd api

* refactor(lsp): inline BufWritePost and VimLeavePre callbacks
2022-07-17 19:13:33 +02:00
ff35d7a4b9 fix(lsp): move augroup define to if statement (#19406) 2022-07-17 19:11:05 +02:00
5ccdf6a88d vim-patch:9.0.0055 (#19392)
vim-patch:9.0.0055: bitbake files are not detected

Problem:    Bitbake files are not detected.
Solution:   Add bitbake filetype detection by file name and contents. (Gregory
            Anders, closes vim/vim#10697)
fa49eb4827
2022-07-17 14:33:51 +02:00
eb9b93b5e0 feat(defaults): mouse=nvi #19290
Problem:
Since right-click can now show a popup menu, we can provide messaging to
guide users who expect 'mouse' to be disabled by default. So 'mouse' can
now be enabled by default.

Solution:
Do it.
Closes #15521
2022-07-17 04:14:04 -07:00
aae11865e1 Merge #19309 from ii14/lsp_refactor_1
refactor(lsp): make the use of local aliases more consistent
2022-07-17 11:43:44 +02:00
9e7f92e59a Merge pull request #19404 from zeertzjq/vim-8.2.0670
vim-patch:8.2.{0670,0698,1294,1984,2424,2426,2427,5029}: textlock patches
2022-07-17 14:15:32 +08:00
006334f3a7 vim-patch:8.2.2427: can still switch windows for 'completefunc'
Problem:    Can still switch windows for 'completefunc'.
Solution:   Also disallow switching windows for other completions.
3eb6bd9c2b

Assert E565 instead of E578.
Need to assert a different string because patch 8.2.1919 hasn't been
ported yet.
2022-07-17 13:51:46 +08:00
f72ec95958 vim-patch:8.2.2426: allowing 'completefunc' to switch windows causes trouble
Problem:    Allowing 'completefunc' to switch windows causes trouble.
Solution:   use "textwinlock" instead of "textlock".
28976e2acc

Assert E565 instead of E578.

vim-patch:8.2.0670: cannot change window when evaluating 'completefunc'

Problem:    Cannot change window when evaluating 'completefunc'.
Solution:   Make a difference between not changing text or buffers and also
            not changing window.
6adb9ea0a6

vim-patch:8.2.5029: "textlock" is always zero

Problem:    "textlock" is always zero.
Solution:   Remove "textlock" and rename "textwinlock" to "textlock".
            (closes vim/vim#10489)
cfe456543e
2022-07-17 13:51:46 +08:00
b0bbcfa239 vim-patch:8.2.2424: some tests are known to cause an error with ASAN
Problem:    Some tests are known to cause an error with ASAN.
Solution:   Add CheckNotAsan.
97202d9516

Move CheckNotMSWindows to the right place.
Omit test_memory_usage.vim: a Lua test is used for this file.
2022-07-17 13:51:46 +08:00
656a1889ee vim-patch:8.2.1984: cannot use :vimgrep in omni completion
Problem:    Cannot use :vimgrep in omni completion, causing C completion to
            fail.
Solution:   Add the EX_LOCK_OK flag to :vimgrep. (closes vim/vim#7292)
33aecb1f2c

Cherry-pick Test_resize_from_copen() indent change from patch 8.2.1432.
2022-07-17 13:51:46 +08:00
7e79cb56c5 vim-patch:8.2.1294: Vim9: error when using vim9script in TextYankPost
Problem:    Vim9: error when using vim9script in TextYankPost.
Solution:   Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
            be used when text is locked. (closes vim/vim#6529)
37394ff752
2022-07-17 13:51:46 +08:00
95b1191505 vim-patch:8.2.0698: insert mode completion not fully tested
Problem:    Insert mode completion not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6041)
f9ab52e155

Cherry-pick test_ins_complete.vim changes from patches 8.2.{0522,0615}.
2022-07-17 13:51:39 +08:00
53c398d8f4 Merge pull request #19402 from zeertzjq/vim-8.2.0655
vim-patch:8.2.{0655,1040}: not enough tests
2022-07-17 11:30:32 +08:00
7c3a87182d vim-patch:8.2.1040: not enough testing for movement commands
Problem:    Not enough testing for movement commands.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6313)
bdd2c290d3

Cherry-pick test_functions.vim changes from patch 8.2.0183.
Cherry-pick Test_normal18_z_fold() change from patch 8.2.0540.
2022-07-17 11:08:14 +08:00
e53330a603 vim-patch:8.2.0655: search code not sufficiently tested
Problem:    Search code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5999)
224a5f17c6

Cherry-pick test_charsearch.vim change from patch 8.2.0448.
Cherry-pick test_search.vim changes from patch 8.2.0619.
2022-07-17 10:03:58 +08:00
9f837a5dcf fix(api): fix nvim_parse_cmd interfere with printing line in Ex mode (#19400) 2022-07-17 09:59:32 +08:00
08a50f6690 Merge pull request #19395 from jamessan/flaky-job-test
test(job_spec): accept alternate messages for "append environment" tests
2022-07-16 21:24:06 -04:00
4f59bc8013 Merge pull request #19391 from zeertzjq/vim-8.2.0052
vim-patch:8.2.{0052,0198,2608,2643}: code not fully tested
2022-07-17 06:07:05 +08:00
bcb5b7b3f6 test(job_spec): accept alternate messages for "append environment" tests
These tests commonly fail in Debian with

    [  ERROR   ] test/functional/core/job_spec.lua @ 81: jobs append environment with pty #env
    test/functional/helpers.lua:198:
    ==============================================================================
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (table: 0x2aa4bcc1040) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc' } } } }
    Expected:
    (table: 0x2aa4bcc0d70) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc'
           *[2] = '' } } } }

Since the test is validating the "hello world abc" message, not the
newlines, accept either set of message sequences.
2022-07-16 14:08:27 -04:00
0cfd4fa8f3 vim-patch:8.2.2643: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add a few more test. (Yegappan Lakshmanan, closes vim/vim#7995)
1f448d906b

Cherry-pick some test_edit.vim changes from patches 8.2.{1022,1432}.
Reorder test_undo.vim to match upstream.
2022-07-16 22:46:54 +08:00
780edfc0eb vim-patch:8.2.2608: character input not fully tested
Problem:    Character input not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7963)
f4fcedc59d

Cherry-pick related changes from patches 8.2.{0433,0866}.
2022-07-16 21:55:27 +08:00
bc73795a58 vim-patch:8.2.0198: no tests for y/n prompt
Problem:    No tests for y/n prompt.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5564)
43c60eda2a
2022-07-16 21:32:25 +08:00
f7c6676199 vim-patch:8.2.0052: more-prompt not properly tested
Problem:    More-prompt not properly tested.
Solution:   Add a test case. (Dominique Pelle, closes vim/vim#5404)
c6d539b671
2022-07-16 21:32:25 +08:00
711a6a9157 fix(ex_cmds): correct flags for :const (#19387) 2022-07-16 14:54:31 +08:00
fa29bc94b5 vim-patch:8.2.0593: finding a user command is not optimal (#19386)
Problem:    Finding a user command is not optimal.
Solution:   Start further down in the list of commands.
a494f56f88
2022-07-16 13:49:48 +08:00
591765c915 vim-patch:8.2.1061: insufficient testing for src/window.c (#19384)
Problem:    Insufficient testing for src/window.c.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6345)
5d3c9f8c2a

Cherry-pick test_tagjump.vim changes from patch 8.1.2373.
2022-07-16 11:34:19 +08:00
73526abbbd fix(api): do not switch win/buf if getting option in current win/buf (#19383) 2022-07-16 09:31:05 +08:00
33da7d83e8 fix(pum): make right drag in anchor grid to select work in multigrid UI (#19382) 2022-07-16 08:26:40 +08:00
86f0da922f fix: remote UI may get invalid 'pumblend' value #19379
fixes: https://github.com/neovim/neovim/issues/19340
2022-07-15 10:42:01 -07:00
f59c96903a refactor: use local api = vim.api 2022-07-15 18:26:47 +02:00
6645f59832 fix: right-click in clickable statusline #19252
Problem:
1. Right-click does not work in statusline unless you left-click first (to focus
   the statusline).
2. Modifier (e.g. shift+rightclick) does not work in statusline.

Solution:
Make clickable statusline sections receive right-clicks regardless of whether
the statusline is focused.

Closes #18994
2022-07-15 09:15:02 -07:00
8bccefcb87 refactor: use npcall from vim.F 2022-07-15 17:55:00 +02:00
5c49129c5e Merge #19324 ci: cleanup ci/ files 2022-07-15 17:42:00 +02:00
8a5c7e91f2 refactor(lsp): make the use of local aliases more consistent 2022-07-15 17:39:26 +02:00
9370e1c511 feat(lsp): hide backticks in LSP docstrings #19377
Also clear `markdownError`: don't want to highlight invalid markdown
syntax in LSP docstrings.

fix #16114
2022-07-15 08:13:16 -07:00
1c9f487f0e feat(defaults): nnoremap & :&&<CR> #19365 2022-07-15 06:23:29 -07:00
c0ae3df052 Merge pull request #19376 from zeertzjq/vim-8.2.0535
vim-patch:8.2.{0535,0542}: regexp patterns not fully tested
2022-07-15 20:45:52 +08:00
8bfcff6c4a vim-patch:8.2.0542: no test for E386
Problem:    No test for E386.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#5911)
8832a34578

Cherry-pick Test_search_errors() from patch 8.2.0448.
2022-07-15 20:23:48 +08:00
ba5ff6e5f0 vim-patch:8.2.0535: regexp patterns not fully tested
Problem:    Regexp patterns not fully tested.
Solution:   Add more regexp tests and others. (Yegappan Lakshmanan,
            closes vim/vim#5901)
4d23c52824

Add missing Test_search_cmdline8().
Cherry-pick Test_invalid_regexp() from patch 8.2.0531.
2022-07-15 20:23:48 +08:00
827906136d test: improve searchhl tests 2022-07-15 19:38:13 +08:00
b9f15caf5c Merge pull request #19375 from zeertzjq/vim-8.2.0403
vim-patch:8.1.1547,8.2.0403: when 'buftype' is "nofile" there is no overwrite check
2022-07-15 19:26:32 +08:00
0cf5cd1ac9 vim-patch:8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Problem:    When 'buftype' is "nofile" there is no overwrite check.
Solution:   Also check for existing file when 'buftype' is set.
            (closes vim/vim#5807)
a3a9c8ef69

Nvim doesn't have buftype=popup and doesn't allow buftype=terminal for
non-terminal buffer.
2022-07-15 18:27:21 +08:00
4a64cdafd6 vim-patch:8.1.1547: functionality of bt_nofile() is confusing
Problem:    Functionality of bt_nofile() is confusing.
Solution:   Split into bt_nofile() and bt_nofilename().
26910de8b0
2022-07-15 18:27:21 +08:00
564d99c89a Merge pull request #19373 from zeertzjq/vim-8.2.0426
vim-patch:8.0.1118,8.2.0426
2022-07-15 16:49:00 +08:00
a649af4dba vim-patch:8.2.0426: some errors were not tested for
Problem:    Some errors were not tested for.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5824)
9b9be007e7

Cherry-pick get_highest_fnum() from patch 8.1.1908 to make tests pass.
2022-07-15 15:21:39 +08:00
7b5b7b3cc6 vim-patch:8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
4033c55eca
2022-07-15 15:21:39 +08:00
9777907467 Merge pull request #19369 from zeertzjq/vim-8.2.0482
vim-patch:8.2.{0430,0482}: insufficient tests
2022-07-15 11:14:22 +08:00
465b73c3a5 vim-patch:8.2.0482: channel and sandbox code not sufficiently tested
Problem:    Channel and sandbox code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5855)
ca68ae1311

Cherry-pick test_clientserver.vim changes form patch 8.2.0448.
2022-07-15 10:50:21 +08:00
c821b5c695 vim-patch:8.2.0430: window creation failure not properly tested
Problem:    Window creation failure not properly tested.
Solution:   Improve the test. (Yegappan Lakshmanan, closes vim/vim#5826)
5080b0a047
2022-07-15 10:50:21 +08:00
73f96ce4c6 Merge pull request #19348 from akinsho/bugfix/winbar-winhighlight
fix(winbar): make setting WinBar and WinBarNC in 'winhighlight' work
2022-07-15 09:56:17 +08:00
8730643326 fix(winbar): make setting WinBar and WinBarNC in 'winhighlight' work 2022-07-15 09:22:57 +08:00
072fb55cb0 vim-patch:9.0.0052: "zG" may throw an error if invalid character follows (#19368)
Problem:    "zG" may throw an error if invalid character follows.
Solution:   Pass the word length to valid_spell_word(). (Ken Takata,
            closes vim/vim#10737)
2ebcc35826
2022-07-15 08:42:36 +08:00
75ad050919 fix(build): fails if git is missing #19366
Generate empty file if git is missing.
2022-07-14 15:25:28 -07:00
001f19de28 Merge pull request #19364 from zeertzjq/vim-8.2.0921
vim-patch:8.2.{0921,0926}: CTRL-W T in cmdline window causes trouble
2022-07-14 20:59:17 +08:00
8d67358d49 vim-patch:8.2.0926: cmdline test fails on Appveyor
Problem:    Cmdline test fails on Appveyor.
Solution:   Add CR to the commands. (Naruhiko Nishino, closes vim/vim#6220)
951a2fb1b8
2022-07-14 20:36:34 +08:00
08235b6f2a vim-patch:8.2.0921: CTRL-W T in cmdline window causes trouble
Problem:    CTRL-W T in cmdline window causes trouble.
Solution:   Disallow CTRL-W T in the cmdline window.  Add more tests.
            (Naruhiko Nishino, closes vim/vim#6219)
4fdb8bd054

Test already passes in Nvim because of later patches.
Move Test_cmdwin_jump_to_win() to the right place.
2022-07-14 20:34:05 +08:00
b41f2bcae7 build(deps): bump LuaJIT to HEAD - 50936d784 (#19343) 2022-07-14 12:30:46 +02:00
ddaef0618d fix(treesitter): don't error when node argument of predicate is nil (#19355)
When the node mentioned in a predicate is not required for the query
then predicates putting restrictions on that node shouldn't run.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2600
2022-07-14 12:18:03 +02:00
c6f0be116e Merge pull request #19353 from zeertzjq/vim-8.2.0369
vim-patch:8.2.{0342,0347,0369}: insufficient test coverage
2022-07-14 18:15:31 +08:00
314f1a7c21 vim-patch:8.2.0369: various Normal mode commands not fully tested
Problem:    Various Normal mode commands not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5751)
1671f44881

Cherry-pick a fix from patch 8.2.3162.
Omit test_iminsert.vim as previous patches to that file are N/A, and
Nvim doesn't support iminsert=2 either, so that test isn't useful.
2022-07-14 15:40:07 +08:00
bf96b9f11d vim-patch:8.2.0347: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add more test coverage. (Yegappan Lakshmanan, closes vim/vim#5720)
91ffc8a5f5

Test_Ex_echo_backslash() is not applicable to Vim enhanced Ex mode.
2022-07-14 15:40:07 +08:00
c467df997e vim-patch:8.2.0342: some code in ex_getln.c not covered by tests
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5717)
0546d7df13

Nvim doesn't support imsearch=2, commenting out that line is enough.
Test_Ex_append() is not applicable to Vim enhanced Ex mode.
Omit test_iminsert.vim as previous patches to that file are N/A.
2022-07-14 15:40:07 +08:00
b81d1eb265 build(deps): bump tree-sitter to HEAD - 1f1b1eb45 (#19347) 2022-07-14 09:21:02 +02:00
685d6ab6ca build(deps): bump Luv to 1.44.2-0 (#19346) 2022-07-14 09:20:47 +02:00
912dbbdd77 build: gracefully handle error in git-version #19289
- only update git-version if both of these conditions are met:
    - `git` command succeeds
    - `versiondef_git.h` would change (SHA1-diff)
- else print a status/warning message

also move version generation out of Lua into cmake.
2022-07-14 00:12:27 -07:00
b93cb481a2 feat(eval)!: input() support any type for "cancelreturn" in a dict (#19357) 2022-07-14 14:47:25 +08:00
778541067a vim-patch:8.2.0969: assert_equal() output for dicts is hard to figure out (#19317)
Problem:    Assert_equal() output for dicts is hard to figure out.
Solution:   Only show the different items.
4a021dfbee
2022-07-13 09:38:15 +08:00
c01690b1ea fix(exmode): flush messages before printing a line after pressing Enter (#19341) 2022-07-13 09:06:31 +08:00
39d51c833a vim-patch:8.2.0035: saving and restoring called_emsg is clumsy (#19335)
Problem:    Saving and restoring called_emsg is clumsy.
Solution:   Count the number of error messages.
53989554a4
2022-07-13 04:08:49 +08:00
b1e0197a14 build(deps): bump libuv to v1.44.2 (#19338) 2022-07-12 20:45:24 +02:00
d8360e9033 Merge pull request #19334 from zeertzjq/vim-8.2.0275
vim-patch:8.2.{0275,0293,5050}
2022-07-12 17:02:46 +08:00
aa373e3abb vim-patch:8.2.5050: using freed memory when searching for pattern in path
Problem:    Using freed memory when searching for pattern in path.
Solution:   Make a copy of the line.
409510c588

Cherry-pick Test_def_search() -> Test_macro_search() from patch 8.2.0369
2022-07-12 16:23:32 +08:00
4aa4675fbf vim-patch:8.2.0293: various Ex commands not sufficiently tested
Problem:    Various Ex commands not sufficiently tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5673)
818fc9ad14

Needs to assert E170 instead of E580 because patch 8.2.3486 has been
ported but patch 8.2.1183 hasn't.
2022-07-12 16:23:32 +08:00
01afd43bc9 vim-patch:8.2.0275: some Ex code not covered by tests
Problem:    Some Ex code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5659)
406cd90f19
2022-07-12 16:23:32 +08:00
0f1b17788e fix(lsp): account for initializing servers in vim.lsp.start (#19329)
Fixes #19326
2022-07-12 09:44:11 +02:00
8b75ca7345 Merge pull request #19332 from zeertzjq/vim-8.2.0270
vim-patch:8.2.{0270,2732}
2022-07-12 14:36:05 +08:00
1abdb3224b vim-patch:8.2.2732: prompt for s///c in Ex mode can be wrong
Problem:    Prompt for s///c in Ex mode can be wrong.
Solution:   Position the cursor before showing the prompt. (closes vim/vim#8073)
e5b0b98a90
2022-07-12 14:08:34 +08:00
d079995fb8 vim-patch:8.2.0270: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5649)
bc2b71d44a
2022-07-12 14:08:34 +08:00
6a670a00b3 fix(exmode): do not throttle messages when pressing enter to print line 2022-07-12 14:06:42 +08:00
540d1af90e Merge pull request #19330 from zeertzjq/vim-8.2.0203
vim-patch:8.2.0203: :helptags and some other functionality not tested
2022-07-12 12:18:10 +08:00
53392f48b1 vim-patch:8.2.0203: :helptags and some other functionality not tested
Problem:    :helptags and some other functionality not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5567)
e20b9ececa
2022-07-12 11:52:47 +08:00
189db2b759 fix(cmdline): fix passing -1 as char 2022-07-12 11:49:32 +08:00
034d28c705 fix(lsp): don't attach a client in lsp.start() if there is none (#19328)
vim.lsp.start_client() may fail (for example if the `cmd` is not
executable). It produces a nice error notification in this case. Passing
the `nil` value returned from an erroneous `vim.lsp.start_client()` call
into `vim.lsp.buf_attach_client()` causes a meaty param validate
exception message. Avoid this.
2022-07-11 19:37:01 -06:00
195d8496a0 Merge pull request #19277 from zeertzjq/vim-8.1.1855
vim-patch:8.1.{1855,1859,1864,1867}: flaky timer tests
2022-07-12 07:21:04 +08:00
cea96ca39d test(old): test_timers.vim call timer_stopall() in SetUp() instead 2022-07-12 06:58:13 +08:00
d8f6426714 vim-patch:8.1.1867: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Loop with a sleep instead of one fixed sleep.
315244d85b
2022-07-12 06:45:19 +08:00
5119d10d41 vim-patch:8.1.1864: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Adjust the sleep times.
413c04e8d5
2022-07-12 06:45:19 +08:00
061e573e7e vim-patch:8.1.1859: timer test sometimes fails on Mac
Problem:    Timer test sometimes fails on Mac.
Solution:   Show more info when it fails.
427dddf014
2022-07-12 06:45:19 +08:00
9bea841925 vim-patch:8.1.1855: another failing timer test
Problem:    Another failing timer test.
Solution:   Assert that timers are finished by the end of the test.  Rename
            test functions to make them easier to find.
9a2fddcf04

Use test_garbagecollect_now() in Test_timer_retain_partial() like Vim.
2022-07-12 06:45:19 +08:00
daa49b525e Merge pull request #19320 from zeertzjq/vim-8.2.0212
vim-patch:8.2.{0212,0243,0250}: insufficient tests
2022-07-12 06:24:29 +08:00
27fd17a79c vim-patch:8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5618)
9f6277bdde

Cherry-pick Test_window_only() from patch 8.2.0203.
Cherry-pick a memory leak fix from patch 8.2.0399.
2022-07-12 05:36:33 +08:00
eea6a4f2a0 vim-patch:8.2.{0212,0250}
vim-patch:8.2.0212: missing search/substitute pattern hardly tested

Problem:    Missing search/substitute pattern hardly tested.
Solution:   Add test_clear_search_pat() and tests. (Yegappan Lakshmanan,
            closes vim/vim#5579)
07ada5ff2f

vim-patch:8.2.0250: test_clear_search_pat() is unused

Problem:    test_clear_search_pat() is unused.
Solution:   Remove the function. (Yegappan Lakshmanan, closes vim/vim#5624)
4f5776c17c
2022-07-12 05:36:33 +08:00
e71cc4a8dc test(old): align defaults to Vim before each test instead 2022-07-12 05:36:33 +08:00
d77ec8a5c6 ci: remove unnecessary file ci/script.sh
It only runs run_tests.sh and checks coverage, which can be replaced by
just moving the coverage check to ci/run_tests.sh.
2022-07-11 17:16:55 +02:00
bb1a464467 ci: remove unnecessary file run_lint.sh
It's a leftover artifact that currently just acts as an unnecessary
intermediary script that calls the Makefile. It can be replaced by just
calling the Makefile directly.
2022-07-11 16:41:06 +02:00
5c3bbb67e7 vim-patch:8.2.3363: when :edit reuses the current buffer the alternate file is set (#19306)
Problem:    When :edit reuses the current buffer the alternate file is set to
            the same buffer.
Solution:   Only set the alternate file when not reusing the buffer.
            (closes vim/vim#8783)
b8bd2e6eba

Cherry-pick Test_cmdline_expand_special() from patches 8.2.{0243,2873}.
Move Test_cmd_backtick() to the right place.
2022-07-11 20:55:26 +08:00
ac10c0f418 fix(lsp): abort pending changes after flush when debouncing (#19314)
Issuing a server request triggers `changetracking.flush` so as to
make sure we're not operating on a stale state. This immediately
triggers notification of any pending changes (as a result of debouncing)
to the server. However, this happens in addition to the notification
that is waiting on the debounce delay. Because we `nil`
`buf_state.pending_change` when it is called, the fix is to
also check that this is non-`nil` when it is called and exit if it is,
as this being `nil` would mean that it originates from a pending change
that has already been flushed out.
2022-07-11 12:48:02 +02:00
95c65a6b22 feat(lsp): defaults: tagfunc, omnifunc (#19003)
set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server
2022-07-10 17:26:43 +02:00
67b26a39f0 Merge pull request #19305 from zeertzjq/vim-8.2.3530
vim-patch:8.2.{3530,3531}: ":buf \{a}" fails while ":edit \{a}" works
2022-07-10 20:20:06 +08:00
5e53740350 Merge pull request #18774 from zeertzjq/float-height-width-fix
Fix some floating window height and width bugs
2022-07-10 17:59:32 +08:00
5105f713bd test(float_spec): make indent more consistent 2022-07-10 17:24:29 +08:00
63f6ecd419 fix(float): fix mouse drag position if float window turned to a split 2022-07-10 17:24:29 +08:00
63f63dd2b7 fix(float): fix glitch when making float window with border a split 2022-07-10 17:24:29 +08:00
99e8298711 fix(float): fix float window with winbar cannot have screen height 2022-07-10 17:24:29 +08:00
f7d6f472f7 fix(float): fix float window border drawing with winbar 2022-07-10 17:24:29 +08:00
2966cfe21f fix(lsp): pcall nvim_del_augroup_by_name (#19302)
fixup for #19283
2022-07-10 11:19:26 +02:00
3d77ea2762 Merge pull request #19307 from zeertzjq/vim-8.2.1053
vim-patch:7.4.1724,8.2.1053: insufficient testing for 'statusline' and 'tabline'
2022-07-10 17:13:17 +08:00
fe2b281292 vim-patch:8.2.1053: insufficient testing for 'statusline' and 'tabline'
Problem:    Insufficient testing for 'statusline' and 'tabline'.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6333)
832adf9bb8
2022-07-10 16:15:17 +08:00
59355653f6 vim-patch:7.4.1724
Problem:    Tabline test fails in GUI.
Solution:   Remove 'e' from 'guioptions'.
73cd8fb3e8

Add missing file header.
2022-07-10 16:12:58 +08:00
8f36e538cc fix(l10n): add folded line indicator translations from vim (#19286) 2022-07-10 12:36:43 +08:00
b3b85186ed vim-patch:8.2.3531: command line completion test fails on MS-Windows
Problem:    Command line completion test fails on MS-Windows.
Solution:   Do not test with "\{" on MS-Windows.
39c47c3104
2022-07-10 10:58:12 +08:00
45d2644205 vim-patch:8.2.3530: ":buf \{a}" fails while ":edit \{a}" works
Problem:    ":buf \{a}" fails while ":edit \{a}" works.
Solution:   Unescape "\{". (closes vim/vim#8917)
21c1a0c2f1
2022-07-10 10:56:37 +08:00
d606c39a9c vim-patch:9.0.0049: csv and tsv files are not recognized (#19300)
Problem:    Csv and tsv files are not recognized.
Solution:   Add patterns fo csv and tsv files. (Leandro Lourenci,
            closes vim/vim#10680)
99af91e582
2022-07-10 01:14:07 +02:00
eb9155e557 Merge #19267 require() in --startuptime 2022-07-10 01:04:11 +02:00
880de9a489 test(old): align defaults to Vim after every test (#19301)
This can avoid divergences from Vim in some small places.
2022-07-10 06:59:58 +08:00
797007997c test: --startuptime 2022-07-09 15:45:02 -07:00
d6a1e71881 vim-patch:8.1.1038: Arabic support excludes Farsi (#19285)
Problem:    Arabic support excludes Farsi.
Solution:   Add Farsi support to the Arabic support. (Ali Gholami Rudi,
            Ameretat Reith)
dc4fa190e7

Omit Test_shape_final_to_medial(): removed in later patches.
2022-07-10 06:01:49 +08:00
2c739431e8 feat(lua): measure require in --startuptime 2022-07-09 22:12:06 +02:00
782f726136 refactor: remove functions marked for deprecation in 0.8 (#19299) 2022-07-09 18:42:49 +02:00
6b1a8f23d7 refactor(lua): replace vim.cmd use with API calls (#19283)
Signed-off-by: Raphael <glephunter@gmail.com>
2022-07-09 18:40:32 +02:00
7dbe6b1a46 Merge pull request #19296 from zeertzjq/vim-8.2.2902
vim-patch:8.2.{2902,2917}: spellfile functionality not fully tested
2022-07-09 20:59:49 +08:00
7b72e61cf8 vim-patch:8.2.2917: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for SFX with removal of characters, spelling
            suggestions with NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8293)
bb162367ac
2022-07-09 20:33:00 +08:00
eb60a9be97 vim-patch:8.2.2902: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for CIRCUMFIX, NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8283)
5a6cfb3ff2

Reorder test_spellfile.vim to match upstream.
2022-07-09 20:33:00 +08:00
022e994ab8 Merge pull request #19294 from zeertzjq/vim-8.2.0332
vim-patch:8.2.{0332,0396}: insufficient tests for cmdline
2022-07-09 18:34:48 +08:00
65359e5657 vim-patch:8.2.0396: cmdexpand.c insufficiently tested
Problem:    Cmdexpand.c insufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5789)
24ebd83e03

Map Q to gQ before every test since a test uses :mapclear.
2022-07-09 17:33:49 +08:00
12f0ef669d vim-patch:8.2.0332: some code in ex_getln.c not covered by tests
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5710)
d30ae2fc4a
2022-07-09 16:31:19 +08:00
798acbca1b Merge pull request #19284 from zeertzjq/vim-8.2.0274
vim-patch:8.2.{0274,0325}
2022-07-09 16:25:16 +08:00
cf4aa6095f vim-patch:8.2.0325: ex_getln.c code not covered by tests
Problem:    Ex_getln.c code not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5702)
578fe947e3

Cherry-pick Test_Ex_global() from patch 8.2.0293.
Test_rightleftcmd() fails if incsearch is enabled, so disable it.
2022-07-08 23:11:12 +08:00
0d0a6aff6b vim-patch:8.2.0274: hang with combination of feedkeys(), Ex mode and :global
Problem:    Hang with combination of feedkeys(), Ex mode and :global.
            (Yegappan Lakshmanan)
Solution:   Add the pending_exmode_active flag.
9e2bcb5d23
2022-07-08 23:11:12 +08:00
45ba2e147f fix(tui): add fixups for hterm family #19078
Problem
-------

In #19040, I reported two things that started happening somewhen in the
last three months when using neovim in hterm (the Chrome Secure Shell
terminal):

 1. Under certain circumstances, the window title (set by nvim
    [i0]) would appear over the line I was typing, corrupting the screen.
 2. If I changed my $TERM from xterm-256color to the new hterm-256color
    (available since ncurses >=20210320), the window title corruption
    was gone, but pane scrolling was broken.

Both problems are due to changes in the termcap files, their source of
truth being the ncurses project. See "Timeline of ncurses changes" below
for details.

Cause: title corruption
-----------------------

The title corruption when using hterm + TERM=xterm-256color can be
explained by event #4 (ncurses 2022-03-12) in the ncurses timeline:

The xterm-256color termcap file gained status line termcodes in ncurses
2022-03-12. These termcodes are used by Neovim to set the title when.
hterm does not have a status line. Due to ncurses versions earlier than
2022-03-12 missing the xterm status line capability, Neovim manually
fixed up [t0] the terminfo file if $TERM was xterm-256color. So if
before Neovim manually added fsl/tsl capabilties, and after they were
in the termcap file, why did hterm suddenly start getting corruption?
The answer is that the termcodes for these capabilties are different
when Neovim fixes them up, versus the one in the new termcap database:

   fsl=\E[0$}                  // from xterm-256color
   tsl=\E[2$~\E[1$}\E[%i%p1%d` // from xterm-256color

   fsl=\x07                    // patched by Neovim
   tsl=\x1b]0;                 // patched by Neovim

hterm ignores the latter, but corrupts the screen with the former.

Solution: Make hterm users set hterm-256color, which lacks the new
fsl/tsl codes. Also, to reduce superfluous work, stop patching in this
capability when hterm is detected (even if hterm would ignore the
patched version).

Cause: pane corruption
----------------------

The pane corruption when using hterm + TERM=hterm-256color, but NOT when
using hterm + TERM=xterm-256color can be explained by:

 - Neovim uses DECSLRM when available [p1] for performant scrolling.
 - Both the hterm-256color and xterm-256color termcap databases
   advertise support for DECSLRM (ncurses timeline #1, #2 and #3).
 - hterm does not support DESCLRM [p2] (note: it does support DESCTBM for
   top/bottom scrolling, but it's broken [p3] and not used by Neovim)
 - xterm-alikes that are not real xterm generally don't support DECSLRM
   either, so Neovim patches it out [p4].

When using hterm-256color, hterm is no longer considered an xterm-alike
by Neovim. As a result, DECSLRM is not cleared. hterm does not support
it, so corruption ensues.

This is a problem with the hterm-256color termcap file, but we're stuck
with it so the best we can do is patch over it.

Timeline of ncurses changes
---------------------------

 1. 2019-05-19: Part of the DECSLRM capability (smglr AKA set_lr_margin)
    added to vt420+lrmm, which xterm-256color inherits [n1]
 2. 2021-03-20: hterm-256color added, inheriting xterm-256colors. [n2]
 3. 2021-09-25: The *parm versions of smglr (AKA set_lr_margin) were
    added to vt420+lrmm [n3]. Namely:
     1. smglp AKA set_left_margin_parm, and
     2. smgrp AKA set_right_margin_parm
 4. 2022-03-12: (new) codes for fsl, bsl and tsl added to xterm (add
    dec+sl to xterm-new, per patch #371 -TD) [n4]

Fixes #19040.

[i0]: 3a4fa22bad/src/nvim/tui/tui.c (L1377)
[t0]: 3a4fa22bad/src/nvim/tui/tui.c (L1728),L1729
[p1]: 3a4fa22bad/src/nvim/tui/tui.c (L1196)
[p2]: https://bugs.chromium.org/p/chromium/issues/detail?id=1175065&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1298796&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p4]: 3a4fa22bad/src/nvim/tui/tui.c (L1740-L1752)
[n1]: https://github.com/mirror/ncurses/commit/8f6d94b8d6211a2323caef53fa4c96c475ec9a6#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2742
[n2]: c2650100f8 (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R5907)
[n3]: f6b436c4fb (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2842)
[n4]: 8bf8c836fe (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R4828)

Signed-off-by: Nicolas Hillegeer <nicolas@hillegeer.com>
2022-07-08 06:06:27 -07:00
b999de2eb0 Merge pull request #19278 from zeertzjq/vim-8.2.0132
vim-patch:8.2.{0132,0136,0151}: detecting a script was already sourced is unreliable
2022-07-08 20:12:58 +08:00
a6803f3adf test: add a test for what Vim patch 8.2.0151 fixes 2022-07-08 14:18:16 +08:00
159a0b651f vim-patch:8.2.0151: detecting a script was already sourced is unreliable
Problem:    Detecting a script was already sourced is unreliable.
Solution:   Do not use the inode number.
978d170bdc
2022-07-08 14:17:22 +08:00
eafa09de7d vim-patch:8.2.0136: stray ch_logfile() call
Problem:    Stray ch_logfile() call.
Solution:   Remove it. (closes vim/vim#5503)
ed5adff1e6
2022-07-08 11:11:22 +08:00
a890c019a3 vim-patch:8.2.0132: script may be re-used when deleting and creating a new one
Problem:    Script may be re-used when deleting and creating a new one.
Solution:   When the inode matches, also check the file name.
ca33eb256e
2022-07-08 11:11:22 +08:00
ca64b589cd vim-patch:8.1.{1524,1544}: tests are silently skipped (#19276)
This is a port of these two patches combined:

vim-patch:8.1.1524: tests are silently skipped

Problem:    Tests are silently skipped.
Solution:   Throw an exception for skipped tests in more places.
b0f94c1ff3

vim-patch:8.1.1544: some balloon tests don't run when they can

Problem:    Some balloon tests don't run when they can.
Solution:   Split GUI balloon tests off into a separate file. (Ozaki Kiichi,
            closes vim/vim#4538)  Change the feature check into a command for
            consistency.
b46fecd345

Omit test_lua.vim: previous patches are N/A
Omit test_memory_usage.vim: previous patches are N/A
Omit test_textprop.vim: previous patches are N/A
Omit test_winbar.vim: previous patches are N/A
Omit test_termcodes.vim: mostly N/A
Skip Test_mouse_positon() because it uses test_setmouse().
Cannot throw error in a Test_nocatch_ test.
Use latest `CheckFeature clipboard_working` for test_quotestar.vim
2022-07-08 08:26:25 +08:00
72877bb17d feat(runtime)!: enable filetype.lua by default (#19216)
* revert to filetype.vim by setting `g:do_legacy_filetype`
* skip either filetype.lua or filetype.vim via `g:did_load_filetypes`

(Running both is no longer required and therefore no longer supported.)
2022-07-07 18:53:47 +02:00
0950275b8c refactor(lua): git-blame-ignore stylua update PR (#19273)
https://github.com/neovim/neovim/pull/19264
2022-07-07 18:32:53 +02:00
aa4f9c5341 refactor(lua): reformat with stylua 0.14.0 (#19264)
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
2022-07-07 18:27:18 +02:00
34d41baf8a feat(tui): try terminfo for [re]set_cursor_color OSC #19255 2022-07-07 02:09:11 -07:00
55e81b0fe8 vim-patch:5ed11535e069 (#19256)
Update runtime files
5ed11535e0
2022-07-07 08:15:33 +02:00
6b72ee1f15 Merge pull request #19263 from zeertzjq/vim-8.2.3674
vim-patch:8.2.{3674,4399}: problems after ml_get error
2022-07-07 08:35:29 +08:00
8ce60ddd07 vim-patch:8.2.4399: crash after ml_get error
Problem:    Crash after ml_get error.
Solution:   When returning "???" flush the line and set ml_line_lnum.
f9435e49ef
2022-07-07 08:10:53 +08:00
4bb01262ca vim-patch:8.2.3674: when ml_get_buf() fails it messes up IObuff
Problem:    When ml_get_buf() fails it messes up IObuff.
Solution:   Return a local pointer. (closes vim/vim#9214)
96e7a5928e
2022-07-07 08:10:00 +08:00
4cded8cec1 Merge pull request #19180 from zeertzjq/tui-kitty-keypad
feat(tui): recognize keypad keys when using kitty keyboard protocol
2022-07-07 07:42:22 +08:00
5e84db5c90 Merge pull request #19261 from zeertzjq/vim-8.2.5023
vim-patch:8.2.{5023,5043,5044}: substitute textlock fixes
2022-07-07 07:21:50 +08:00
d4db87f493 vim-patch:8.2.5044: command line test fails
Problem:    Command line test fails.
Solution:   Also beep when cmdline win can't be opened because of locks.
            Make the test not beep.  Make the test pass on MS-Windows.
be99042b03
2022-07-07 07:00:11 +08:00
0612101c92 vim-patch:8.2.5043: can open a cmdline window from a substitute expression
Problem:    Can open a cmdline window from a substitute expression.
Solution:   Disallow opening a command line window when text or buffer is
            locked.
71223e2db8
2022-07-07 07:00:11 +08:00
df4c634d06 vim-patch:8.2.5023: substitute overwrites allocated buffer
Problem:    Substitute overwrites allocated buffer.
Solution:   Disallow undo when in a substitute command.
338f1fc0ee
2022-07-07 07:00:11 +08:00
4ffe5d0189 vim-patch:8.2.5063: error for a command may go over the end of IObuff (#19260)
Problem:    Error for a command may go over the end of IObuff.
Solution:   Truncate the message.
44a3f3353e
2022-07-07 06:37:54 +08:00
664efa497e vim-patch:8.2.0614: get ml_get error when deleting a line in 'completefunc' (#19244)
Problem:    Get ml_get error when deleting a line in 'completefunc'. (Yegappan
            Lakshmanan)
Solution:   Lock the text while evaluating 'completefunc'.
ff06f283e3

Fix a mistake in the porting of patch 8.1.0098.
Cherry-pick Test_run_excmd_with_text_locked() from patch 8.2.0270.
Cherry-pick test_gf.vim changes from patch 8.2.0369.
Cherry-pick message change from later patches.
2022-07-07 04:47:18 +08:00
1e03255646 Merge pull request #19218 from smjonas/fix_ft_patterns
fix(filetype): fix filetype patterns
fix(filetype): remove call to vim.fn.resolve and pass filename to match function
2022-07-06 16:57:44 +02:00
f9683f2823 fix(filetype): remove call to vim.fn.resolve and pass filename to match function
For example on MacOS, /etc/hostname.file is symlinked to
/private/etc/hostname.file. We only care about the original file path though.
2022-07-06 16:25:51 +02:00
f3c78a4465 fix(filetype): fix filetype patterns 2022-07-06 16:25:23 +02:00
c84ae5706f Merge pull request #19247 from zeertzjq/vim-8.2.4165
vim-patch:7.4.212,8.2.{4165,4221}: some functions in normal.c are too long
2022-07-06 20:44:41 +08:00
1a490a5bc5 fix(normal): fix segfault with bracket command jumping to a mark
vim-patch:9.0.0043: insufficient testing for bracket commands

Problem:    Insufficient testing for bracket commands.
Solution:   Add a few more tests. (closes vim/vim#10668)
cf34434b5e

Cherry-pick a change from patch 8.2.0369.
2022-07-06 20:01:01 +08:00
8e03d42ec8 vim-patch:8.2.4221: some functions in normal.c are very long
Problem:    Some functions in normal.c are very long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#9628)
a827bf3ea8
2022-07-06 19:58:44 +08:00
ff111b615a vim-patch:8.2.4165: the nv_g_cmd() function is too long
Problem:    The nv_g_cmd() function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#9576)
05386ca1d4
2022-07-06 19:58:44 +08:00
1b5f53ca95 vim-patch:7.4.212
Problem:    Now that the +visual feature is always enabled the #ifdefs for it
            are not useful.
Solution:   Remove the checks for FEAT_VISUAL.
f7ff6e85e8
2022-07-06 19:58:44 +08:00
Jay
93c8fe77cb feat: add 'mousescroll' option (#12355)
Add 'mousescroll' option to control how many lines to scroll by when a
mouse wheel keycode is received. The mousescroll option controls both
horizontal and vertical scrolling. The option is a string in the format:

    set mousescroll=direction:count,direction:count

Where direction is either "ver" or "hor", and count is a non negative
integer. If a direction is omitted, a default value is used. The default
values remain unchanged, that is 3 for vertical scrolling, and 6 for
horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6".

Add mousescroll documentation
 - Add option documentation in options.txt
 - Add brief summary in quickref.txt

Update :help scroll-mouse-wheel
 - Mention mousescroll option as a means of controlling scrolling.
 - Remove obsolete suggestion to map scroll wheel keys to <C-U> to
   scroll by a single line -- users should prefer the mousescroll option.
 - Add some information about the consequences of remapping scroll wheel
   keys (they lose their magic ability to affect inactive windows).

Update :help vim-differences
 - Add brief mousescroll summary under Options

Add mousescroll tests
 - Test option validation
 - Test default mousescroll value and behavior
 - Test fallback to default values
 - Test mouse vertical and horizontal scrolling in normal mode
 - Test mouse vertical and horizontal scrolling in insert mode
2022-07-06 19:34:24 +08:00
9ced054134 fix(mark): fix unexpected cursor movements (#19253) 2022-07-06 19:01:44 +08:00
c68f1d7263 Merge pull request #19242 from smjonas/vim-9.0.0042
vim-patch:9.0.{0041,0042}: filetype patterns
2022-07-06 08:14:08 +02:00
606af7887b vim-patch:8.2.5162: reading before the start of the line with BS in Replace mode (#19241)
Problem:    Reading before the start of the line with BS in Replace mode.
Solution:   Check the cursor column is more than zero.
0971c7a4e5
2022-07-06 07:36:36 +08:00
78300a1587 vim-patch:9.0.0042: missing change for filetype detection
Problem:    Missing change for filetype detection.
Solution:   Include change to detect guile from shebang line.
3244780379
2022-07-06 01:33:45 +02:00
8b7399782e vim-patch:9.0.0041: a couple of filetype patterns do not have "*" before "/etc"
Problem:    A couple of filetype patterns do not have "*" before "/etc".
Solution:   Add the star. (Jonas Strittmatter, closes vim/vim#10662)
704988f0c3
2022-07-06 01:25:21 +02:00
41785b1b0c Merge pull request #19223 from lewis6991/ghaction
build: add github action annotations for clint
2022-07-05 09:53:41 -04:00
a4801b8034 vim-patch:8.0.1562: the terminal debugger can't set a breakpoint with the mouse (#19234)
Problem:    The terminal debugger can't set a breakpoint with the mouse.
Solution:   Add popup menu entries.
71137fed4d

This ports missing popup menu code to termdebug plugin.
Despite the commit message, the code is copied from latest Vim.
WinBar code is commented out and WinBar docs is not ported.
2022-07-05 20:57:01 +08:00
2536bde6c9 Merge pull request #19232 from zeertzjq/vim-8.2.2904
vim-patch:8.2.{2904,3644.3980,3990}: three Normal mode fixes
2022-07-05 18:48:26 +08:00
785422ad54 vim-patch:8.2.3990: testing wrong operator
Problem:    Testing wrong operator.
Solution:   Test "g@" instead of "r_". (Naohiro Ono, closes vim/vim#9463)
5c75eed758
2022-07-05 17:32:42 +08:00
5fcf701ba1 vim-patch:8.2.3980: if 'operatorfunc' invokes an operator Visual mode is changed
Problem:    If 'operatorfunc' invokes an operator the remembered Visual mode
            may be changed. (Naohiro Ono)
Solution:   Save and restore the information for redoing the Visual area.
            (closes vim/vim#9455)
b3bd1d39e6
2022-07-05 17:32:42 +08:00
dd5fce2f5d vim-patch:8.2.3644: count for 'operatorfunc' in Visual mode is not redone
Problem:    Count for 'operatorfunc' in Visual mode is not redone.
Solution:   Add the count to the redo buffer. (closes vim/vim#9174)
2228cd72cf

Cherry-pick a line from patch 8.2.0522.
2022-07-05 17:32:42 +08:00
f42657cbcf vim-patch:8.2.2904: "g$" causes scroll if half a double width char is visible
Problem:    "g$" causes scroll if half a double width char is visible.
Solution:   Advance to the last fully visible character. (closes vim/vim#8254)
74ede80aeb
2022-07-05 17:32:42 +08:00
d0835617fa fix(terminal): crash if TermClose deletes own buffer #19222
- Partially fixes #10386 except for the case where the alternate buffer
  is the default, empty, first buffer created on startup. #vimlife
- TODO: port patches related to `can_unload_buffer`, maybe that fully
  fixes #10386?

vim-patch:8.0.1732: crash when terminal API call deletes the buffer
2022-07-05 02:31:49 -07:00
eb814bdca0 Merge pull request #19231 from zeertzjq/vim-8.2.3615
vim-patch:8.2.{3615,3754,5122}: indent fixes
2022-07-05 15:39:50 +08:00
d9e5737fdc vim-patch:8.2.5122: lisp indenting my run over the end of the line
Problem:    Lisp indenting my run over the end of the line.
Solution:   Check for NUL earlier.
0e8e938d49
2022-07-05 15:10:46 +08:00
04ba37773e vim-patch:8.2.3754: undesired changing of the indent of the first formatted line
Problem:    Undesired changing of the indent of the first formatted line.
Solution:   Do not indent the first formatted line.
ecabb51107
2022-07-05 15:08:41 +08:00
42863634dd vim-patch:8.2.3615: wrong indent in first line if re-formatting with indent expr
Problem:    When re-formatting with an indent expression the first line of a
            paragraph may get the wrong indent. (Martin F. Krafft)
Solution:   Apply the correct indenting function for the first line.
            (Christian Brabandt, closes vim/vim#9150, closes vim/vim#9056)
818ff25cd1
2022-07-05 15:04:37 +08:00
6e2d23ac43 Merge pull request #19229 from zeertzjq/vim-8.2.0363
vim-patch:8.2.{0363,0416}: some Normal mode commands not tested
2022-07-05 14:57:48 +08:00
24db6c1e57 vim-patch:8.2.0416: test leaves file behind
Problem:    Test leaves file behind.
Solution:   Delete the file.
95e59a355b
2022-07-05 14:33:36 +08:00
a01905eb35 vim-patch:8.2.0363: some Normal mode commands not tested
Problem:    Some Normal mode commands not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5746)
f5f1e10d0d

Omit Test_edit_forbidden(): change reverted in patch 8.2.0369.
Cherry-pick Test_normal_yank_with_excmd() from patch 8.2.0293.
Skip Test_normal_cursorhold_with_count().
Cherry-pick Test_star_register() from patch 8.2.0270.
2022-07-05 14:22:58 +08:00
936c11f9c8 test(old): use Q -> gQ mapping instead of changing test when possible 2022-07-05 13:54:11 +08:00
d07a39c54b vim-patch:9.0.0035: spell dump may go beyond end of an array (#19228)
Problem:    Spell dump may go beyond end of an array.
Solution:   Limit the word length.
54e5fed6d2
2022-07-05 06:47:58 +08:00
826fe56f5c fix(mark): mark without a view restores at topline #19224
For a local mark without a view, currently trying to restore its view
will put the cursor at topline, which is not the correct behavior.
Initialize `topline_offset` to `MAXLNUM` instead to fix this.
2022-07-04 13:28:14 -07:00
1803b0ffd7 fix(tui): resize at startup #17795
* fix(test): screen.lua nil index
  When actual_rows and expected_rows are different avoid a nil index.
* fix(tui): resize at startup
  The deleted code is not needed after 402b4e8.
  It caused the condition to false positive when the function was called
  more than once before startup (first normal mode). Being itself what
  set the dimension and not the user, locking the size of the screen to
  an incorrect size.
  Make got_winch an int to mitigate: tui_grid_resize changing the size
  of the host terminal between the signal handler and the call to
  sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't
  directly call the callback, the event loop does.

Fixes #17285
Fixes #15044
Fixes #11330
2022-07-04 13:09:47 -07:00
03c9cf3feb test: add tests for keypad keys from kitty keyboard protocol 2022-07-04 22:37:45 +08:00
5b609bbefb build: add github action annotations for clint 2022-07-04 14:20:10 +01:00
33ed85a2f6 feat(tui): recognize keypad keys when using kitty keyboard protocol 2022-07-04 21:09:33 +08:00
ab5929e1b0 Merge pull request #19221 from zeertzjq/vim-8.2.1808
vim-patch:8.2.{1808,5098},9.0.0034
2022-07-04 18:59:27 +08:00
a4160dd105 vim-patch:9.0.0034: spell tests do not always clear the word list
Problem:    Spell tests do not always clear the word list.
Solution:   Clear the word list in TearDown(). (closes vim/vim#10659)
288ed23e39
2022-07-04 18:38:39 +08:00
08aba02ad7 vim-patch:8.2.5098: spelldump test sometimes hangs
Problem:    Spelldump test sometimes hangs.
Solution:   Catch the problem of the spell file not being found to avoid
            hanging in the download dialog.
fc9f0fd6d1
2022-07-04 18:37:46 +08:00
d9c63507f8 vim-patch:8.2.1808: no test coverage for ":spelldump!"
Problem:    No test coverage for ":spelldump!".
Solution:   Add a test. (Dominique Pellé, closes vim/vim#7089)
f12f0022e6
2022-07-04 18:37:36 +08:00
436747752b refactor: remove unnecessary volatile #19210
libuv does not call callback functions(uv_signal_cb) directly from signal
handlers. Therefore, there is no need to use volatile.

Ref. 1a91b51976/src/unix/signal.c (L183)
2022-07-04 03:28:59 -07:00
f075feee32 Merge pull request #19220 from zeertzjq/vim-8.2.1470
vim-patch:8.2.{1470,1493,1522,1523,1770,5072,5074}: spell patches
2022-07-04 11:13:19 +08:00
6b474d0237 vim-patch:8.2.5074: spell test fails on MS-Windows
Problem:    Spell test fails on MS-Windows.
Solution:   Do not change 'encoding'
ad73cc2ff2
2022-07-04 10:02:35 +08:00
a4215a0a21 vim-patch:8.2.5072: using uninitialized value and freed memory in spell command
Problem:    Using uninitialized value and freed memory in spell command.
Solution:   Initialize "attr".  Check for empty line early.
2813f38e02
2022-07-04 10:02:35 +08:00
1ff86aa634 vim-patch:8.2.1770: invalid memory use when using SpellFileMissing autocmd
Problem:    Invalid memory use when using SpellFileMissing autocmd.
Solution:   Add test case. (Dominique Pellé, closes vim/vim#7036)  Fix using a window
            that was closed.
d569a9e746

Skip an assert because of #3027.
2022-07-04 09:37:45 +08:00
7648a8524c vim-patch:8.2.1523: still not enough test coverage for the spell file handling
Problem:    Still not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6790)
b9fc192f92
2022-07-04 09:18:35 +08:00
a2d8d5e1f5 vim-patch:8.2.1522: not enough test coverage for the spell file handling
Problem:    Not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6763)
c8ec5fe56f

Add missing whitespace in message.
2022-07-04 09:15:03 +08:00
ed64c8f683 vim-patch:8.2.1493: not enough test coverage for the spell file handling
Problem:    Not enough test coverage for the spell file handling.
Solution:   Add spell file tests. (Yegappan Lakshmanan, closes vim/vim#6728)
fc2a47ffc4
2022-07-04 09:09:42 +08:00
acb6512f2e vim-patch:8.2.1470: errors in spell file not tested
Problem:    Errors in spell file not tested.
Solution:   Add test for spell file errors. (Yegappan Lakshmanan,
            closes vim/vim#6721)
c0f8823ee4
2022-07-04 09:06:01 +08:00
acb7a90281 refactor(runtime): port scripts.vim to lua (#18710) 2022-07-03 15:31:56 +02:00
0313aba77a vim-patch:9.0.0031: <mods> of user command does not have correct verbose value (#19215)
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value

Problem:    <mods> of user command does not have correct verbose value.
Solution:   Use the value from the command modifier. (closes vim/vim#10651)
9359e8a6d9
2022-07-03 21:17:03 +08:00
e837f29ce6 Merge pull request #19212 from zeertzjq/vim-9.0.0024
vim-patch:9.0.{0024,0030}
2022-07-03 06:43:16 +08:00
357d63f5d7 vim-patch:9.0.0030: matchfuzzy test depends on path of current directory
Problem:    Matchfuzzy test depends on path of current directory.
Solution:   Use fnamemodify() to remove the path. (Robin Becker,
            closes vim/vim#10650)
22e7e867e2
2022-07-03 06:21:05 +08:00
312f1b65c8 vim-patch:9.0.0024: may access part of typeahead buf that isn't filled
Problem:    May access part of typeahead buf that isn't filled.
Solution:   Check length of typeahead.
af043e12d9
2022-07-03 06:21:05 +08:00
2b04aaad94 build: drop -Wsuggest #19177
Disable -Wsuggest compile flags by default.

Although the flags are useful to see what the compiler thinks we can
improve on, it adds a lot of noise to the build output. That makes it
harder to spot actual issues that may be flagged.

Closes https://github.com/neovim/neovim/issues/19160
2022-07-02 14:47:22 -07:00
c6c89391b7 Merge pull request #19205 from bfredl/luaerr
fix(lua): don't leak memory on error
2022-07-02 23:44:26 +02:00
8d37901f1c Merge pull request #19203 from zeertzjq/api-cmd-unsilent
feat(api): add `unsilent` to command APIs
2022-07-03 05:00:02 +08:00
7a907c3314 feat(api): add unsilent to command APIs 2022-07-03 04:34:28 +08:00
f93eb169f6 vim-patch:8.2.1900: Vim9: command modifiers do not work
Problem:    Vim9: command modifiers do not work.
Solution:   Make most command modifiers work.
02194d2bd5
2022-07-03 04:34:28 +08:00
0160ff6aa0 fix(lua): don't leak memory on error 2022-07-02 20:10:32 +02:00
108368bdd5 fix(coverity): 353827 unnecessary null check #19209
Previous checks make sure the index is not out of bounds. Therefore jmp
is never NULL.
2022-07-02 09:24:58 -07:00
e11f3655fb fix(jobs): deadlock in channel.c:exit_event #19082
In the rare case that exit_event is called from process_close_handles,
it stalls waiting for the process to exit (the routine is currently
underway to do just that). This causes `job_spec.lua` to sometimes
stall.

REJECTED IDEAS:
==============================================================
1. Currently `exit_event` is placed on `main_loop.fast_events`. Would the problem
   be solved by using `main_loop.events` instead?
    - A: Maybe, but it will cause other problems, such as queuing exit_event()
      during "Press Enter..." prompt which may result in the event not being
      processed, leading to another stall.
2. Can we avoid the timer?
    - A: Using a timer is just the easiest way to queue a delayed event without
      causing an infinite loop in the queue currently being processed.
3. Can we avoid the new `exit_need_delay` global...
    1. by using `process_is_tearing_down` instead?
        - A: Can't use `process_is_tearing_down` because its semantics are different.
    2. by checking a similar condition as `process_teardown`? f50135a32e/src/nvim/event/process.c (L141-L142)
       ```
       if (!process_is_tearing_down || (kl_empty(main_loop.children) && multiqueue_empty(main_loop.events))) {
         uv_timer_start(&main_loop.exit_delay_timer, exit_delay_cb, 0, 0);
         return;
       }
       ```
        - A: Tried but it did not work (other stalls occurred). Maybe
          exit_event() is called from a source other than
          process_close_handles() and is delayed, the delayed exit_event() will
          be executed before main_loop.events is processed, resulting in an
          infinite loop.
2022-07-02 09:14:08 -07:00
c1b591dc8f Merge pull request #19137 from dundargoc/refactor/char_u-to-char
refactor: replace char_u
2022-07-02 17:13:25 +02:00
3b8804571c refactor: replace char_u
Work on https://github.com/neovim/neovim/issues/459
2022-07-02 16:01:27 +02:00
ed429c00d7 refactor(fold): style #19175
* refactor(fold): update comment formatting
* refactor(fold): use post-increment/decrement
* refactor(fold): reduce scope of local variables
* refactor(fold): use booleans
2022-07-02 04:29:27 -07:00
662681694b vim-patch:0d878b95d8f9 (#19197)
Update runtime files
0d878b95d8
2022-07-02 11:06:03 +02:00
a9de89894a Merge pull request #19202 from zeertzjq/vim-8.2.0316
vim-patch:8.2.{0261,0316}: insufficient test coverage
2022-07-02 12:25:07 +08:00
7277543772 vim-patch:8.2.0316: ex_getln.c code has insufficient test coverage
Problem:    ex_getln.c code has insufficient test coverage.
Solution:   Add more tests. Fix a problem. (Yegappan Lakshmanan, closes vim/vim#5693)
8d588ccee5
2022-07-02 11:57:53 +08:00
d197e77a55 vim-patch:8.2.0261: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5645)
f0cee1971f

Cherry-pick Test_bunload_with_offset() from patch 8.2.0243
2022-07-02 11:57:53 +08:00
f71d518c90 Merge pull request #19199 from zeertzjq/vim-9.0.0017
vim-patch:9.0.{0017,0021,0022}: invalid memory access
2022-07-02 09:28:16 +08:00
5bd1bdee14 fix(mark): set mark fnum from buffer (#19195) 2022-07-01 17:20:50 -06:00
d358856a0c vim-patch:9.0.0022: spell test fails
Problem:    Spell test fails.
Solution:   Expect new error is given.
95afae6d17
2022-07-02 06:55:23 +08:00
998a96803b vim-patch:9.0.0021: invalid memory access when adding word to spell word list
Problem:    Invalid memory access when adding word with a control character to
            the internal spell word list.
Solution:   Disallow adding a word with control characters or a trailing
            slash.
5e59ea54c0
2022-07-02 06:55:23 +08:00
0b15c01912 vim-patch:9.0.0017: accessing memory beyond the end of the line
Problem:    Accessing memory beyond the end of the line.
Solution:   Stop Visual mode when closing a window.
3d51ce18ab
2022-07-02 06:55:23 +08:00
9b4d0137b8 build: move lint target to cmake #19169
This will ensure less verbose output and faster linting.
2022-07-01 09:15:04 -07:00
2b1abe3c9d vim-patch:9.0.0015: with EXITFREE defined terminal menus are not cleared (#19187)
Problem:    With EXITFREE defined terminal menus are not cleared.
Solution:   Also clear terminal menus. Remove condition that is always true.
            (closes vim/vim#10641)
79ae152697
2022-07-01 21:02:59 +08:00
6486b0345a version.c: update [skip ci] #19179
Co-authored-by: marvim <marvim@users.noreply.github.com>
2022-07-01 03:26:42 -07:00
60604d6a99 vim-patch:9.0.0012: signature files not detected properly (#19172)
Problem:    Signature files not detected properly.
Solution:   Add a function to better detect signature files. (Doug Kearns)
cdbfc6dbab
2022-07-01 07:08:44 +02:00
8f5bcfb0e4 Merge pull request #19178 from zeertzjq/vim-8.2.0049
vim-patch:8.2.0049: command line completion not fully tested
2022-07-01 11:49:48 +08:00
b22f7dd908 test(old): reorder test_cmdline.vim to match upstream 2022-07-01 11:17:33 +08:00
300490f2e8 vim-patch:8.2.0049: command line completion not fully tested
Problem:    Command line completion not fully tested.
Solution:   Add more test cases.  Make help sorting stable. (Dominique Pelle,
            closes vim/vim#5402)
297610ba4b
2022-07-01 11:02:55 +08:00
2268a4147e Merge pull request #19170 from zeertzjq/vim-8.0.1558
vim-patch:8.0.{1558,1570,1574,1588},8.1.{0487,0695,1274}: menu features
2022-07-01 10:49:14 +08:00
5a62ad605e feat(ui): make right-click menu work properly with ext_multigrid
Add tests both with and without ext_multigrid.
2022-07-01 10:28:07 +08:00
236947ab20 vim-patch:8.1.1274: after :unmenu can still execute the menu with :emenu
Problem:    After :unmenu can still execute the menu with :emenu.
Solution:   Do not execute a menu that was disabled for the specified mode.
ce79353ace
2022-07-01 10:17:39 +08:00
d81d8d454a vim-patch:8.1.0695: internal error when using :popup
Problem:    Internal error when using :popup.
Solution:   When a menu only exists in Terminal mode give an error. (Naruhiko
            Nishino, closes vim/vim#3765)
f42b45d719
2022-07-01 10:17:39 +08:00
015778a381 vim-patch:8.1.0487: no menus specifically for the terminal window
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes vim/vim#3439) Add a menu test.
4c5d815256

ADDR_OHTER comes from patch 8.1.1241, which has already been ported.
2022-07-01 10:17:39 +08:00
5551a29d06 vim-patch:8.0.1588: popup menu hangs after typing CTRL-C
Problem:    Popup menu hangs after typing CTRL-C.
Solution:   Make CTRL-C exit the loop. (Ozaki Kiichi, closes vim/vim#2697)
52f18a112a
2022-07-01 10:17:39 +08:00
e4c2ff2da4 vim-patch:8.0.1574: show cursor in wrong place when using popup menu
Problem:    Show cursor in wrong place when using popup menu. (Wei Zhang)
Solution:   Force updating the cursor position.  Fix skipping over unused
            entries.
987723e084
2022-07-01 10:17:39 +08:00
610cf9f950 vim-patch:8.0.1570: can't use :popup for a menu in the terminal
Problem:    Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
            included that don't work in the current state.
29a2c08d79
2022-07-01 10:17:39 +08:00
cf8df141f3 vim-patch:8.0.1558: no right-click menu in a terminal
Problem:    No right-click menu in a terminal.
Solution:   Implement the right click menu for the terminal.
aef8c3da2b
2022-07-01 10:13:06 +08:00
5a490d838e cmdheight=0: fix bugs #18961
Continue of #16251

Fix #18953
Fix #18960
Fix #18958
Fix #18955
Fix #18970
Fix #18983
Fix #18995
Fix #19112
2022-06-30 18:59:50 -07:00
3b1423bfa7 fix(filetype): update call sites of vim.filetype.match (#19171)
These were not updated in #18895.
2022-06-30 09:54:44 -06:00
565f72b968 feat(marks): restore viewport on jump #15831
** Refactor

Previously most functions used to "get" a mark returned a position,
changed the line number and sometimes changed even the current buffer.

Now functions return a {x}fmark_T making calling context aware whether
the mark is in another buffer without arcane casting. A new function is
provided for switching to the mark buffer and returning a flag style
Enum to convey what happen in the movement. If the cursor changed, line,
columns, if it changed buffer, etc.

The function to get named mark was split into multiple functions.

- mark_get() -> fmark_T
- mark_get_global() -> xfmark_T
- mark_get_local() -> fmark_T
  - mark_get_motion() -> fmark_T
  - mark_get_visual() -> fmark_T

Functions that manage the changelist and jumplist were also modified to
return mark types.

- get_jumplist -> fmark_T
- get_changelist -> fmark_T

The refactor is also seen mainly on normal.c, where all the mark
movement has been siphoned through one function nv_gomark, while the
other functions handle getting the mark and setting their movement
flags. To handle whether context marks should be left, etc.

** Mark View

While doing the refactor the concept of a mark view was also
implemented:

The view of a mark currently implemented as the number of lines between
the mark position on creation and the window topline. This allows for
moving not only back to the position of a mark but having the window
look similar to when the mark was defined. This is done by carrying and
extra element in the fmark_T struct, which can be extended later to also
restore horizontal shift.

*** User space features

1. There's a new option, jumpoptions+=view enables the mark view restoring
automatically when using the jumplist, changelist, alternate-file and
mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark]

** Limitations

- The view information is not saved in shada.
- Calls to get_mark should copy the value in the pointer since we are
  using pos_to_mark() to wrap and provide a homogeneous interfaces. This
  was also a limitation in the previous state of things.
2022-06-30 05:59:52 -07:00
3fe6b99abc refactor: enable -Wconversion warning for memline.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-30 14:51:38 +02:00
cb84f5ee53 refactor(uncrustify): change config to better align with style guide (#18803)
refactor(uncrustify): change config to better align with neovim style
2022-06-30 20:27:52 +08:00
69cd0ba27b vim-patch:9.0.0011: reading beyond the end of the line with put command (#19166)
Problem:    Reading beyond the end of the line with put command.
Solution:   Adjust the end mark position.
d25f003342
2022-06-30 20:16:00 +08:00
37af46bb4c feat(build): add_glob_target runs only on changed files #19070
The general idea is that add_glob_targets creates a "touch file", a
dummy file that acts as a dependency in order to check which files are
outdated since the last time the target was run.

Remove RunUncrustify.cmake as it's no longer necessary. It was initially
introduced to silence its noisy output. The per-file targets will
suppress the noisy output from uncrustify, except for the very first
run.

Also remove DefCmdTarget.cmake since add_glob_target already
incorporates its functionality.
2022-06-30 05:10:05 -07:00
f50135a32e feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem:
- Since c57f6b28d7 #8519, sockets are created in ~/.local/… but XDG
  spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which
  implies that XDG_STATE_DIR is potentially non-local.
- Not easy to inspect Nvim-created temp files (for debugging etc).

Solution:
- Store sockets in stdpath('run') ($XDG_RUNTIME_DIR).
- Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims.
- Make ok() actually useful.
- Introduce assert_nolog().

closes #3517
closes #17093
2022-06-30 04:16:46 -07:00
514e76e4b2 vim-patch:9.0.0001: Travis CI is no longer used #19163
Problem:    Travis CI is no longer used.
Solution:   Delete the Travis CI configuration. (Hugo Osvaldo Barrera,
            closes vim/vim#10636)
75417d960b
2022-06-30 03:12:08 -07:00
ba5be650a7 Merge pull request #19134 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for fileio.c
2022-06-30 11:51:07 +02:00
995e487915 refactor(highlight)!: rename attributes to match Vim (#19159)
Ref: 84f5463630
Rename:
- `underlineline` to `underdouble`
- `underdot` to `underdotted`
- `underdash` to `underdashed`

`underdouble` also now takes higher precedence than `undercurl`.
2022-06-30 16:57:44 +08:00
593f2f753f refactor: enable -Wconversion warning for fileio.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-29 22:00:56 +02:00
6f6286e4f9 fix(lsp): small bugs in snippet-parser #18998
This fixes the following bugs:
`${1:else_text}` -> format with if_text: "else_text"
`${1:-else_text}` -> format with if_text: "else_text"
`${1:}` in `format` (eg. empty else_text) -> error.
`${1:}` (eg. empty placeholder) -> error.

Thanks hrsh7th :)
2022-06-29 09:53:49 -07:00
1eb9624666 vim-patch:9.0.0006: not all Visual Basic files are recognized (#19153)
Problem:    Not all Visual Basic files are recognized.
Solution:   Change detection of *.cls files. (Doug Kearns)
8b5901e2f9
2022-06-29 18:43:56 +02:00
ba583f8206 vim-patch:9.0.0005: hare files are not recognized (#19151)
Problem:    Hare files are not recognized.
Solution:   Add a filetype pattern. (Hugo Osvaldo Barrera, closes vim/vim#10630)
040674129f
2022-06-29 16:21:04 +02:00
8ea09fc908 vim-patch:8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' (#19147)
Problem:    Incsearch highlight broken when calling searchcount() in 'tabLine'
            function. (Mirko Palmer)
Solution:   Save and restore the incsearch state. (Christian Brabandt,
            closes vim/vim#9763, closes vim/vim#9633)
6dd7424c7e
2022-06-29 19:34:37 +08:00
bab32bba7a vim-patch:9.0.0002: map functionality outside of map.c (#19150)
Problem:    Map functionality outside of map.c.
Solution:   Move f_hasmapto() to map.c.  Rename a function. (closes vim/vim#10611)
c207fd2535
2022-06-29 19:25:38 +08:00
21a1f1f552 Merge pull request #19133 from famiu/feat/api/cmd_support_filter
feat(api): make `nvim_parse_cmd` and `nvim_cmd` support :filter
2022-06-29 09:12:01 +02:00
01fc5097d3 Merge #19139 build(cmake): fix static libintl on macOS 2022-06-29 03:41:40 +02:00
998dc07288 feat: update unicode tables #19135 2022-06-28 18:34:56 -07:00
3cc8559963 Merge pull request #19141 from bfredl/mapchar
refactor: define builtin mappings and autocmds without pseudo-excmds
2022-06-29 00:46:25 +02:00
7ab2e12ebc refactor(aucmd): call define_autocmd() directly for default autocmds 2022-06-28 23:41:46 +02:00
83170a4986 refactor(map): simplify add_map params 2022-06-28 23:40:27 +02:00
674787feae ci(release): link gettext include directory
Our previous mangling of gettext broke the `HAVE_WORKING_LIBINTL` test
because it prevented CMake from finding `libintl.h`. Let's fix that by
linking Gettext's `include` directory into `/usr/local` too.
2022-06-29 02:19:45 +08:00
be40ba68a8 build(cmake): fix static libintl test on macOS
If `libintl` is a static library on macOS, we also need to explicitly
link with `libiconv` and the `CoreFoundation` framework. Otherwise, our
`HAVE_WORKING_LIBINTL` test erroneously fails.

Closes #19127
Closes #19138
2022-06-29 02:19:42 +08:00
e0f605bfd8 Merge #19120 build: rename build-related dirs 2022-06-28 13:35:56 +02:00
606ec8b708 feat(api): make nvim_parse_cmd and nvim_cmd support :filter
Also fixes a memory leak in `parse_cmdline`.

Closes #18954.
2022-06-28 17:31:04 +06:00
9e14744099 fix(coverity): redundant assert #19059
* fix(coverity/353303): redundant assert
  eap->line2 is an int32_t, it is always lower than INT_MAX.
* fix(coverity/353302): redundant assert
2022-06-28 04:24:21 -07:00
4c0c6f8428 build: move unicode/ to src/unicode/ 2022-06-28 04:05:11 -07:00
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00
9ddb481d88 refactor(ci): cleanup release.yml #19132 2022-06-28 03:40:53 -07:00
094086a713 Merge #19060 memory leaks 2022-06-28 12:37:39 +02:00
ee6b21e843 fix(vim.ui.input): accept nil or empty "opts" #19109
Fix #18143
2022-06-28 02:53:15 -07:00
014a88799a refactor: replace char_u #18429
Work on https://github.com/neovim/neovim/issues/459
2022-06-28 02:31:54 -07:00
7e1cf6b764 fix(inccommand): parse the command to check if it is previewable
Free regprog if command isn't previewable

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-06-28 13:00:05 +08:00
274609a109 vim-patch:069a7d561bbe (#19130)
Update runtime files
069a7d561b
2022-06-27 23:35:26 +02:00
f2fa11708c fix(filetype): check for non-nil match in detect.rules (#19129) 2022-06-27 20:43:37 +02:00
0c363d1a70 Merge pull request #19122 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for message.c
2022-06-27 17:07:21 +02:00
2dd01e3e21 refactor: enable -Wconversion warning for message.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-27 13:55:40 +02:00
f3c8f3e5d4 vim-patch:partial:8a3b805c6c9c (#19104)
Update runtime files
8a3b805c6c

skip builtin.txt (needs 8.2.4838)
skip message.txt (whitespace changes)
2022-06-27 10:23:09 +02:00
f10489d9c2 Merge pull request #19077 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for ex_cmds.c
2022-06-27 10:09:33 +02:00
6f3508f8ed refactor(filetype): allow vim.filetype.match to accept buf and filename (#19114)
This is necessary in cases where filetype detection acts recursively.
For example, when matching files that end with .bak, the "root" of
the filename is matched again against the same buffer (e.g. a buffer
named "foo.c.bak" will be matched again with the filename "foo.c", using
the same underlying buffer).
2022-06-27 10:03:43 +02:00
eab8b998e9 build: move man/ to src/man/ #19119
Problem:
man/ contains source files for manpage generation, it doesn't need to
live at the project root.

Solution:
Move it to src/man/.
2022-06-27 01:02:02 -07:00
8c2b870544 fix(api): change default value of 'pattern' in nvim_exec_autocmds (#19115)
Omitting 'pattern' in nvim_exec_autocmds should be equivalent to
omitting the 'fname' argument in :doautoall, which is equivalent to
using an empty string as the pattern. Fixes regression introduced
in #19091.
2022-06-27 09:51:33 +02:00
cf23695dd7 fix(api): nvim_parse_cmd check for ambiguous user command (#19116) 2022-06-27 14:10:13 +08:00
e2f9d0332b test: use "python3" to avoid skipped test #19106
Problem:
The "calls executable in $PATH" is skipped on some CI jobs because
"python" is not found.

Solution:
Use "python3" instead.
2022-06-26 22:03:06 -07:00
89f75dcd1f fix(coverity/348300): free memory when overiding sing attribute
Nothing prevent the user from doing `:sign define abc culhl=Normal
culhl=Normal` and thus this leads to an obvious memory leak.
2022-06-27 06:55:41 +02:00
a0a815ec57 Merge pull request #18716 from zeertzjq/vim-8.2.5007
vim-patch:8.2.{3484,5007,5123}: spell suggestion fixes
2022-06-27 06:45:00 +08:00
6711d001c5 fix(spell): make setting 'encoding' clear word list 2022-06-27 05:33:54 +08:00
f0d4007f62 vim-patch:8.2.5123: using invalid index when looking for spell suggestions
Problem:    Using invalid index when looking for spell suggestions.
Solution:   Do not decrement the index when it is zero.
156d391195
2022-06-27 05:33:54 +08:00
80af2c6055 vim-patch:8.2.5007: spell suggestion may use uninitialized memory
Problem:    Spell suggestion may use uninitialized memory. (Zdenek Dohnal)
Solution:   Avoid going over the end of the word.
6d24b4ff69
2022-06-27 05:33:54 +08:00
bafb53604a vim-patch:8.2.3484: crash when going through spell suggestions
Problem:    Crash when going through spell suggestions.
Solution:   Limit the text length for finding suggestions to the original
            length.  Do not update buffers when exiting. (closes vim/vim#8965)
e275ba4fc9
2022-06-27 05:33:54 +08:00
516d6318b7 Merge pull request #19091 from clason/do-aucmd-pats
feat(api): support pattern array for exec_autocmds
2022-06-26 23:05:52 +02:00
f3ce06cfa1 refactor(filetype)!: allow vim.filetype.match to use different strategies (#18895)
This enables vim.filetype.match to match based on a buffer (most
accurate) or simply a filename or file contents, which are less accurate
but may still be useful for some scenarios.

When matching based on a buffer, the buffer's name and contents are both
used to do full filetype matching. When using a filename, if the file
exists the file is loaded into a buffer and full filetype detection is
performed. If the file does not exist then filetype matching is only
performed against the filename itself. Content-based matching does the
equivalent of scripts.vim, and matches solely based on file contents
without any information from the name of the file itself (e.g. for
shebangs).

BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead 
of `vim.filetype.match(name, bufnr)`
2022-06-26 18:41:20 +02:00
5c8025967e refactor(api): use FOREACH_ITEM macro in autocmd 2022-06-26 17:57:45 +02:00
ae3e371303 docs(release): suggest "xattr" for macos release #19100 2022-06-26 08:46:37 -07:00
da358d4521 feat(api): support pattern array for exec_autocmds 2022-06-26 13:04:45 +02:00
3d45706478 build: guard free_locales with HAVE_WORKING_LIBINTL #19095
With 4c7462fdb3, when `libintl` is turned off via
`-DENABLE_LIBINTL=OFF`, Neovim does not compile in Debug mode with the following
error message:

```
...
[201/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval.c.o
FAILED: src/nvim/CMakeFiles/nvim.dir/eval.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DEXITFREE -DINCLUDE_GENERATED_DECLARATIONS -DMIN_LOG_LEVEL=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -Dnvim_EXPORTS -I/Users/hat/Projects/neovim/build/config -I/Users/hat/Projects/neovim/src -I/Users/hat/Projects/neovim/build/src/nvim/auto -I/Users/hat/Projects/neovim/build/include -I/Users/hat/Projects/neovim/.deps/usr/include/luajit-2.1 -isystem /Users/hat/Projects/neovim/.deps/usr/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -g -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always  -Wno-conversion -MD -MT src/nvim/CMakeFiles/nvim.dir/eval.c.o -MF src/nvim/CMakeFiles/nvim.dir/eval.c.o.d -o src/nvim/CMakeFiles/nvim.dir/eval.c.o -c /Users/hat/Projects/neovim/src/nvim/eval.c
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: error: implicit declaration of function 'free_locales' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  free_locales();
  ^
/Users/hat/Projects/neovim/src/nvim/eval.c:473:3: note: did you mean 'free_titles'?
/Users/hat/Projects/neovim/build/include/buffer.h.generated.h:58:16: note: 'free_titles' declared here
DLLEXPORT void free_titles(void);
               ^
1 error generated.
[212/331] Building C object src/nvim/CMakeFiles/nvim.dir/eval/funcs.c.o
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1
```

The previous commit, b1b5802009, to 4c7462f does
not have this issue. As you can see in the following, the issue occurs only in
Debug mode with `libintl` turned off:

```bash
# No issue
git checkout b1b5802

# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"

# Compile error when in Debug and libintl turned off
git checkout 4c7462f

# The following Debug build does not work
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"

# The following Debug build works
make distclean; make SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

# The following Release build works
make distclean; make CMAKE_BUILD_TYPE=Release SDKROOT=$(xcrun --sdk macosx --show-sdk-path) CMAKE_EXTRA_FLAGS="-DENABLE_LIBINTL=OFF"
```

I noticed this because I turn `libintl` off when compiling `libnvim` for VimR.

Fix #19093
2022-06-26 03:17:57 -07:00
7dd73625dc revert: "oldtests: use expand() to fix pathsep" (#19073)
This reverts commit e3687165a7.

No longer needed after #10679.
2022-06-26 05:31:27 +08:00
42e8774317 vim-patch:e1dc76fbf333 (#19092)
Update runtime files
e1dc76fbf3
2022-06-25 21:56:51 +02:00
69e7b664d8 Merge pull request #19090 from bfredl/luaprg
fix(build): don't disable byte precompilation on debug builds
2022-06-25 20:30:43 +02:00
cb58b673e5 fix(build): don't disable byte precompilation on debug builds
This special casing is redundant since long, as you can disable
the binary cache regardless of build type with the --luamod-dev flag
2022-06-25 19:24:48 +02:00
9f592780b5 Merge pull request #16271 from 3N4N/fix-15913
fix: make_filter_cmd for powershell as shell
2022-06-25 17:52:39 +02:00
f977f9445f refactor(tests): introduce testprg()
Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
2022-06-25 08:27:17 -07:00
0b9664f524 fix: make_filter_cmd for :! powershell #15913
Problem:
Nvim fails to create tempfile "…/nvim6UJx04/7" when 'shell' is set to
pwsh (PowerShell Core). This breaks filtered shell commands ":{range}!".
With shell set to cmd, it works.

Solution:
PowerShell doesn't use "<" for stdin redirection. Instead, use
"-RedirectStandardInput".

Closes #15913
2022-06-25 07:20:58 -07:00
2217ab42c5 refactor: enable -Wconversion warning for ex_cmds.c
Work on https://github.com/neovim/neovim/issues/567
2022-06-25 15:49:32 +02:00
b7084fef4c fix(build): strip trailing newline from variable (#19084)
Problem: #19029 added a new fallback that sets
`$MACOSX_DEPLOYMENT_TARGET` to the local macOS version via `sw_vers`.
However, the output included a newline, which broke the generated Ninja
build script.

Solution: use `OUTPUT_STRIP_TRAILING_WHITESPACE` for `execute_process`.
2022-06-25 13:45:20 +02:00
a5175fe489 vim-patch:8.2.5022: 'completefunc'/'omnifunc' error does not end completion (#19083)
Problem:    'completefunc'/'omnifunc' error does not end completion.
Solution:   Check if there was an error or exception. (closes vim/vim#10486,
            closes vim/vim#4218)
9bcb9ca9c7
2022-06-25 18:38:35 +08:00
5c2c88717a Merge pull request #19029 from carlocab/macos-universal
ci: build universal release on macOS
2022-06-25 12:16:04 +02:00
ece2960f1b build(gen_vimdoc): remove needless list creation and unused variable (#19079)
build(gen_vimdoc): remove needless list creation
2022-06-25 18:03:02 +08:00
88a5941598 Merge pull request #19041 from lewis6991/globallocal
fix(api): nvim_set_option_value for global-local options
2022-06-25 11:09:55 +02:00
35e89bf903 fix(filetype.lua): always return a string in getlines function (#19080)
This re-introduces the fix that the filetype.lua refactor inadvertently reverted.
The fix ensures that in the case when end_lnum is omitted, a string is always returned.
2022-06-24 19:53:44 +02:00
d0644fa9bf ci(release): build a universal binary on macOS
After some tweaks to our dep builds, we can now build a universal binary
for macOS by using `CMAKE_OSX_ARCHITECTURES`. So, let's do that. This
requires a number of additional changes:

1. We need to build on macOS 11, since earlier versions do not support
   building universal (M1 + Intel) binaries.
2. We need to provision a universal `libintl`. The linker will look for
   an ARM64 version of this library when linking the `nvim` binary.

While we're here:
1. Link statically to `libintl`. This allows to to avoid having to do
   any install name rewriting or codesigning to package Neovim.
2. Bump the `MACOSX_DEPLOYMENT_TARGET` to `11`. We're already using a
   `libintl` built by Homebrew (through the pre-installed version of
   `gettext`), and that is built for macOS 11.

In order to ensure we link to `libintl.a` instead of `libintl.dylib`, we
have to make sure that CMake can't find the latter. This ideally should
be a matter of doing `brew unlink gettext`. However, CMake is too adept
at finding things that Homebrew has installed (even when not linked), so
we have to do a bit more than that. This appears in the additional step
ensuring static linkage to `libintl`.

We end up breaking some Homebrew-installed software in the process, and
some of these software is called during our build (e.g. curl, git,
wget). To avoid any adverse effects, let's just uninstall them.
2022-06-25 00:25:05 +08:00
b70f160414 build(deps): support universal builds on macOS
CMake can handle building universal binaries on macOS using the
`CMAKE_OSX_ARCHITECTURES` variable. Let's pass this variable to the
relevant dep builds. We use the `LIST_SEPARATOR` argument to prevent the
shell from interpreting the `;` that CMake uses as a list separator.

For dependencies that don't build using CMake, we only need to make sure
that the compiler is invoked with the correct `-arch` flags. The
compiler does the rest.

The only exception to this is the LuaJIT build, which we handle
separately as a special case.
2022-06-24 23:43:11 +08:00
adcaf24f42 build(luajit): support universal builds on macOS
To build universal binaries on macOS, one typically only needs to pass
multiple `-arch` flags to `clang`.

Unfortunately, this strategy causes LuaJIT builds to fail. To work
around this, we build LuaJIT for each requested architecture
individually first and then use `lipo` to package each architecture
slice into a universal binary.

To be able to do this on an Intel macOS host or an M1 macOS host without
a Rosetta installation, we need some special flags in order to tell
LuaJIT that it is cross-compiling for a different target. See [1] for
details.

[1] https://luajit.org/install.html#cross
2022-06-24 23:34:57 +08:00
12c62ddea6 Merge pull request #19071 from bfredl/minimap
perf(map): some optimizations when setting mappings
2022-06-24 16:20:13 +02:00
823d9e0af1 vim-patch:a57b553b4328 (#19076)
Update runtime files
a57b553b43
2022-06-24 14:45:07 +02:00
777faa29b3 refactor(map): statically initialize maphash array 2022-06-24 14:40:27 +02:00
f3ee62a743 refactor(map): simplify free_all_mem handling 2022-06-24 14:40:09 +02:00
a8ecc1ae6d perf(map): avoid extraneous heap allocations when setting mappings
- don't immediately vim_strsave and then xfree a heap buffer.
- allow replace_termcodes to take in a buffer instead of allocating it
- grug! memory allocation bad!
2022-06-24 13:53:42 +02:00
614fd3a883 perf(map): visit only one hash bucket instead of all, like an actual hash table 2022-06-24 12:56:24 +02:00
fd3008a6ae fix(coverity/348313): don't exit too early in runtime_default 2022-06-24 09:41:13 +02:00
7add9ea0e7 fix(coverity/352829): correctly free memory in f_call
This function was not freeing allocated memory that it owns when calling
functions from lua.
2022-06-24 09:41:12 +02:00
3a4fa22bad Merge pull request #19072 from zeertzjq/vim-8.2.4628
vim-patch:8.2.{4628,4895,4977,5146,5154}
2022-06-24 09:04:56 +08:00
affeb5c6dd vim-patch:8.2.5146: memory leak when substitute expression nests
Problem:    Memory leak when substitute expression nests.
Solution:   Use an array of expression results.
44ddf19ec0

Cherry-pick a comment change from patch 8.2.5057.

N/A patches for version.c:

vim-patch:8.2.5154: still mentioning version8, some cosmetic issues

Problem:    Still mentioning version8, some cosmetic issues.
Solution:   Prefer mentioning version9, cosmetic improvements.
abd56da30b
2022-06-24 07:26:06 +08:00
589f418fce vim-patch:8.2.4977: memory access error when substitute expression changes window
Problem:    Memory access error when substitute expression changes window.
Solution:   Disallow changing window in substitute expression.
e2bd8600b8

"textwinlock" was renamed back to "textlock" in patch 8.2.5029.
2022-06-24 07:26:06 +08:00
0cf0be302b vim-patch:8.2.4895: buffer overflow with invalid command with composing chars
Problem:    Buffer overflow with invalid command with composing chars.
Solution:   Check that the whole character fits in the buffer.
d88934406c
2022-06-24 07:26:06 +08:00
764dc7c383 vim-patch:8.2.4628: not enough testing for 2/3 letter substitute commands
Problem:    Not enough testing for 2/3 letter substitute commands.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#10019)
5e877baf87
2022-06-24 07:26:06 +08:00
a9cb0b8a5a fix(tests): remove misleading $TEST_PATH segment #19050
Problem:
RunTests.cmake adds $TEST_PATH to $TMPDIR with the implication that it
gives more isolation. But this is misleading because $TEST_PATH is only
defined once. Full test runs use the same $TMPDIR for all tests.

This was likely added with the intention of invoking RunTests.cmake
once-per-testfile from a wrapper than does the isolation/orchestration.
But even so, Nvim's vim_maketempdir() / vim_mktempdir() _already_
creates a unique tempdir per session.

Solution:
Don't append $TEST_PATH to $TMPDIR. Avoids confusion and makes the path
shorter.
2022-06-23 16:15:55 -07:00
c00a3f45d4 vim-patch:8cc5b559f700 (#19066)
Update runtime files
8cc5b559f7
2022-06-23 15:57:51 +02:00
3c85fd817e fix(api): check for inclusive buffer line index out of bounds correctly (#19056) 2022-06-23 21:38:00 +08:00
7718b75846 refactor: move some mapping-related code to a separate file (#19061)
This marks the following Vim patches as ported:

vim-patch:8.1.1785: map functionality mixed with character input

Problem:    Map functionality mixed with character input.
Solution:   Move the map functionality to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#4740)  Graduate the +localmap feature.
b66bab381c

vim-patch:8.2.3643: header for source file is outdated

Problem:    Header for source file is outdated.
Solution:   Make the header more accurate. (closes vim/vim#9186)
a3f83feb63

Also cherry-pick a change for <unique> mappings from patch 8.2.0807.
Rename map_clear_mode() to do_mapclear().
2022-06-23 21:17:11 +08:00
05ca14a881 Merge pull request #19058 from bfredl/miniopt
perf(highlight): use binary search to lookup RGB color names
2022-06-23 13:42:57 +02:00
84de4d8655 vim-patch:8.2.5152: search() gets stuck with "c" and skip evaluates to true (#19064)
Problem:    search() gets stuck with "c" and skip evaluates to true.
Solution:   Reset the SEARCH_START option. (closes vim/vim#10608)
180246cfd1
2022-06-23 19:34:43 +08:00
a3ce03bef1 Merge pull request #19020 from echasnovski/screenchar-float
fix(float): make `screen*()` functions respect floating windows
2022-06-23 12:01:27 +02:00
9690f8c57b perf(highlight): use binary search to lookup RGB color names 2022-06-23 11:48:12 +02:00
9f28eddfab fix(float): make screen*() functions respect floating windows
Resolves #19013.
2022-06-23 10:34:02 +03:00
e694e56422 vim-patch:8.2.2068: transparent syntax item uses start/end of containing region (#19055)
Problem:    Transparent syntax item uses start/end of containing region.
Solution:   Do not change the startpos and endpos of a transparent region to
            that of its containing region. (Adrian Ghizaru, closes vim/vim#7349,
            closes vim/vim#7391)
b46f57e87b
2022-06-23 13:01:31 +08:00
1b75094e3e Merge pull request #19054 from zeertzjq/vim-8.2.5150
vim-patch:8.2.{5150,5151}: reading beyond the end of the line
2022-06-23 07:37:54 +08:00
a4d7394bc8 vim-patch:8.2.5151: reading beyond the end of the line with lisp indenting
Problem:    Reading beyond the end of the line with lisp indenting.
Solution:   Avoid going over the NUL at the end of the line.
8eba2bd291
2022-06-23 06:34:56 +08:00
f088915495 vim-patch:8.2.5150: read past the end of the first line with ":0;'{"
Problem:    Read past the end of the first line with ":0;'{".
Solution:   When on line zero check the column is valid for line one.
f7c7c3fad6
2022-06-23 06:25:05 +08:00
801faeaae2 fix(input): use correct grid when restoring cursor for <expr> mapping (#19047) 2022-06-23 06:04:03 +08:00
c94325288a fix(api): check error after getting win/buf handle (#19052) 2022-06-22 13:19:03 -06:00
b20b28249b fix(build): only pass -municode if MINGW #19049
Avoids this warning in the Windows build:

    2022-06-22T08:58:13.0542153Z LINK : warning LNK4044: unrecognized option '/municode'; ignored [D:\a\neovim\neovim\build\test\functional\fixtures\printenv-test.vcxproj]
2022-06-22 07:09:19 -07:00
d23465534a fix(api): nvim_set_option_value for global-local options
global-local window options need to be handled specially. When `win` is
given but `scope` is not, then we want to set the local version of the
option but not the global one, therefore we need to force
`scope='local'`.

Note this does not apply to window-local only options (e.g. 'number')

Example:

   nvim_set_option_value('scrolloff', 10, {})       -- global-local window option; set global value
   nvim_set_option_value('scrolloff', 20, {win=0})  -- global-local window option; set local value
   nvim_set_option_value('number', true, {})        -- local window option

is now equivalent to:

   nvim_set_option_value('scrolloff', 10, {})
   nvim_set_option_value('scrolloff', 20, {win=0, scope='local'})  -- changed from before
   nvim_set_option_value('number', true, {win=0})                  -- unchanged from before

Only the global-local option with a `win` provided gets forced to local
scope.
2022-06-22 11:08:30 +01:00
dd591adf8a Merge pull request #19039 from bfredl/multicolor
perf: get rid of unnecessary allocations in highlight groups
2022-06-22 10:49:36 +02:00
f17d88c47a vim-patch:8.2.5132: :mkview test doesn't test much (#19045)
Problem:    :mkview test doesn't test much.
Solution:   Save the view with the folds closed. (James McCoy, closes vim/vim#10596)
c829faa821
2022-06-22 11:08:00 +08:00
34ae896b82 refactor(option): DRY get/set option value #19038
The main motivation for this is for the buf and win cases which need to
set up and restore context, and it's what specifically makes the
semantics of options nuanced, and thus this should not be repeated more
than once.

- nvim_get/set_option_value now share argument validation.
2022-06-21 19:09:50 -07:00
04592759fa Merge pull request #19043 from dundargoc/cmake
build(cmake): use glob_wrapper instead of file(GLOB ...) in main CMakeLists
2022-06-22 00:06:35 +02:00
230cb00cc5 build(cmake): use glob_wrapper instead of file(GLOB in main CMakeLists
This will allow cmake to check if any directories needs re-globbing, in
other words, if any new file has been added since last time cmake was
run. This will (allegedly) make the configure stage slower but I have
not noticed any difference so I believe this is well worth it.
2022-06-21 23:29:05 +02:00
e3b51d5842 refactor(runtime): refactor filetype.lua (#18813)
Move some filetype detection functions to detect.lua,
sort patterns by detected filetype.
2022-06-21 11:29:52 -06:00
8cd94e3bc0 perf(ui): remove spurious allocations from mode_style_array() 2022-06-21 18:40:35 +02:00
a9442c532e perf(highlight): allocate permanent names in an arena for fun and cache locality 2022-06-21 18:40:35 +02:00
1dad288432 refactor: remove atrocious HL_TABLE()[idx] syntax before I poke my eyes out 2022-06-21 18:40:35 +02:00
ce7d18f86a refactor(highlight): get rid of syn_unadd_group()
This is a sham. if the user does

  hi ExistingGroup guifg=AliceBlue invalidkey=foobar

the "guifg" part will still be executed. No need to micro-manage
the same case where ANewGroup is added instead.
2022-06-21 18:40:35 +02:00
374e0b6678 perf(highlight): don't allocate duplicates for color names 2022-06-21 18:40:33 +02:00
5ad97fcc0e perf(highlight): get rid of local memory allocations for "{key}={arg}" 2022-06-21 18:09:11 +02:00
f479dd0bbe docs(deprecated): alternatives for $NVIM_LISTEN_ADDRESS 2022-06-21 10:25:44 +02:00
6d52a29c3b Merge pull request #18743 from gpanders/bowooptvalue
Add "buf" and "win" to nvim_get_option_value and use them in vim.bo and vim.wo
2022-06-20 17:28:37 -06:00
bc6a5943de Merge pull request #19030 from zeertzjq/vim-8.2.5138
vim-patch:8.2.{5107,5138}: various small issues
2022-06-21 07:06:56 +08:00
7a309311a2 vim-patch:d799daa660b8 (#19031)
Update runtime files
d799daa660
2022-06-20 18:47:30 +02:00
87a68b6a3a refactor: use nvim_{get,set}_option_value for vim.{b,w}o
`nvim_get_option_value` and `nvim_set_option_value` better handle
unsetting local options. For instance, this is currently not possible:

    vim.bo.tagfunc = nil

This does not work because 'tagfunc' is marked as "local to buffer" and
does not have a fallback global option. However, using :setlocal *does*
work as expected

    :setlocal tagfunc=

`nvim_set_option_value` behaves more like :set and :setlocal (by
design), so using these as the underlying API functions beneath vim.bo
and vim.wo makes those two tables act more like :setlocal. Note that
vim.o *already* uses `nvim_set_option_value` under the hood, so that
vim.o behaves like :set.
2022-06-20 09:16:21 -06:00
58d028f64b feat(api): add "buf" and "win" to nvim_get_option_value
These mirror their counterparts in nvim_set_option_value.
2022-06-20 09:16:21 -06:00
99ef06d846 refactor(provider): use list comprehension #19027
- list(filter(lambda x: x != "", sys.path))
+ [p for p in sys.path if p != ""]
2022-06-20 06:17:00 -07:00
e3bfc1293e Merge pull request #18988 from bfredl/uipack
refactor(ui): encode "redraw" events without intermediate allocations
2022-06-20 15:04:40 +02:00
9aaff18489 vim-patch:8.2.5138: various small issues
Problem:    Various small issues.
Solution:   Various small improvments.
8088ae95bb

N/A patches for version.c:

vim-patch:8.2.5107: some callers of rettv_list_alloc() check for not OK

Problem:    Some callers of rettv_list_alloc() check for not OK. (Christ van
            Willegen)
Solution:   Use "==" instead of "!=" when checking the return value.
93a1096fe4
2022-06-20 20:51:11 +08:00
5d69872105 perf(ui): reduce allocation overhead when encoding "redraw" events
Note for external UIs: Nvim can now emit multiple "redraw" event batches
before a final "flush" event is received. To retain existing behavior,
clients should make sure to update visible state at an explicit "flush"
event, not just the end of a "redraw" batch of event.

* Get rid of copy_object() blizzard in the auto-generated ui_event layer
* Special case "grid_line" by encoding screen state directly to
  msgpack events with no intermediate API events.
* Get rid of the arcane notion of referring to the screen as the "shell"
* Array and Dictionary are kvec_t:s, so define them as such.
* Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with
  a predetermined size within an arena.
* Eliminate redundant capacity checking when filling such kvec_t:s
  with values.
2022-06-20 12:44:56 +02:00
b2ed439bd5 Merge #19015 delete cmake code 2022-06-19 19:51:16 +02:00
a195dc7c83 fix(decorations): nvim_buf_set_extmark breaks conceal #19010
Closes #19007

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-19 10:33:54 -07:00
ae7a4ad3d7 build: remove FindLua.cmake since it's already built into cmake
FindLua.cmake is a copy from the cmake repo:
0419ecbcad/Modules/FindLua.cmake.
It's a cmake module, meaning it's already shipped with cmake by default.
There have been two changes done to our version of FindLua.cmake.

The first change is that

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

was changed to

include(FindPackageHandleStandardArgs.cmake)

This change is required only because we have imported FindLua.cmake
module but not FindPackageHandleStandardArgs module. Had FindLua been
called as a module as intended then this file would not need changing.

The second change is that support for Lua 5.4 is added. However, support
for any version of Lua except for 5.1 is disabled since
e322b5c864.

Because these changes from the upstream FindLua.cmake is unnecessary I
believe we can and should use the builtin FindLua.cmake instead of our
own.
2022-06-19 18:34:28 +02:00
636a309981 build(cmake): simplify def_cmd_target function
Instead of appending to a command output, append to an existing target
instead. The primary benefit is intermediary ...-cmd targets aren't
needed, we can instead append commands to the relevant target directly.
2022-06-19 18:34:28 +02:00
cd1b2998d3 build(cmake): simplify and speed up the uninstall target
More specifically, replace exec_program with file(REMOVE ...) so that
the uninstall target is run during the build stage instead of the
configure stage, significantly speeding up the target.

The code snippet that was removed is taken from the cmake FAQ
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake.
However, this uses undocumented features such as IMMEDIATE when calling
configure_file, which is an artifact from cmake 2.x (it's so old it's
difficult to find information on it). Similarly, this particular code
snippet has been around for a long time and originated from the cmake
mailing lists. Based on this I believe the in-file was a workaround for
the limitations of cmake back then and that it's not required anymore.
2022-06-19 18:34:28 +02:00
668591ae04 build(cmake): remove unnecessary globbing with file
There's no need to use globbing since there's only one file.
2022-06-19 18:34:28 +02:00
8a6f728315 build(cmake): remove unnecessary *-prereqs targets
Running the tests on their own works just fine.
2022-06-19 18:34:28 +02:00
837ea6da9f fix(tui): piping nodejs to nvim breaks input handling #18932
Problem:
Piping NodeJS output into Neovim makes the editor unusable.
This happens because NodeJS changes the tty state on exit after
Nvim calls uv_tty_set_mode(). (May not always happen due to race
condition.)
This should have been fixed by 4ba5b4a864 #13084. But some
commands and functions (:sleep, system(), …) call ui_flush()
internally, in particular the first tui_mode_change() is called before
the end of startup.

Steps to reproduce:
1. node -e "setTimeout(()=>{console.log('test')}, 1000)" | nvim -u NORC +"sleep 500m" -
2. The cursor key letters just overwrite the editor screen, and CTRL+C exits.

Solution:
Skip pending_mode_update during startup.
Note: Delaying ui_flush() entirely could be a more general solution
(emit a new UI event on VimEnter?). But "remote/coprocess TUI" #18375
could make all of this moot anyway.
Fixes #18470
2022-06-19 08:22:39 -07:00
c5c5d980a1 ci(release): skip CoreServices system library on macOS (#19021)
Problem:
The release script bundles a system library (CoreServices) that was
added in #18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that #18294 replaced with CoreServices).
2022-06-19 16:20:27 +02:00
7b2b44bce4 fix(ci): noisy logs, unreliable test #19019
Problem:
1. CI logs have too many (40+) logs mentioning SIGHUP:
   ```
   WRN 2022-06-18T16:05:47.075 T3568.22499.0/c deadly_signal:177: got signal 1 (SIGHUP)
   WRN 2022-06-18T16:05:47.273 T3569.91095.0/c deadly_signal:177: got signal 1 (SIGHUP)
   WRN 2022-06-18T16:05:47.651 T3570.59545.0/c deadly_signal:177: got signal 1 (SIGHUP)
   ```
2. TS parser test still sometimes fails on BSD CI.
3. remote_spec test fails too often.

Solution:
1. Log deadly signals at INFO level. It hasn't been helpful in CI, and
   for local troubleshooting it's reasonable to adjust the loglevel as
   needed.
2. Adjust the TS parser test again. ref #18911
3. Skip the remote_spec test. The `--remote` feature was merged before
   it was fully formed and needs to be revisited.
2022-06-18 19:19:08 -07:00
605631ac29 build(lint): set some linters as non-fatal #19018
luacheck and clint are the most important, and they are bundled.
The others are nice-to-have, and not always available (and not bundled),
so make them optional. This allows the "lint" target to function as
a convenient and low-hassle handle for contributors.

We still get the full power of lint in CI.

TODO: bundle uncrustify (and then set it as required for "lint")?
2022-06-18 11:10:10 -07:00
ff6b8f5435 fix(terminal): coverity USE_AFTER_FREE #18978
Problem:
Coverity reports use after free:

    *** CID 352784:  Memory - illegal accesses  (USE_AFTER_FREE)
    /src/nvim/buffer.c: 1508 in set_curbuf()
    1502         if (old_tw != curbuf->b_p_tw) {
    1503           check_colorcolumn(curwin);
    1504         }
    1505       }
    1506
    1507       if (bufref_valid(&prevbufref) && prevbuf->terminal != NULL) {
    >>>     CID 352784:  Memory - illegal accesses  (USE_AFTER_FREE)
    >>>     Calling "terminal_check_size" dereferences freed pointer "prevbuf->terminal".
    1508         terminal_check_size(prevbuf->terminal);
    1509       }
    1510     }
    1511
    1512     /// Enter a new current buffer.
    1513     /// Old curbuf must have been abandoned already!  This also means "curbuf" may

Solution:
Change terminal_destroy and terminal_close to set caller storage to NULL,
similar to XFREE_CLEAR. This aligns with the pattern found already in:
terminal_destroy e897ccad3e
term_delayed_free 3e59c1e20d
2022-06-18 09:53:12 -07:00
9c0f2253a5 fix(logging): try harder to resolve Nvim "name" #19016
Problem:
If startup finishes (starting=false) before the logger ever happens to
see a v:servername, we're stuck with the "?.<PID>" fallback name
forever.

Solution:
Drop the `starting` condition. Discard the "?.<PID>" fallback after
using it for the current log message. So logging will always check
v:servername next time.
2022-06-18 09:30:54 -07:00
1ad6423f02 fix(highlight): use ctermbg/fg instead of bg/fg when use_rgb=false #18982
If `use_rgb` was false, we would attempt to set the `cterm_bg_color` to the
variable `bg`, which is only retrieved from `bg` and `background` keys, not
`ctermbg`. Same for `fg`. This means the values would be `-1` (the default,
un-got value) and we'd always set the returned values to `0`.

My understanding is `fg/bg` is always "gui" values, so instead we should be
using `ctermbg` when needed.

Nb: when looking around I think this function is currently *always* called with
`use_rgb = true`.
2022-06-18 08:33:58 -07:00
901fde60c6 Merge pull request #19011 from zeertzjq/vim-8.2.5120
vim-patch:8.2.{5120.5121}
2022-06-18 20:02:52 +08:00
dc56b442d8 vim-patch:8.2.5121: interrupt test sometimes fails
Problem:    Interrupt test sometimes fails.
Solution:   Use a different file name.
8d6420631c

Add a modeline to test_interrupt.vim.
2022-06-18 19:37:45 +08:00
aab05cd5ff vim-patch:8.2.5120: searching for quotes may go over the end of the line
Problem:    Searching for quotes may go over the end of the line.
Solution:   Check for running into the NUL.
2f074f4685
2022-06-18 19:36:43 +08:00
966d55effe vim-patch:8.2.5116: "limit" option of matchfuzzy() not always respected (#19005)
Problem:    "limit" option of matchfuzzy() not always respected.
Solution:   Remove "else". (Kazuyuki Miyagi, closes vim/vim#10586)
47f1a55849
2022-06-18 13:43:02 +08:00
e651ae5864 vim-patch:d592deb33652 (#19002)
Update runtime files
d592deb336
2022-06-17 20:38:21 +02:00
98e2da7d50 fix(hl): return cterm fg/bg even if they match Normal #18981
Fixes #18980

- 831fa45ad8 is related but this doesn't regress that
- The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally
  carried from patch to patch starting all the way back in 29bc6dfabd where it
  was avoiding setting a HL attr. But `hlattrs2dict()` now is just
  informational.
2022-06-16 18:33:58 -07:00
e0aa1d87e8 test(treesitter): add benchmark #18989
add benchmark from #18109
2022-06-16 17:22:43 -07:00
1fe94cb008 docs: improve 'insertmode' emulation #18962
The current emulation script enters Insert mode much too frequently.
Using only BufWinEnter seems to be a closer simulation.

Also add a few more mappings.
2022-06-16 17:16:33 -07:00
c57f6b28d7 Merge #8519 feat: name, test ids, sockets in stdpath(state) 2022-06-17 01:23:48 +02:00
279bc71f3c Merge pull request #18760 from kevinhwang91/fix-treesitter-fold
fix(treesitter): new iter if folded
2022-06-16 18:29:27 +02:00
8780076a78 fix(treesitter): new iter if folded 2022-06-16 17:38:10 +02:00
35c9fe9895 vim-patch:8.2.5110: icon filetype not recognized from the first line (#18987)
Problem:    Icon filetype not recognized from the first line.
Solution:   Add a check for the first line. (Doug Kearns)
bf6614643f
2022-06-16 15:53:38 +02:00
179faa3edd fix(lua): clear got_int when calling vim.on_key() callback (#18979) 2022-06-16 18:51:36 +08:00
0e8186bdd8 fix(lua): highlight.on_yank can close timer in twice #18976
Steps to reproduce:

1. setting `vim.highlight.on_yank`
   ```
   vim.api.nvim_create_autocmd({ "TextYankPost" }, {
     pattern = { "*" },
     callback = function()
       vim.highlight.on_yank({ timeout = 200 })
     end,
   })
   ```
2. repeat typing `yeye` ...
3. causes the following error.
   ```
   Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x01e96970 is already closing
   stack traceback:
           [C]: in function 'close'
           vim/_editor.lua: in function ''
           vim/_editor.lua: in function <vim/_editor.lua:0>
   ```

📝 Test result before fix:

    [----------] Global test environment setup.
    [----------] Running tests from test/functional/lua/highlight_spec.lua
    [ RUN      ] vim.highlight.on_yank does not show errors even if buffer is wiped before timeout: 15.07 ms OK
    [ RUN      ] vim.highlight.on_yank does not show errors even if executed between timeout and clearing highlight: 15.07 ms ERR
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (string) 'Error executing vim.schedule lua callback: vim/_editor.lua:0: handle 0x02025260 is already closing
    stack traceback:
            [C]: in function 'close'
            vim/_editor.lua: in function ''
            vim/_editor.lua: in function <vim/_editor.lua:0>'
    Expected:
    (string) ''
2022-06-15 19:39:55 -07:00
1f2c2a35ad feat(server): instance "name", store pipes in stdpath(state)
Problem:
- Unix sockets are created in random /tmp dirs.
  - /tmp is messy, unclear when OSes actually clear it.
  - The generated paths are very ugly. This adds friction to reasoning
    about which paths belong to which Nvim instances.
- No way to provide a human-friendly way to identify Nvim instances in
  logs or server addresses.

Solution:
- Store unix sockets in stdpath('state')
- Allow --listen "name" and serverstart("name") to given a name (which
  is appended to a generated path).

TODO:
- is stdpath(state) the right place?
2022-06-15 19:29:51 -07:00
b6467dfc23 test(report): formatting, drop dumplog()
Don't need to dumplog() on each failed test because we now have test-ids
that associate log messages with tests.
2022-06-15 19:23:10 -07:00
8f06520594 feat(logging): include test-id in log messages
Problem:
1. Log messages (especially in CI) are hard to correlate with tests.
2. Since b353a5c05f #11886, dumplog() prints the logs next to test
   failures. This is noisy and gets in the way of the test results.

Solution:
1. Associate an incrementing id with each test and include it in log
   messages.
    - FUTURE: add v:name so Nvim instances can be formally "named"?
2. Mention "child" in log messages if the current Nvim is a child (based
   on the presence of $NVIM).

BEFORE:

    DBG … 12345      UI: event
    DBG … 12345      log_server_msg:722: RPC ->ch 1: …
    DBG … 12345      UI: flush
    DBG … 12345      inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … 23454      UI: stop
    INF … 23454      os_exit:594: Nvim exit: 0

AFTER:

    DBG … T57        UI: event
    DBG … T57        log_server_msg:722: RPC ->ch 1: …
    DBG … T57        UI: flush
    DBG … T57        inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … T57/child  UI: stop
    INF … T57/child  os_exit:594: Nvim exit: 0
2022-06-15 19:23:10 -07:00
fa4b0c3ba5 refactor(log): use msg_schedule_semsg #18950 2022-06-15 17:23:13 -07:00
4cc05a75ea vim-patch:8.2.5097: using uninitialized memory when using 'listchars' (#18974)
Problem:    Using uninitialized memory when using 'listchars'.
Solution:   Use the length returned by mb_char2bytes(). (closes vim/vim#10576)
74ac29cecd
2022-06-16 07:18:27 +08:00
0c6ad03c3f fix(ui): do not call showmode() when setting window height (#18969) 2022-06-15 19:41:58 +08:00
504d7decbd vim-patch:8c1b8cb2e0b5 (#18966)
Update runtime files
8c1b8cb2e0
2022-06-15 09:20:32 +02:00
1493efdc14 test: correct check for v:errmsg in inccommand test (#18968)
After the first separator is typed v:errmsg can be set.
Check for its value before typing the first separator.
2022-06-15 10:18:43 +08:00
6de7f32d52 docs: fix typos (#18866)
docs: fix typos and similarly insignificant changes

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
2022-06-15 08:49:54 +08:00
8ba64dd3ad Merge pull request #18947 from zeertzjq/vim-8.2.1897
vim-patch:8.2.{1897,1898,5088}
2022-06-14 21:57:08 +08:00
2a2fb8be74 Merge pull request #18880 from bfredl/arena
perf(memory): use an arena for RPC decoding
2022-06-14 15:20:37 +02:00
0a0cda9528 vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to use
Problem:    Value of cmod_verbose is a bit complicated to use.
Solution:   Use zero for not set, value + 1 when set. (closes vim/vim#10564)
cd7496382e

Omit has_cmdmod(): only used for Vim9 script
2022-06-14 21:12:27 +08:00
6130b4a84b vim-patch:8.2.1898: command modifier parsing always uses global cmdmod
Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
e100440158
2022-06-14 20:58:34 +08:00
dad898b665 refactor(api): remove redundant fields of CmdParseInfo 2022-06-14 20:58:34 +08:00
da41ca299f vim-patch:8.2.1897: command modifiers are saved and set inconsistently
Problem:    Command modifiers are saved and set inconsistently.
Solution:   Separate parsing and applying command modifiers.  Save values in
            cmdmod_T.
5661ed6c83

Cherry-pick: :0verbose fix from patch 8.2.4741
2022-06-14 20:58:34 +08:00
cd9e08cb94 refactor: enable -Wconversion warning for eval.c (#18448)
Work on https://github.com/neovim/neovim/issues/567
2022-06-14 20:57:06 +08:00
3f5c647de9 perf(memory): use an arena for RPC decoding
drawback: tracing memory errors with ASAN is less accurate for arena
allocated memory.
Therefore, to start with it is being used for Object types around
serialization/deserialization exclusively. This is going to have
a large impact especially when TUI is refactored as a co-prosess
as all UI events will be serialized and deserialized by nvim itself.
2022-06-14 14:33:04 +02:00
2f2022773f vim-patch:6ba83ba9ee29 (#18948)
Update runtime files.
6ba83ba9ee
2022-06-14 08:52:04 +02:00
619eb32c75 fix(inccommand): never preview if parsing command failed (#18944)
`errormsg` is not always set when parsing the command failed (e.g. when
the range contains invalid marks). Check the return value is better.
2022-06-14 10:55:04 +08:00
7f8f8d6cb7 feat(lsp): sort codelens if multiple item per line (#18951) 2022-06-13 19:31:48 +02:00
e13c36e312 vim-patch:8.2.0577: not all modifiers supported for :options (#18952)
Problem:    Not all modifiers supported for :options.
Solution:   Use all cmdmod.split flags. (closes vim/vim#4401)
7a1637f4c0

Cherry-pick Test_options_command() change from patch 8.2.0540
2022-06-13 22:04:39 +08:00
837360868b fix(tests): missing clear() #18927
This was caught in #18674 since it allows test isolation
2022-06-13 04:05:17 -07:00
663cbe2620 feat: cmdheight=0 #16251
Fix https://github.com/neovim/neovim/issues/1004

Limitation: All outputs need hit-enter prompt.

Related:
https://github.com/neovim/neovim/pull/6732
https://github.com/neovim/neovim/pull/4382
2022-06-13 02:40:51 -07:00
2f71d4708e Merge pull request #18902 from bfredl/fulexit
fix(tests): check for EOF in requests to nvim properly
2022-06-13 11:23:40 +02:00
a68f5fccb3 Merge pull request #18934 from zeertzjq/vim-8.2.5079
vim-patch:8.2.{5079,5081,5083}
2022-06-13 16:30:13 +08:00
e3281d992e fix(tests): check for EOF on exit of nvim properly 2022-06-13 10:15:44 +02:00
e95f32a717 vim-patch:8.2.5083: autocmd test still fails on MS-Windows
Problem:    Autocmd test still fails on MS-Windows.
Solution:   Change backward to forward slashes.
db77c49401
2022-06-13 16:05:26 +08:00
1c16e5bb11 vim-patch:8.2.5081: autocmd test fails on MS-Windows
Problem:    Autocmd test fails on MS-Windows.
Solution:   Set shellslash to get forward slashes.
7c0d0c3c75
2022-06-13 16:05:19 +08:00
254454d0c5 vim-patch:8.2.5079: DirChanged autocommand may use freed memory
Problem:    DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution:   Free the memory later. (closes vim/vim#10555)
d8c9d32c89

Code change is N/A as Nvim gets the full current directory again before
applying the autocommand, so this just ports the tests.
2022-06-13 16:05:02 +08:00
dd8b6094c0 build(lint): fix lintuncrustify #18945
Problem:
lintuncrustify doesn't actually do anything.

Solution:
- Fix the parameters.
- Fail correctly on nonzero result.

followup to #18940
2022-06-12 18:49:38 -07:00
e420cd6c67 test: dismiss quit_more from Lua #11226
Add a test for what #16537 fixed.
2022-06-12 16:45:44 -07:00
c665773897 Merge pull request #18931 from zeertzjq/regexp-num-escaped
fix(substitute): subtract number of backslashes later
2022-06-13 07:18:38 +08:00
3c7b91da10 build: remove CMAKE_CROSSCOMPILING code #18914
This is rarely, if ever, used and certainly not tested. It's likely this
isn't functional anymore.
2022-06-12 15:11:14 -07:00
f90174c98c build(lint): fix luacheck not found #18940
Problem:
Since 6d57bb89c1 #18543, luacheck is not found on some systems when
running the "lintlua" target.

Solution:
- Move the find_program() to the top-level CMakeLists.txt
- Define a def_cmd_target() function with fewer assumptions than the old
  lint() function.
- Move "lintuncrustify" to src/nvim/CMakeLists.txt so it can reuse the
  $LINT_NVIM_SOURCES already defined there.
- Make the lint targets _fatal_ by default. There is little reason for
  the "lint" umbrella target defined in Makefile to exist if it's going
  to ignore the absence of the actual linters.
- For now, keep the uncrustify call in a separate cmake script so that
  it can be silenced (too noisy).
2022-06-12 15:08:01 -07:00
429c40cce3 fix(buffer): disable buffer-updates before removing from window #18933
There can be other places that access window buffer info (e.g.
`tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't
solve the crash in all cases, and may also cause Nvim's behavior to
diverge from Vim.

Fix #14998
2022-06-12 15:02:00 -07:00
feba56af7d Merge pull request #18936 from bfredl/apioption
refactor(api): reorganize code
2022-06-12 21:01:16 +02:00
2de0d67144 fix(inccommand): skip split window if not enough room #18937
Command preview now behaves like inccommand=nosplit when there's not
enough room for the preview window to be opened instead of aborting,
which is consistent with old behavior of 'inccommand'.
2022-06-12 10:59:04 -07:00
f4967828f9 feat(contrib): asan debugging script #18892
Opted to use a shell script because it's simpler to manipulate
environment variables than in makefiles.
2022-06-12 10:54:14 -07:00
612944c586 refactor(api): update vimdoc 2022-06-12 19:45:39 +02:00
0d63fafcda refactor(api): move command related API to separate file 2022-06-12 19:45:39 +02:00
a907d6f517 refactor(api): move extmark specific functions to api/extmark.c 2022-06-12 16:45:18 +02:00
4a275e3291 refactor(api): move option code to own file 2022-06-12 16:09:42 +02:00
8bc48273eb vim-patch:8.2.5078: substitute test has a one second delay
Problem:    Substitute test has a one second delay.
Solution:   Use ":silent!".  Add another test case. (closes vim/vim#10558)
3269efdf01
2022-06-12 20:42:30 +08:00
41bb81a2df fix(substitute): subtract number of backslashes later 2022-06-12 20:42:30 +08:00
502f03fc06 Merge pull request #18919 from bfredl/multiattr
fix(messages): add color when showing nvim_echo in :messages history
2022-06-11 23:06:05 +02:00
f4121c52b9 fix(messages): add color when showing nvim_echo in :messages history 2022-06-11 22:29:51 +02:00
c87a5ebbc3 Merge pull request #18428 from bfredl/do_source
feat(api): nvim__get_runtime do_source
2022-06-11 11:32:23 +02:00
e92fcdbab2 feat(api): nvim__get_runtime do_source 2022-06-11 10:25:59 +02:00
2b539d6fdf fix(inccommand): clear cmdpreview state if preview is not shown (#18923) 2022-06-11 13:04:19 +08:00
2b252430aa vim-patch:8.2.5076: unnecessary code (#18922)
Problem:    Unnecessary code.
Solution:   Remove code and replace with function call. (closes vim/vim#10552)
2e7cba347f
2022-06-11 07:00:56 +08:00
673b3a780e Merge pull request #18461 from dundargoc/refactor/change-linenr-to-int32
refactor: change type of linenr_T from long to int32_t
2022-06-10 19:28:47 +02:00
a732c253b7 refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the
MAXLNUM constant which sets the maximum allowable number of lines to
2^32-1. This discrepancy may lead to hard to detect bugs, for example
https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a
fix maximum size of 2^32-1 will prevent this type of errors in the
future.

Also change the variables `amount` and `amount_after` to be linenr_T
since they're referring to "the line number difference" between two
texts.
2022-06-10 16:16:41 +02:00
e15d31b530 fix(input): fix macro recording with ALT and special key (#18917) 2022-06-10 17:13:57 +08:00
6eaf10502c vim-patch:partial:63f32603789d (#18916)
Update runtime files
63f3260378

skip translations
skip user manual rewrite
2022-06-10 08:40:32 +02:00
58323b1fe2 feat(filetype): remove side effects from vim.filetype.match (#18894)
Many filetypes from filetype.vim set buffer-local variables, meaning
vim.filetype.match cannot be used without side effects. Instead of
setting these buffer-local variables in the filetype detection functions
themselves, have vim.filetype.match return an optional function value
that, when called, sets these variables. This allows vim.filetype.match
to work without side effects.
2022-06-09 13:12:36 -06:00
28e43881b7 refactor(ops): doxygen docstrings #17743 2022-06-09 08:12:07 -07:00
6d57bb89c1 build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake
Cmake is our source of truth. We should have as much of our build
process there as possible so everyone can make use of it.

* build: remove redundant check for ninja generator
The minimum cmake version as of writing this is 3.10, which has ninja
support.
2022-06-09 08:09:24 -07:00
9662cd7f48 fix(tests): unreliable parser_spec #18911
The "first run" has high variability. Looks like the test failures
correlate with 545dc82c1b
, which makes sense because that improves "first run" performance.

So the `1000*` factor of this test could be adjusted to e.g. `300*` or `500*`.

ref https://github.com/neovim/neovim/pull/16945
2022-06-09 08:07:54 -07:00
bf327368d8 fix: segfault in find_tagfunc_tags #18841
fixes #15221

I tried to reproduce with a test, but failed. The below patch is able to
cause the out of bound access (I verified by adding a check to the
code), but it doesn't seg fault or trigger asan/valgrind errors.

```
diff --git a/src/nvim/testdir/test_tagfunc.vim b/src/nvim/testdir/test_tagfunc.vim
index ffc1d63b9..22828a39f 100644
--- a/src/nvim/testdir/test_tagfunc.vim
+++ b/src/nvim/testdir/test_tagfunc.vim
@@ -117,4 +117,26 @@ func Test_tagfunc_settagstack()
   delfunc Mytagfunc2
 endfunc

+func Test_tagfunc_settagstack_many()
+
+  func Mytagfunc1(pat, flags, info)
+    return [{'name' : 'mytag', 'filename' : 'Xtest', 'cmd' : '1'}]
+  endfunc
+  set tagfunc=Mytagfunc1
+  call writefile([''], 'Xtest')
+
+  for i in range(0,20)
+    let pos = [bufnr()]  + getcurpos()[1:]
+    let newtag = [{'tagname' : 'mytag' + i, 'from' : pos}]
+    call settagstack(1, {'items' : newtag}, 'a')
+    call settagstack(1, {'curidx' : 21})
+  endfor
+
+  tag
+
+  call delete('Xtest')
+  set tagfunc&
+  delfunc Mytagfunc1
+endfunc
```
2022-06-09 08:05:36 -07:00
11e0fea8ba fix: correct nlua_wait error message #18867
the message is wrapped in `if (timeout < 0)`, which means 0 is a valid value
2022-06-09 08:02:32 -07:00
d189bfaeb2 Merge pull request #18908 from zeertzjq/vim-8.2.5066
vim-patch:8.2.{5066,5070}: lcs-leadmultispace
2022-06-09 22:01:32 +08:00
b8742afb6f vim-patch:8.2.5070: unnecessary code
Problem:    Unnecessary code.
Solution:   Remove code that isn't needed. (closes vim/vim#10534)
b5f0801b1f
2022-06-09 21:26:24 +08:00
d6247a575c vim-patch:8.2.5066: lcs-leadmultispace
aca12fd89b
2022-06-09 21:26:23 +08:00
3da3cfc864 feat(autocmds): retrieve lua callback (#18642)
add a new `callback` field to `nvim_get_autocmds`
2022-06-09 07:18:56 -06:00
c5720c7221 Merge pull request #18904 from jamessan/no-parser-ci
ci: run tests with no treesitter parsers installed
2022-06-08 21:55:05 -04:00
a4e1b76f55 test: allow running CI without ts parsers installed 2022-06-08 21:10:49 -04:00
950ab00c2b ci: run tests with no treesitter parsers installed 2022-06-08 21:10:34 -04:00
8a70c53dad Merge pull request #18903 from jamessan/skip-test-parsers
test(ts): skip test if C parser is not available
2022-06-08 21:10:01 -04:00
916d848049 fix(terminal): scrollback delete lines immediately #18832
* on_scrollback_option_changed renamed to adjust_scrollback. The
  function name did not correspond to what it was doing. It is
  called unconditionally in every refresh of the terminal
  unrelated if the scrollback option was changed.
* new on_scrollback_option_changed function, which calls
  refresh_terminal, which then calls adjust_scrollback
* terminal_check_size is not the appropriate function to call when the
  option is changed since it only conditionally adjusts the scrollback.
  Use the new on_scrollback_option_changed

fixes #15477
fixes #11811
2022-06-08 17:46:57 -07:00
10291bb854 Merge pull request #18788 from dundargoc/ci/api-docs/color
ci(api-docs): show required changes with color
2022-06-08 19:55:51 -04:00
6b0595d7cc test(ts): skip test if C parser is not available 2022-06-08 18:04:25 -04:00
94181ad7dc fix(diagnostic): check for negative column value (#18868) 2022-06-08 12:55:39 -06:00
4d9e2247c9 refactor(log): simplify log_path_init #18898
Problem:
Since 22b52dd462 #11501, log_path_init is called in log_init, so it is
now called at a deterministic time. So the "just in time" complexity of
log_path_init is no longer needed.

Solution:
Remove logic intended to try to "heal" partial initialization.
2022-06-08 08:47:34 -07:00
f48aa68e08 Merge pull request #18896 from famiu/fix/nvim_create_user_command/smods
fix(nvim_create_user_command): make `smods` work with `nvim_cmd`
2022-06-08 12:41:59 +02:00
c84bd9e21f fix(nvim_create_user_command): make smods work with nvim_cmd
Closes #18876.
2022-06-08 15:24:52 +06:00
3cd22a3485 fix(eval/f_getmatches): return empty list for invalid win argument (#18893)
Slight inaccuracy in v8.1.1084's port.
Like Vim, it should return [], not 0.
Ref #18890
2022-06-07 16:55:32 +01:00
057a280867 Merge pull request #18870 from zbirenbaum/winhl-cursor
fix(highlight): let winhighlight use cursor
2022-06-07 14:52:35 +02:00
1324e7f79e vim-patch:partial:016188fd8a30 (#18890)
Update runtime files.
016188fd8a

omit changes from doc/builtin.txt (needs 8.2.1536, 8.2.4981)
skip user manual rewrite for Vim9script
2022-06-07 14:41:53 +02:00
df70a3abcd fix(highlight): let winhighlight use cursor 2022-06-07 02:15:32 -04:00
9e442c17ee fix(input): allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885) 2022-06-07 12:41:18 +08:00
ab1f96e1d5 vim-patch:8.2.5064: no test for what 8.1.0052 fixes (#18881)
Problem:    No test for what 8.1.0052 fixes.
Solution:   Add a test. (closes vim/vim#10531)
3760bfddc4
2022-06-07 00:19:57 +08:00
41a49dd9c8 refactor(runtime): port remaining patterns from filetype.vim to filetype.lua (#18814) 2022-06-06 09:25:33 -06:00
cf2738109a docs: documenting struct members inline #18783
Without the proper comments, doxygen doesn't understand the comment
belongs to the struct member:

https://www.doxygen.nl/manual/docblocks.html#memberdoc

[skip ci]
2022-06-06 05:30:48 -07:00
ae02c02f1f vim-patch:8.2.5058: input() does not handle composing characters properly (#18872)
Problem:    input() does not handle composing characters properly.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
            (closes vim/vim#10527)
e3a529bc87

Cherry-pick all of Test_input_func() from patch 8.2.0316.
2022-06-06 05:45:59 +08:00
e4df1c9b9e fix(lsp): fix multi client handling in code action (#18869)
Fixes https://github.com/neovim/neovim/issues/18860
2022-06-05 16:43:32 +02:00
214f866fe5 fix(terminfo): disable smglr for vtpcon and conemu (#18855) 2022-06-05 14:39:56 +02:00
e13dcdf162 Merge pull request #18864 from bfredl/optcut
perf(tests): don't invoke nvim_get_all_options_info until needed
2022-06-05 00:48:43 +02:00
545dc82c1b perf(tests): don't invoke nvim_get_all_options_info until needed
This call alone is responible of 40 000 000 out of 80 000 000
individual alloc/free calls in the test suite.
2022-06-05 00:11:57 +02:00
9ce720a601 docs: specify CMAKE_BUILD_TYPE=RelWithDebInfo in README (#18859)
There have been complaints about the installation instructions being
inconsistent around the build type e.g.
https://github.com/neovim/neovim/issues/18670#issuecomment-1146468741.
Use CMAKE_BUILD_TYPE for both examples in the README.
2022-06-05 03:15:06 +08:00
79a194a278 Merge pull request #18861 from bfredl/norplugin
fix(startup): nvim with --clean should not load user rplugins
2022-06-04 19:25:52 +02:00
aad20de5ab fix(startup): nvim with --clean should not load user rplugins
runtime rplugins such like legacy script providers are not affected
by this change.
2022-06-04 18:37:54 +02:00
df4ffce543 vim-patch:partial:cfa8f9a3f285 (#18858)
Update runtime files
cfa8f9a3f2

skip syntax/vim.vim (needs 8.2.4770)
skip doc/syntax.vim (needs several colorscheme patches)
skip further rewrite of manual
2022-06-04 10:53:42 +02:00
9961a9702e fix(lsp): set buflisted before switching to buffer (#18854) 2022-06-04 10:23:43 +02:00
e6fa4cca24 vim-patch:8.2.5054: no good filetype for conf files similar to dosini (#18851)
Problem:    No good filetype for conf files similar to dosini.
Solution:   Add the confini filetype. (closes vim/vim#10510)
635f48010d
2022-06-04 09:49:01 +02:00
ff20d40321 docs: fix typos (#18269)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dan Sully <dan+github@sully.org>
Co-authored-by: saher <msaher.shair@gmail.com>
Co-authored-by: Stephan Seitz <stephan.seitz@fau.de>
Co-authored-by: Benedikt Müller <d12bb@posteo.de>
Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
2022-06-04 11:56:36 +08:00
86cc33a464 fix(filetype): fix typo in starsetf function (#18856) 2022-06-03 21:52:59 -06:00
c6d747e6a5 feat(lsp): send didChangeConfiguration after init (#18847)
Most LSP servers require the notification to correctly load the
settings and for those who don't it doesn't cause any harm.

So far this is done in lspconfig, but with the addition of vim.lsp.start
it should be part of core.
2022-06-03 18:16:11 +02:00
9aba204335 fix(hl): set Normal hl group sg_attr value #18820
fix #18024
2022-06-03 08:29:49 -07:00
84d8cc3ae5 ci: use python3 explicitly to fix macos warnings #18837
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020

Testing `pynvim` compatibility with python2 should not be done in core,
and there's only a provider_spec for python3 either way.
2022-06-03 08:15:45 -07:00
64e946c50f Merge pull request #18848 from bfredl/backevenagain
fix(log): back even again
2022-06-03 17:02:47 +02:00
8c86feb930 fix(log): back even again 2022-06-03 16:26:50 +02:00
dd0e9910da Merge pull request #18846 from bfredl/unpackfix
fix(api): some robustness issues in api_parse_enter
2022-06-03 15:02:10 +02:00
69774e3179 feat(lsp): add a start function (#18631)
A alternative/subset of https://github.com/neovim/neovim/pull/18506  that should be forward compatible with a potential project system.

Configuration of LSP clients (without lspconfig) now looks like this:

    vim.lsp.start({
       name = 'my-server-name',
       cmd = {'name-of-language-server-executable'},
       root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
    })
2022-06-03 14:59:19 +02:00
61e33f312e Merge pull request #18845 from bfredl/threadlog
fix(logging): make logmsg() thread-safe again
2022-06-03 14:55:56 +02:00
7264444873 fix(api): some robustness issues in api_parse_enter 2022-06-03 12:01:24 +02:00
640c695a7b fix(logging): make logmsg() thread-safe again
problem: data race when `recursive` is read outside of mutex by thread A
while thread B has taken the mutex and modifies it.

solution: use a recursive lock.

ref #18764
2022-06-03 11:08:32 +02:00
9745941ef6 Merge pull request #18730 from bfredl/apiconvert
convert API types using mpack instead of msgpack
2022-06-02 23:01:21 +02:00
26966688aa fix(treesitter): correct region for string parser (#18794)
fixes injections for string parsers after eab4d03a32
2022-06-02 17:35:16 +02:00
d5f047bee0 refactor(api): use a unpacker based on libmpack instead of msgpack-c
Currently this is more or less a straight off reimplementation,
but this allow further optimizations down the line, especially
for avoiding memory allocations of rpc objects.

Current score for "make functionaltest; make oldtest" on a -DEXITFREE build:

is 117 055 352 xfree(ptr != NULL) calls (that's NUMBERWANG!).
2022-06-02 16:05:24 +02:00
d93ba03c71 build(deps): bump Luv to HEAD - 9f8038633 (#18834) 2022-06-02 11:13:42 +02:00
d5651a4183 fix(lua): stop pending highlight.on_yank timer, if any (#18824)
When yanking another range while previous yank is still highlighted, the
pending timer could clear the highlight almost immediately (especially
when using larger `timeout`, i.e. 2000)
2022-06-02 09:49:57 +02:00
285f6518e6 Merge pull request #18831 from dundargoc/ci/disable-perl-macos
ci(provider): skip perl provider tests on macos
2022-06-02 09:46:37 +02:00
79bf507449 ci(provider): skip installing perl provider on macOS
The macOS CI jobs fail to properly install the perl provider, making the
entire thing fail.
2022-06-01 23:05:17 +02:00
57a296d899 fix(inccommand): avoid crash if callback changes inccommand option (#18830)
clang: Result of operation is garbage or undefined
clang: Uninitialized argument value

Also check for == 's' instead of != 'n' as it is more straightforward.

Also fix another unrelated PVS warning:
PVS/V1071: Return value of win_comp_pos() is not always used
2022-06-02 03:48:36 +08:00
209824ce2c fix(lsp): adjust offset encoding in lsp.buf.rename() (#18829)
Fix a bug in lsp.buf.rename() where the range returned by the server in
textDocument/prepareRename was interpreted as a byte range directly,
instead of taking the negotiated offset encoding into account. This
caused the placeholder value in vim.ui.input to be incorrect in some
cases, for example when non-ascii characters are used earlier on the
same line.
2022-06-01 18:56:18 +02:00
19e80738e0 fix(screen): restart win_update() if a decor provider changes signcols (#18768) 2022-06-01 22:53:29 +08:00
9f1ec825cd refactor(clang-tidy): remove nested redundant ifdefs #18811 2022-06-01 07:27:39 -07:00
d837b6d50c fix(checkhealth): skip vim.health #18816
Problem:
https://github.com/neovim/neovim/pull/18720#issuecomment-1142614996

The vim.health module is detected as a healthcheck, which produces spurious errors:

    vim: require("vim.health").check()
    ========================================================================
    - ERROR: Failed to run healthcheck for "vim" plugin. Exception:
      function health#check, line 20
      Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to call field 'check' (a nil value)
      stack traceback:
      [string "luaeval()"]:1: in main chunk

Solution:
Skip vim.health when discovering healthchecks.
2022-06-01 07:10:10 -07:00
96c494dec3 refactor: correct comments and assertions about mapping rhs <Nop> (#18821)
Also avoid referring to mappings as "keymaps" in commands and docs.

						*map_empty_rhs* *map-empty-rhs*
You can create an empty {rhs} by typing nothing after a single CTRL-V (you
have to type CTRL-V two times).  Unfortunately, you cannot do this in a vimrc
file.
2022-06-01 21:37:01 +08:00
f40adf770d fix(inccommand): do not try to preview an ambiguous command (#18827) 2022-06-01 20:17:52 +08:00
c632f64e24 Merge pull request #18583 from gpanders/path-root
feat(fs): add vim.fs module
2022-05-31 14:00:11 -06:00
046b4ed461 feat(fs): add vim.fs.normalize() 2022-05-31 13:30:10 -06:00
f271d70661 feat(fs): add vim.fs.find()
This is a pure Lua implementation of the Vim findfile() and finddir()
functions without the special syntax.
2022-05-31 13:04:41 -06:00
2a62bec37c feat(fs): add vim.fs.dir()
This function is modeled after the path.dir() function from Penlight and
the luafilesystem module.
2022-05-31 13:04:41 -06:00
b740709431 feat(fs): add vim.fs.basename() 2022-05-31 13:04:41 -06:00
c5526a27c3 feat(fs): add vim.fs.dirname() 2022-05-31 13:04:41 -06:00
67cbaf58c4 feat(fs): add vim.fs.parents()
vim.fs.parents() is a Lua iterator that returns the next parent
directory of the given file or directory on each iteration.
2022-05-31 13:04:40 -06:00
e6652821bd refactor(checkhealth)!: rename to vim.health, move logic to Lua #18720
- Complete function:
  There was lots of unnecessary C code for the complete function, therefore
  moving it to Lua and use all the plumbing we have in place to retrieve the
  results.
- Moving the module:
  It's important we keep nvim lua modules name spaced, avoids conflict with
  plugins, luarocks, etc.
2022-05-31 11:10:18 -07:00
7380ebfc17 Merge pull request #18194 from famiu/feat/usercmd_preview
feat: user command "preview" (like inccommand)
2022-05-31 17:44:13 +02:00
46536f53e8 feat: add preview functionality to user commands
Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
2022-05-31 20:55:05 +06:00
5d840fa7e6 Merge pull request #18219 from kessejones/filetype-lua
feat(filetype): add more filetype patterns to Lua
2022-05-31 07:58:51 -06:00
0c95028688 vim-patch:8.2.5046: vim_regsub() can overwrite the destination (#18812)
Problem:    vim_regsub() can overwrite the destination.
Solution:   Pass the destination length, give an error when it doesn't fit.
4aaf3e7f4d
2022-05-31 19:55:04 +08:00
1a20aed3fb fix(lsp): include cancellable in progress message table (#18809)
Currently the `title`, `message` and `percentage` is stored for a
progress, but there is also an optional `cancellable` that comes in with
both the `WorkDoneProgressBegin` and also `WorkDoneProgressReport`. This
change also stores that value so that a plugin can access it when they
do a lookup in `client.messages`.
2022-05-31 13:19:45 +02:00
bfc85eab12 build(deps): bump Luv to HEAD - 02d703b42 (#18808) 2022-05-31 10:58:30 +02:00
b7d70de345 docs(dev-style): remove rules covered by uncrustify #18767
Uncrustify is the source of truth where possible.
See also https://github.com/neovim/neovim/pull/18563
2022-05-30 17:48:25 -07:00
b66e9e0baa feat(filetype): convert more patterns to filetype.lua 2022-05-30 20:32:35 -03:00
d092e377c4 test(oldtest): disable legacy detect for filetype.lua 2022-05-30 20:32:35 -03:00
d404d68c92 docs: clarify that nvim_strwidth counts control characters as one cell (#18802) 2022-05-31 07:06:34 +08:00
b5dd562e08 fix(docs): correct obsolete note about 'writedelay' in dev docs 2022-05-31 00:20:10 +02:00
f6e19e7334 fix(logging): skip recursion, fix crash #18764
Problem:
1. The main log routine does not protect itself against recursion.
   log_lock() doesn't guard against recursion, it would deadlock...
2. 22b52dd462 (#11501) regressed 6f27f5ef91 (#10172), because
   set_init_1..process_spawn tries to log (see backtrace below), but the
   mutex isn't initialized yet. Even if the mutex were valid, we don't
   want early logging to fallback to stderr because that can break
   embedders when stdio is used for RPC.

    frame 1: 0x00000001001d54f4 nvim`open_log_file at log.c:205:7
    frame 2: 0x00000001001d5390 nvim`logmsg(log_level=1, context="UI: ", func_name=0x0000000000000000, line_num=-1, eol=true, fmt="win_viewport") at log.c:150:20
    frame : 0x000000010039aea2 nvim`ui_call_win_viewport(grid=2, win=1000, topline=0, botline=1, curline=0, curcol=0, line_count=1) at ui_events_call.generated.h:321:3
    frame 4: 0x00000001003dfefc nvim`ui_ext_win_viewport(wp=0x0000000101816400) at window.c:939:5
    frame 5: 0x00000001003ec5b4 nvim`win_ui_flush at window.c:7303:7
    frame 6: 0x00000001003a04c0 nvim`ui_flush at ui.c:508:3
    frame 7: 0x00000001002966ba nvim`do_os_system(argv=0x0000600000c0c000, input=0x0000000000000000, len=0, output=0x0000000000000000, nread=0x00007ff7bfefe830, silent=false, forward_output=false) at shell.c:894:3
    frame 8: 0x0000000100295f68 nvim`os_call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_args=0x0000000000000000) at shell.c:663:18
    frame 9: 0x0000000100295845 nvim`call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_shell_arg=0x0000000000000000) at shell.c:712:14
    frame 10: 0x0000000100294c6f nvim`os_expand_wildcards(num_pat=1, pat=0x00007ff7bfefeb20, num_file=0x00007ff7bfefee58, file=0x00007ff7bfefee60, flags=43) at shell.c:328:7
    ...
    frame 23: 0x000000010028ccef nvim`expand_env_esc(srcp=",~foo", dst="~foo", dstlen=4094, esc=false, one=false, prefix=0x0000000000000000) at env.c:673:17
    frame 24: 0x000000010026fdd5 nvim`option_expand(opt_idx=29, val=",~foo") at option.c:1950:3
    frame 25: 0x000000010026f129 nvim`set_init_1(clean_arg=false) at option.c:558:19
    frame 26: 0x00000001001ea25e nvim`early_init(paramp=0x00007ff7bfeff5f0) at main.c:198:3
    frame 27: 0x00000001001ea6bf nvim`main(argc=1, argv=0x00007ff7bfeff848) at main.c:255:3

Solution:
1. Check for recursion, show "internal error" message.
    - FUTURE: when "remote TUI" is merged, can we remove log_lock()?
2. Skip logging if log_init wasn't called yet.
2022-05-30 13:07:33 -07:00
8427da9299 Merge pull request #18798 from bfredl/doublehash
refactor(api): use hashy hash for looking up api method and event names
2022-05-30 20:09:51 +02:00
e86901eb68 docs(clang-format): one space in directives indent (#18800)
PPIndentWidth
The number of columns to use for indentation of preprocessor statements.
When set to -1 (default) IndentWidth is used also for preprocessor statements.
2022-05-30 23:49:11 +08:00
1f63052b68 refactor(api): use hashy hash for looking up api method and event names
This avoids generating khash tables at runtime, and is consistent with
how evalfuncs lookup work.
2022-05-30 14:11:01 +02:00
e9803e1de6 Merge pull request #18789 from dundargoc/ci/api-docs/run-in-drafts
ci(api-docs): run in drafts as well
2022-05-29 09:51:18 -04:00
ebad151a2a Merge pull request #18792 from famiu/feat/nvim_create_user_command/smods
feat(api): pass structured modifiers to commands
2022-05-29 15:23:51 +02:00
d4bb15af52 test: add tests for inccommand with c_CTRL-R_= and c_CTRL-\_e (#18796) 2022-05-29 20:52:53 +08:00
015656abd7 fix(winbar): set w_winrow_off when initializing firstwin size (#18793) 2022-05-29 16:26:55 +08:00
6d30efddb7 test(job_spec): remove Xtest_jobstart_env log file 2022-05-29 15:40:59 +08:00
9988d2f214 feat(nvim_create_user_command): pass structured modifiers to commands
Adds an `smods` key to `nvim_create_user_command` Lua command callbacks,
which has command modifiers but in a structured format. This removes the
need to manually parse command modifiers. It also reduces friction in
using `nvim_cmd` inside a Lua command callback.
2022-05-29 10:52:30 +06:00
f31a10204c ci(uncrustify): show diff on failure #18780
This will make it possible to see what needs to be fixed without having
uncrustify installed locally.
2022-05-28 17:00:25 -07:00
772ae3e656 vim-patch:8.2.5037: cursor position may be invalid after "0;" range (#18782)
Problem:    Cursor position may be invalid after "0;" range.
Solution:   Check the cursor position when it was set by ";" in the range.
4d97a565ae
2022-05-29 07:00:18 +08:00
39613b6a2d ci(api-docs): run in drafts as well
A contributor should be able to be sure their PR passes the CI before
clicking "Ready for review".
2022-05-29 00:55:12 +02:00
d353d5f002 ci(api-docs): show required changes with color
It makes it easier to see what needs to be changed.
2022-05-28 21:42:40 +02:00
840b7576e9 Merge pull request #18786 from jamessan/latest-ci
ci: use ubuntu-latest for vim-patches and coverity-scan
2022-05-28 14:43:47 -04:00
a3df012845 ci: use ubuntu-latest for vim-patches and coverity-scan
Since we're not running tests or other things that are more sensitive to
changes in the VM environment, use ubuntu-latest to avoid the busy work
of updating the VM image.
2022-05-28 14:22:42 -04:00
f914b4e7a8 test: fixeol cleanup created files #18785
The async nature of feed_command caused a race condition on the calls
to delete, leaving the files on the root of the repo. Just use os.remove
and no need to wipeout.
2022-05-28 10:34:18 -07:00
c43e2874c0 fix(vim-patch.sh)
In scripts/vim-patch.sh line 335:
      printf '
             ^-- SC2183 (warning): This format string has 4 variables, but is passed 3 arguments.

    In scripts/vim-patch.sh line 597:
      list_missing_vimpatches 1 "$@" | while read -r vim_commit; do
                                                     ^--------^ SC2030 (info): Modification of vim_commit is local (to subshell caused by pipeline)

    In scripts/vim-patch.sh line 626:
      done < <(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id --name-only -r "${vim_commit}" -- . ':!src/version.c')
                                                                                   ^-----------^ SC2031 (info): vim_commit was modified in a subshell. That change might be lost.

    For more information:
      https://www.shellcheck.net/wiki/SC2183 -- This format string has 4 variable...
      https://www.shellcheck.net/wiki/SC2030 -- Modification of vim_commit is loc...
      https://www.shellcheck.net/wiki/SC2031 -- vim_commit was modified in a subs...
2022-05-28 10:30:03 -07:00
eab4d03a32 fix(treesitter): offset directive associates range with capture (#18276)
Previously the `offset!` directive populated the metadata in such a way
that the new range could be attributed to a specific capture. #14046
made it so the directive simply stored just the new range in the
metadata and information about what capture the range is based from is
lost.

This change reverts that whilst also correcting the docs.
2022-05-28 19:22:18 +02:00
081eb72a80 refactor(regexp_nfa.c): match where Vim calls fopen() (#18778) 2022-05-28 19:26:19 +08:00
0dd3798dbb Merge pull request #18776 from famiu/fix/winbar_noroom
fix(winbar): only allow adding winbar when there is space
2022-05-28 12:18:04 +02:00
9cf1ac0377 fix(winbar): only allow adding winbar when there is space 2022-05-28 15:29:56 +06:00
1b235fe6ca docs(options): move all removed options to vim_diff.txt (#18770)
It's more consistent to gather all removed options in one spot rather
than spreading it out.
2022-05-28 16:42:56 +08:00
77d9c672f8 fix(winbar): fix winbar disappear or glitch when moving a split (#18775) 2022-05-28 15:12:42 +08:00
285e738942 test(unit): use setup()/teardown() in buffer_spec.lua (#18739) 2022-05-28 10:14:12 +08:00
826462a8f0 fix(ui): require window-local value to show winbar on floating windows (#18773)
Previously, there was a bug where setting the local value of 'winbar' to
itself would cause winbar to appear on a floating window, which is
undesirable. This fix makes it so that it's explicitly required for the
window-local value of 'winbar' for a floating window to be set in order
for winbar to be shown on that window.
2022-05-28 06:57:20 +08:00
e2940d3c79 vim-patch:8.2.5024: using freed memory with "]d" (#18762)
Problem:    Using freed memory with "]d".
Solution:   Copy the pattern before searching.
e2fa213cf5
2022-05-27 05:59:05 +08:00
30915cc8b0 Merge pull request #18306 from lewis6991/fnfast
feat(lua): allow some viml functions to run in fast
2022-05-26 15:03:07 +02:00
497046466e Merge pull request #17742 from dundargoc/doxygen/normal
refactor(normal): convert function comments to doxygen format
2022-05-26 18:55:56 +08:00
e8ada41b63 feat(lsp): turn rename filter into a predicate (#18745)
Same as https://github.com/neovim/neovim/pull/18458 but for rename
2022-05-26 12:28:50 +02:00
ec1bd06e10 refactor(normal): convert function comments to doxygen format 2022-05-26 10:16:41 +02:00
7b952793d5 refactor: missing parenthesis may cause unexpected problems (#17443)
related vim-8.2.{4402,4639}
2022-05-26 10:49:25 +08:00
f246a929e7 Merge pull request #18738 from zeertzjq/vim-8.2.5010
vim-patch:8.2.5010: the terminal debugger uses various global variables
2022-05-26 08:08:35 +08:00
068fb748e1 vim-patch:8.2.5015: Hoon and Moonscript files are not recognized (#18747)
Problem:    Hoon and Moonscript files are not recognized.
Solution:   Add filetype patterns. (Goc Dundar, closes vim/vim#10478)
bf82df0dd4
2022-05-25 18:07:58 -06:00
ec48c6f236 vim-patch:8.2.5010: the terminal debugger uses various global variables
Problem:    The terminal debugger uses various global variables.
Solution:   Add a dictionary to hold the terminal debugger preferences.
c9a431c763

Omit popup menu.
2022-05-26 07:47:00 +08:00
eb623a1c45 docs: add missing termdebug docs from Vim runtime updates
388a5d4f20
4466ad6baa
6aa57295cf

Rename terminal.txt to nvim_terminal_emulator.txt in vim-patch.sh.
2022-05-26 07:47:00 +08:00
6db3f3f624 Merge pull request #18748 from dundargoc/ci/msvc
ci(mingw): only enable -municode for MinGW
2022-05-25 19:43:34 -04:00
cbf57fa353 vim-patch:8.2.5016: access before start of text with a put command (#18742)
Problem:    Access before start of text with a put command.
Solution:   Check the length is more than zero.
2a585c8501
2022-05-26 07:20:39 +08:00
e21899ac4f ci(mingw): only enable -municode for MinGW
When enabling -municode for MSVC the following warning shows up:
"LINK : warning LNK4044: unrecognized option '/municode'; ignored".
This will ensure cleaner logs for the MSVC job.
2022-05-25 22:23:27 +02:00
9fec6dc9a2 refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695) 2022-05-25 12:31:14 -06:00
8c4e62351f refactor(lsp): remove redundant client cleanup (#18744)
The client state is cleaned up both in client.stop() as well as in the
client.on_exit() handler. Technically, the client has not actually
stopped until the on_exit handler is called, so we should just do this
cleanup there and remove it from client.stop().
2022-05-25 11:45:45 -06:00
fa3492c5f7 feat(lsp)!: turn format filter into predicate (#18458)
This makes the common use case easier.
If one really needs access to all clients, they can create a filter
function which manually calls `get_active_clients`.
2022-05-25 19:38:01 +02:00
c6d6b8c7eb fix(lsp): respect global syntax setting in open float preview (#15225) 2022-05-25 18:47:49 +02:00
24352cba01 Merge pull request #18528 from lewis6991/setwinopt
feat(api): add `win` and `buf` to `nvim_set_option_value`
2022-05-25 17:05:28 +02:00
802a23926d build: require exact Lua version when using PREFER_LUA (#16633) 2022-05-25 08:11:53 -06:00
af2899aee0 vim-patch:8.2.5012: cannot select one character inside () (#18731)
Problem:    Cannot select one character inside ().
Solution:   Do not try to extend the area if it is empty. (closes vim/vim#10472,
            closes vim/vim#6616)
53737b5eee
2022-05-25 07:16:12 +08:00
2f974736ac fix(coverity): bail out if mouse_find_win() returns NULL (#18726) 2022-05-25 07:14:50 +08:00
e5490b38b7 docs(api): floating wins omitted under :mksession (#18721) 2022-05-24 11:32:01 -06:00
eebd682221 Merge pull request #18728 from dundargoc/ci/api/upgrade-to-ubuntu-22
ci(api-docs): upgrade to ubuntu 22 and remove conda dependency
2022-05-24 07:20:40 -04:00
d7e45ee4b9 Merge pull request #18626 from dundargoc/ci/shallow-clone
ci(api-docs): add comment explaining why full clone is needed
2022-05-24 07:20:04 -04:00
4fab52908b Merge pull request #18607 from dundargoc/build/mingw
restore mingw in cmake
2022-05-24 07:19:12 -04:00
db059ed1f1 ci(api-docs): add comment explaining why full clone is required 2022-05-24 12:29:58 +02:00
e9f8a478fc ci(api-docs): upgrade to ubuntu 22 and remove conda dependency
Ubuntu 22 has doxygen version 1.9.1 available in apt, which means we
don't need to use conda anymore. This will somewhat simplify the
workflow.
2022-05-24 12:21:17 +02:00
307c5c63e1 vim-patch:8.2.4999: filetype test table is not properly sorted (#18719)
Problem:    Filetype test table is not properly sorted.
Solution:   Sort by filetype. (Doug Kearns)
aa9729b652
2022-05-24 09:29:40 +08:00
5eaf9ef811 fix(filetype): correct vim.fn.did_filetype() handling (#18725) 2022-05-23 18:55:03 -06:00
a20892c4bc vim-patch:partial 2d8ed0203aed (#18675)
* vim-patch:partial 2d8ed0203aed

Update runtime files.
2d8ed0203a

Skip:

runtime/doc/map.txt
runtime/doc/syntax.txt
runtime/doc/usr_51.txt
runtime/doc/usr_52.txt
runtime/syntax/help.vim
runtime/syntax/vim.vim

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2022-05-23 23:49:38 +02:00
37ee800b51 vim-patch:8.2.5009: fold may not be closeable after appending (#18722)
Problem:    Fold may not be closeable after appending.
Solution:   Set the fd_small flag to MAYBE. (Brandon Simmons, closes vim/vim#10471)
e8c4a64bff
2022-05-23 20:13:22 +01:00
c2f4920d3b Merge pull request #18712 from famiu/feat/ui/winbar_redraw
fix(ui): redraw winbar alongside statusline
2022-05-23 16:32:35 +02:00
353553f913 fix(ui): redraw winbar alongside statusline
Remove `w_redr_winbar` and use `w_redr_status` to redraw the winbar to
ensure that winbar redraw is triggered alongside the statusline redraw.
2022-05-23 19:35:46 +06:00
4b4643be07 vim-patch:8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment (#18717)
Problem:    When 'formatoptions' contains "/" wrongly wrapping a long trailing
            comment.
Solution:   Pass the OPENLINE_FORMAT flag.
7e66778815
2022-05-23 21:27:57 +08:00
4c6626f03d feat: click support for 'statusline', 'winbar' #18650
The mouseclick item "%@" is now supported by 'statusline' and 'winbar'.
Previously it was only supported by 'tabline'.
2022-05-23 06:11:24 -07:00
9e1ee9fb1d refactor!: delete insertmode (#18547)
Neovim already removed `evim` (or any similar flags). The 'insertmode'
option is a weird remnant, so get rid of it.

The 'insertmode' option is replaced with a script that closely emulates
the option. This script is documented at :help 'insertmode'
2022-05-22 21:20:18 -06:00
a7e0a02031 Merge pull request #18691 from zeertzjq/vim-8.2.4996
vim-patch:8.2.{4996.5002}: setbufline(), deletebufline() may change Visual selection
2022-05-23 07:27:26 +08:00
39fb97b2a5 vim-patch:8.2.5001: checking translations affects the search pattern history (#18709)
Problem:    Checking translations affects the search pattern history.
Solution:   Use "keeppatterns". (Doug Kearns)
8a3704723c
2022-05-23 07:24:44 +08:00
bcfc97e8d8 vim-patch:8.2.5002: deletebufline() may change Visual selection
Problem:    deletebufline() may change Visual selection.
Solution:   Disable Visual mode when using another buffer. (closes vim/vim#10469)
9b2edfd3bf
2022-05-23 06:57:30 +08:00
eae4eddc54 vim-patch:8.2.4996: setbufline() may change Visual selection
Problem:    setbufline() may change Visual selection. (Qiming Zhao)
Solution:   Disable Visual mode when using another buffer. (closes vim/vim#10466)
0ad00a7fd3
2022-05-23 06:54:12 +08:00
378615b8ee fix(lsp): do not detach LSP servers on Windows #18703
Detaching the process seems to have unintended side effects on Windows,
so only do it by default on non-Windows platforms.

Ref: https://github.com/neovim/nvim-lspconfig/issues/1907
Closes https://github.com/neovim/nvim-lspconfig/pull/1913
2022-05-22 12:21:44 -07:00
52623ce935 refactor(runtime): convert the remaining dist#ft functions to lua (#18623) 2022-05-22 12:16:04 -06:00
8c2fd65bb1 build(clint): remove redundant checks #18698
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-22 10:59:56 -07:00
5250d5c1b1 Merge pull request #18646 from bfredl/winbarruler
fix(winbar): allow winbar to display a ruler
2022-05-22 19:43:30 +02:00
47d9a393de fix(cid/352839): USE_AFTER_FREE in create_user_command #18669 2022-05-22 10:29:15 -07:00
7f6d2984a8 Merge pull request #18608 from ckipp01/extmarkDocs
docs(extmark): remove message about passing in id=0
2022-05-22 19:07:51 +02:00
060ef52d8b fix(winbar): allow winbar to display the ruler 2022-05-22 18:56:07 +02:00
3fe6bf3a1e fix(mksession): don't store floats in session #18635
Problem:
If there are floating windows when `:mksession` runs, the session cannot
be properly restored.

Solution:
Change `:mksession` to skip floating windows. This matches Vim's
treatment of popup windows.

An alternative approach could have `:mksession` save floating windows
that can be _properly_ restored (rather than skip them entirely, which
is what this PR does). While that would seemingly be a more complete
fix, that could present additional issues since floating windows are
ordinarily created by plugins, and they may no longer be properly under
a plugin's control when restored.

closes #18432
2022-05-22 09:03:56 -07:00
b863c150c9 Merge pull request #18696 from bfredl/quickinc
fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
2022-05-22 17:51:31 +02:00
63741176ce ci(commitlint): only trigger on PRs to master #18679
This will prevent a failure for backported PRs as they use a different
commit message.
2022-05-22 08:03:06 -07:00
9b34723bcc Merge pull request #18693 from bfredl/quicklsp
fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
2022-05-22 16:25:17 +02:00
e01c197eab fix(tests): fix some issues with ui/inccommand_spec.lua causing slowness
from ~30 to ~20 secs with ASAN build

- feedkeys test: the same substitute was repeated, and not even correctly spelled
- don't clear() in a tight loop. "bwipe!" is enough to erase undo history
- error in cnoremap mapping causes a check_for_delay(). <c-c> it away.
2022-05-22 16:17:37 +02:00
566ee48f05 vim-patch:8.2.4935: with 'foldmethod' "indent" some lines not included in fold (#18694)
Problem:    With 'foldmethod' "indent" some lines are not included in the
            fold. (Oleg Koshovetc)
Solution:   Fix it. (Brandon Simmons, closes vim/vim#10399, closes vim/vim#3214)
d98e75e236
2022-05-22 21:37:25 +08:00
70e3caec4a fix(folds): fix fold regression with :move (#18685) 2022-05-22 21:03:22 +08:00
e7b3fd8ad6 Merge pull request #18681 from bfredl/uitest
fix(tests): fix some screen.lua warnings
2022-05-22 14:32:38 +02:00
58b9b7e7c4 fix(ci): remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
Cuts down typical run time for `plugin/lsp_spec.lua`
from 70 secs to 12 secs in ASAN CI build.

This happens in ASAN/EXIT_FREE builds where nvim waits 2000ms due to
unclosed handled. I wasn't able to pin-point the exact cause.
But these tests ran in nested context where two server/client pairs
were setup for no good reason. Moving these tests out so only one client
is being setup fixed the exit hang.
2022-05-22 14:14:58 +02:00
2cab6bea09 docs: remove "Vi default" #18672
It's not relevant and clutters the documentation.
2022-05-22 04:38:59 -07:00
5193b17839 vim-patch:8.2.4993: smart/C/lisp indenting is optional (#18684)
Problem:    smart/C/lisp indenting is optional, which makes the code more
            complex, while it only reduces the executable size a bit.
Solution:   Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
8e145b8246
2022-05-22 07:52:11 +08:00
0c4086faa1 vim-patch:8.2.4987: after deletion a small fold may be closable (#18683)
Problem:    After deletion a small fold may be closable.
Solution:   Check for a reverse range. (Brandon Simmons, closes vim/vim#10457)
3fcccf94e8
2022-05-22 07:27:54 +08:00
f0717ffade Merge pull request #18682 from zeertzjq/vim-8.1.0535
vim-patch:8.1.0535,8.2.4991: increment/decrement might get interrupted by updating folds
2022-05-22 07:27:26 +08:00
c3568b31f4 vim-patch:8.2.4991: no test for hwat patch 8.1.0535 fixes
Problem:    No test for hwat patch 8.1.0535 fixes.
Solution:   Add a test. (closes vim/vim#10462)
93c1573dd2
2022-05-22 06:41:31 +08:00
a1df7c5771 vim-patch:8.1.0535: increment/decrement might get interrupted by updating folds
Problem:    Increment/decrement might get interrupted by updating folds.
Solution:   Disable fold updating for a moment. (Christian Brabandt,
            closes vim/vim#3599)
6b731886ca
2022-05-22 06:41:31 +08:00
cbf0360179 Merge pull request #13729 from devbhansingh/ui_enter_prompt
feat(ui): clear message history explicitly with msg_history_clear event
2022-05-21 23:59:14 +02:00
646e1c3a3a feat(ui): clear message history explicitly with msg_history_clear event 2022-05-21 23:22:23 +02:00
3c1bc75447 fix(tests): fix some screen.lua warnings 2022-05-21 23:07:34 +02:00
1f1a65a9e4 ci: fix lint errors caused by missing includes (#18673)
This will fix the `check-single-includes` check which started failing
after https://github.com/neovim/neovim/pull/18663/.
2022-05-21 17:27:54 +02:00
55246d44f9 fix(autocmds): separate command from desc (#18617) 2022-05-21 15:55:48 +02:00
976f32aa7a refactor: add warnings for deprecated functions (#18662) 2022-05-21 09:51:03 +02:00
12f45fd697 ci: bump github actions versions #18616 2022-05-20 20:45:10 -07:00
79469e61d5 build(clint.py): remove rules for includes, whitespace, tabs #18611
Uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563

Closes https://github.com/neovim/neovim/issues/17763
2022-05-20 20:43:30 -07:00
045aacc384 ci: lint with uncrustify #18563
This lint job will ensure that the C codebase is properly formatted at
all times. This helps eliminate most of clint.py.

To save CI time, it's faster to manually compile uncrustify and cache
the binary instead of using homebrew (the apt-get package is too old).
2022-05-20 20:41:57 -07:00
4c97e17d38 refactor: remove unused USE_WCHAR_FUNCTIONS #18618
USE_WCHAR_FUNCTIONS is never defined and we don't trust libc wchar
functions anyway.
2022-05-20 20:31:32 -07:00
afa99f42b3 fix(unittests): coredump when running unit tests #18663
fs_init() must be called before early_init() in init/helpers.lua

If I run 'make unittest' on my Mac (macOS 10.14/Mojave or 12/Big Sur, intel
CPU), every test produce a core dump.

Call sequence in the core is:
    early_init()            main.c:197
    set_init_1()            option.c:508
    runtimepath_default()   runtime.c:1205
    get_lib_dir()           runtime.c:1175
    os_isdir()              fs.c:137
    os_getperm()            fs.c:777
    os_stat()               fs.c:761
    fs_loop_lock()          fs.c:72
    uv_mutex_lock(&fs_loop_mutex)   thread.c:352
    abort()

.deps/build/src/libuv/src/unix/thread.c:

    void uv_mutex_lock(uv_mutex_t* mutex) {
      if (pthread_mutex_lock(mutex))
        abort();	// line 352
    }

So pthread_mutex_lock(&fs_loop_mutex) failed. The reason seems to be simple.
fs_init() was not called and fs_loop_mutex has not been initialized. fs_init()
was moved out from early_init() in main.c by
b87867e69e, but unit/helpers.lua was not updated
accordingly.
2022-05-20 20:18:17 -07:00
b3453ea4a6 Merge pull request #18648 from jamessan/coverity-fixes 2022-05-20 14:22:15 -04:00
c847a0eeb7 Merge pull request #18664 from famiu/fix/winbar_crash
fix: prevent crash when statusline expression sets value of 'winbar'
2022-05-20 19:29:34 +02:00
cda0ef23cf build(deps): bump LuaJIT to HEAD - 4ef96cff8 (#18656) 2022-05-20 19:19:37 +02:00
e884e460bc fix: prevent crash when statusline expression sets value of 'winbar'
Closes #18649
2022-05-20 23:03:06 +06:00
ffb55261a8 Merge pull request #18653 from dundargoc/refactor/move-reverse-text
refactor: move reverse_text to strings.c as it's a string operation
2022-05-20 17:00:51 +02:00
76691bea04 Merge pull request #18657 from dundargoc/vim-8.2.4985
vim-patch:8.2.4985: PVS warns for possible array underrun
2022-05-20 22:23:20 +08:00
1a0de90068 refactor: move reverse_text to strings.c as it's a string operation
Also add tests for reverse_text.

Co-authored-by: Kalle Ranki <kalle.ranki@gmail.com>
2022-05-20 16:11:54 +02:00
02fd4ec83f vim-patch:8.2.4985: PVS warns for possible array underrun
Problem:    PVS warns for possible array underrun.
Solution:   Add a check for a positive value. (closes vim/vim#10451)
875339b22a
2022-05-20 15:15:13 +02:00
1d160a76ec Merge pull request #18641 from famiu/fix/nvim_cmd/keymap_error_suppress
fix: make `nvim_cmd` not suppress errors inside key mapping
2022-05-20 14:22:44 +02:00
3e627f9e55 ci(coverity): run every day instead of once/week
Neovim currently falls in the 100 kLOC - 500 kLOC bucket, which can scan
3x/day.
2022-05-20 08:17:47 -04:00
83f42e086a perf(cid/350479): avoid copying ExtmarkInfo when calling extmark_to_array() 2022-05-20 08:17:39 -04:00
501ee06d3a fix(cid/352782): assert str->items is non-NULL to hint static analyzers
The earlier vsnprintf() call checks whether str->items is NULL, sets of
the "possible NULL" spidey sense.  kv_ensure_space() guarantees
str->items is non-NULL but since it doesn't use NULL checks to decide
whether to alloc, static analyzers can't tell this code path is safe.
2022-05-20 08:17:33 -04:00
d31e68d5d0 fix(cid/348314): free user_copy, not user
user is passed in by the caller, which we internally copy.  We should be
freeing our copy, not the caller's string.
2022-05-20 08:15:13 -04:00
f15122e8a2 fix(cid/351940): free compl_arg in create_user_commands()'s error path exit 2022-05-20 08:15:07 -04:00
6954c0ba0d ci(coverity): annotate register_cfunc as leaking memory
register_cfunc allocates a ufunc_T, but doesn't store the pointer
anywhere before returning.  The uf_name member variable is stored in a
hashtable and used to lookup the ufunc_T later, but that's too much for
Coverity to track.

Adding the annotation ensures that any new callers to register_cfunc
don't pop up as new "leaks" in the Coverity scans.
2022-05-20 08:14:37 -04:00
1da7e2b8ca ci(coverity): model our allocation functions
Coverity was reporting false positives, particularly around for non-NUL
terminated strings around uses of xmemdupz().  The updated model
ensures Coverity understands xmemdupz allocates an extra byte and sets it
to NUL as well as the main details of our other allocation related
wrappers.
2022-05-20 08:14:20 -04:00
a4862cbb5f fix(lsp): only send diagnostics from current buffer in code_action() (#18639)
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
2022-05-20 13:11:23 +02:00
eb0aa8bb0e vim-patch:8.2.4980: when 'shortmess' contains 'A' loading session may still warn (#18636)
Problem:    When 'shortmess' contains 'A' loading a session may still warn for
            an existing swap file. (Melker Österberg)
Solution:   Keep the 'A' flag to 'shortmess' in the session file.
            (closes vim/vim#10443)
aaadb5b6f7

Use readfile() with "B" flag in test as readblob() needs patch 8.2.2343.
2022-05-20 07:20:38 +08:00
69853a622a Merge pull request #18629 from famiu/fix/ui/winbar
fix(ui): make `winbar` properly equalize window heights for local value
2022-05-19 21:58:48 +02:00
bb8d05f932 Merge pull request #18638 from zeertzjq/fix-winbar-mouse
Fix mouse drag position with winbar
2022-05-20 03:34:34 +08:00
fb8fa004d8 fix: make nvim_cmd not suppress errors inside key mapping
Closes #18632
2022-05-19 22:23:14 +06:00
643cc94e7e fix(ui): make winbar properly equalize window heights for local value
Fixes `'winbar'` not properly equalizing window heights for splits when
the global value is empty and a window-local value is set instead.
2022-05-19 19:14:54 +06:00
f971536f46 fix(mouse): fix mouse drag position with winbar or border in multigrid 2022-05-19 19:16:49 +08:00
0997884ae2 fix(mouse): fix mouse drag position with winbar 2022-05-19 19:16:31 +08:00
d200ba654a Merge pull request #18502 from drybalka/fix-languagetree-contains-description
treesitter: small improvements of languagetree.lua
2022-05-19 09:17:10 +02:00
95580f31b3 test(mksession_spec): only sleep on Windows (#18637) 2022-05-19 10:42:05 +08:00
341d0ec3b3 vim-patch:8.2.4979: accessing freed memory when line is flushed (#18634)
Problem:    Accessing freed memory when line is flushed.
Solution:   Make a copy of the pattern to search for.
28d032cc68
2022-05-19 09:56:44 +08:00
6a2883c171 Merge pull request #18630 from dundargoc/refactor/remove-remap 2022-05-18 17:37:15 -06:00
18fbdaeeab fix(termopen): avoid ambiguity in URI when CWD is root dir (#16988) 2022-05-19 06:47:33 +08:00
97fc68850f refactor!: remove 'terse' option
Having two methods of setting the same option is redundant and can be
potentially confusing. Recommend adding 's' to 'shortmess' instead.
2022-05-19 00:15:40 +02:00
11957f51cc refactor!: remove 'remap' option
An option that should always be kept on except for when working with old
Vi scripts is of little use to us.
2022-05-19 00:15:36 +02:00
86db222469 docs(extmark): remove message about passing in id=0
The docs for `nvim_buf_set_extmark` mention that you can create a new
extmark when passing in `id=0`, however if you do this you'll get an
error since the code checks that id is positive.

```
id is not a positive integer
```

This change re-words the sentence to make it clearer.
2022-05-18 21:49:31 +02:00
6f0baa0bb7 Merge pull request #18620 from bfredl/multibar
fix(ui): make winbar work with floats and multigrid
2022-05-18 21:18:34 +02:00
3eea66d65a feat(lsp): option to reuse_win for jump actions (#18577) 2022-05-18 21:03:24 +02:00
503d8b0892 refactor(events): remove unnecessary fudging of updating_screen
This was not necessary after the introduction of `resize_events`,
after which ui resizes are not `fast_events` anymore.
2022-05-18 20:16:19 +02:00
17758fe7ad fix(ui): make winbar work with floats and multigrid 2022-05-18 20:16:18 +02:00
c28192e6f9 refactor: move more grid functions to grid.c. Clean up some variables 2022-05-18 20:16:18 +02:00
03a8269e3a Merge pull request #18507 from gpanders/au-lsp-attached 2022-05-18 11:59:03 -06:00
b840b5b6a9 Merge pull request #18624 from famiu/feat/ui/winbar
fix(ui): set correct position on mouse click when 'winbar' is enabled
2022-05-18 19:55:01 +02:00
fec944142b refactor: simple logic in tree_contains() 2022-05-18 19:28:49 +02:00
f66a60805d docs: correct description of LanguageTree:contains() 2022-05-18 19:28:41 +02:00
ed93186ee2 feat(lsp): add filter to vim.lsp.get_active_clients()
Allow get_active_clients() to filter on client name, id, or buffer. This
(soft) deprecates lsp.buf_get_clients().
2022-05-18 11:21:00 -06:00
2ffafc7aa9 feat(lsp): add LspAttach and LspDetach autocommands
The current approach of using `on_attach` callbacks for configuring
buffers for LSP is suboptimal:

1. It does not use the standard Nvim interface for driving and hooking
   into events (i.e. autocommands)
2. There is no way for "third parties" (e.g. plugins) to hook into the
   event. This means that *all* buffer configuration must go into the
   user-supplied on_attach callback. This also makes it impossible for
   these configurations to be modular, since it all must happen in the
   same place.
3. There is currently no way to do something when a client detaches from
   a buffer (there is no `on_detach` callback).

The solution is to use the traditional method of event handling in Nvim:
autocommands. When a LSP client is attached to a buffer, fire a
`LspAttach`. Likewise, when a client detaches from a buffer fire a
`LspDetach` event.

This enables plugins to easily add LSP-specific configuration to buffers
as well as enabling users to make their own configurations more modular
(e.g. by creating multiple LspAttach autocommands that each do
something unique).
2022-05-18 11:21:00 -06:00
8a9ab88945 feat(api): enable nvim_exec_autocmds to pass arbitrary data (#18613)
Add a "data" key to nvim_exec_autocmds that passes arbitrary data (API
objects) to autocommand callbacks.
2022-05-18 09:51:26 -06:00
288819c9cc fix(ui): set correct position on mouse click when 'winbar' is enabled 2022-05-18 21:15:34 +06:00
d7dd600716 Merge pull request #18562 from famiu/feat/ui/winbar
feat(ui): add `'winbar'`
2022-05-18 13:08:07 +02:00
028329850e refactor: grid->rows and grid->cols 2022-05-18 13:06:02 +02:00
2d27732029 build(deps): bump libuv to HEAD - 730e07e2f (#18606) 2022-05-18 11:22:46 +02:00
93d24a63b2 test: fix mksession terminal CWD test again (#18615) 2022-05-18 16:07:16 +08:00
6e414b698c test: unskip tests on Windows (#18600)
Remove the command('qall!') from mksession_spec.lua because it prevents
helpers.rmdir() from retrying.

Allow extra trailing spaces when matching terminal lines.
2022-05-18 12:57:04 +08:00
e1bdb2a258 feat(ui): add 'winbar'
Adds support for a bar at the top of each window, enabled through the
`'winbar'` option.

Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-18 09:27:08 +06:00
b70856009d Merge #18605 PVS fixes 2022-05-18 02:32:15 +02:00
7ded303d68 vim-patch:8.2.4975: recursive command line loop may cause a crash (#18614)
Problem:    Recursive command line loop may cause a crash.
Solution:   Limit recursion of getcmdline().
51f0bfb88a

Cherry-pick e_command_too_recursive from patch 8.2.3957.
2022-05-18 08:21:24 +08:00
10868dbf89 fix(PVS/V1044): suppress warning 2022-05-17 22:26:25 +02:00
5084b6fb92 fix(PVS/V568): correct placement of ignore directive 2022-05-17 22:26:25 +02:00
65f585ce9b fix(PVS/V547): "expression is always false"
Suppress warning in loop.c, the expression can be true if EXITFREE isn't
defined.
2022-05-17 22:26:25 +02:00
e75ccc3b3a fix(PVS/V1028): prevent potential overflow 2022-05-17 22:26:25 +02:00
38cbca3eea fix(health): handle non-existent log file #18610
Problem:
    vim.lsp: require("vim.lsp.health").check()
    ========================================================================
      - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
        function health#check, line 20
        Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
        stack traceback:
        ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
        [string "luaeval()"]:1: in main chunk

Solution:
Check for nil.

fix #18602
2022-05-17 11:11:14 -07:00
7ffa9073a3 refactor(runtime): convert more dist#ft functions to lua (#18430) 2022-05-17 19:48:45 +02:00
8a39032fdd Merge pull request #18554 from kevinhwang91/perf-timerstart
perf(_editor): no need to stop inside vim.defer_fn
2022-05-17 18:59:48 +02:00
a4c0c07043 revert: "ci: remove mingw job #18580"
This partially reverts commit f8af81445b.

The mingw parts of cmake was removed to see if it was still used
(ref: https://github.com/neovim/neovim/pull/18580). It turns out it is,
so this will fix that.

Closes: https://github.com/neovim/neovim/issues/18597
2022-05-17 17:07:45 +02:00
6219331c4d feat(api): add win and buf to nvim_set_option_value
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-05-17 14:48:10 +01:00
8a73e60eb9 fixup: update test/functional/lua/vim_spec.lua
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-05-17 14:25:56 +01:00
f49699737c fix(terminal): do not trim whitespace that is actually in the terminal (#16423) 2022-05-17 21:09:28 +08:00
bbfc4567df fix(health): correct shada file path #18603 2022-05-17 05:43:35 -07:00
b239db3cb5 feat(lintcommit): remove "chore", add "dist" #18594
"chore" is never necessary, choose "fix" or "feat" if nothing else applies.
2022-05-17 05:42:48 -07:00
54b5222fbb docs(api): update v:errmsg behavior #18593 2022-05-17 05:27:33 -07:00
5c41165c8e feat(lua): allow some viml functions to run in fast
This change adds the necessary plumbing to annotate functions in funcs.c
as being allowed in run in luv fast events.
2022-05-17 10:29:33 +01:00
6613f58ceb Merge pull request #18598 from zeertzjq/vim-8.2.4968
vim-patch:8.2.{4121,4968,4969}: invalid memory access
2022-05-17 08:47:45 +08:00
527e861cbb vim-patch:8.2.4969: changing text in Visual mode may cause invalid memory access
Problem:    Changing text in Visual mode may cause invalid memory access.
Solution:   Check the Visual position after making a change.
7ce5b2b590
2022-05-17 08:16:37 +08:00
26c906f54d vim-patch:8.2.4968: reading past end of the line when C-indenting
Problem:    Reading past end of the line when C-indenting.
Solution:   Check for NUL.
60ae0e7149
2022-05-17 08:16:31 +08:00
b8c0eeaa30 vim-patch:8.2.4121: Visual test fails on MS-Windows
Problem:    Visual test fails on MS-Windows.
Solution:   Set 'isprint' so that the character used is not printable.
262898ae43
2022-05-17 08:16:31 +08:00
07ade91f21 docs: vim.regex is case sensitive by default (#18595) 2022-05-16 13:30:00 -06:00
b9b5577d6d Merge pull request #18578 from dundargoc/refactor/remove-char_u
refactor: remove char_u
2022-05-16 14:24:29 +02:00
14d653b421 feat(man.vim): list command flags in "gO" outline #17558 2022-05-16 04:49:44 -07:00
f0148de790 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-16 13:27:06 +02:00
7adecbcd29 fix(version.c): mark N/A vim patches #18587
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in https://github.com/neovim/neovim/issues/5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0056

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in https://github.com/neovim/neovim/issues/5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in https://github.com/neovim/neovim/issues/1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
2022-05-16 03:23:36 -07:00
cd998f8804 ci(coverity): correct cron job time #18590
The comment says it should be run at 00:10 UTC, and in cron job format
minutes come before hours.
2022-05-16 03:21:55 -07:00
e501e4ed4b feat(lua): add traceback to vim.deprecate #18575 2022-05-15 18:07:36 -07:00
b2799518c7 feat(terminfo): bump built-in terminfo entries (#18570)
Removes NOLINT, which is pointless for the generated terminfo_defs.h.

Adds `uncrustify:off`, so it is not uncrustify which complains about the same
things (too long lines, no space after comma) instead.
2022-05-16 01:45:34 +02:00
f8af81445b ci: remove mingw job #18580
Unnecessary CI builds increase the change of spurious failures, which are costly
noise. Of course, we should fix all legitimate bugs, but we also cannot
micro-manage every platform, so there needs to be a clear motivation for the CI
builds that we maintain.

Reasons against maintaining a mingw CI job:
1. The windows mingw build is slow.
2. Failures:
    - https://github.com/neovim/neovim/issues/18494
    - https://github.com/neovim/neovim/issues/18495
3. The mingw artifact is 10x bigger than the windows MSVC artifact:
   https://github.com/neovim/neovim/issues/10560
4. Our releases publish the MSVC (not mingw) artifact for Windows users:
   https://github.com/neovim/neovim/releases
5. Non-MSVCRT has limitations documented by libuv: http://docs.libuv.org/en/v1.x/process.html
   > On Windows file descriptors greater than 2 are available to the child process only if the child processes uses the MSVCRT runtime.

Closes https://github.com/neovim/neovim/issues/18551
2022-05-15 15:59:58 -07:00
59ba66d1ab ci(clint): remove checks for whitespace after comma/semicolon (#18584)
uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-16 00:14:31 +02:00
5e3b16836a docs(api): nvim_set_hl attributes #18558 2022-05-15 14:06:06 -07:00
0a3d615b1c fix(api): nvim_eval_statusline should validate input #18347
Fix #18112

Make an exception for strings starting with "%!".
2022-05-15 13:06:23 -07:00
19da1071dc ci(clint): remove clint.py line length check #18574
uncrustify is the source of truth where possible.
Remove any redundant checks from clint.py.
See also https://github.com/neovim/neovim/pull/18563
2022-05-15 12:01:29 -07:00
717560d221 Merge pull request #18581 from famiu/refactor/ui/vertsplit
refactor(ui)!: link `VertSplit` to `Normal` by default
2022-05-15 20:01:17 +02:00
bbf58e6bbc refactor(ui)!: link VertSplit to Normal by default
Avoids using `gui=reverse` on `VertSplit` and makes window separators
look much nicer by default.
2022-05-15 22:37:35 +06:00
a098e304b0 ci: enable tests on drafts as well #18566
previous: https://github.com/neovim/neovim/pull/14123

CI tests were disabled on drafts #18566 to manage the
large number of incoming jobs. While this did help, it had the drawback
of making the purpose of the ready-for-review a bit fuzzier. It went
from a clear "my PR is ready" signal to maintainers to somewhere between
"my PR is ready but I need the tests to confirm" to "please don't merge
yet, I just need to see the test results". Worse is that the specific
case of wanting to see the test results but not wanting it merged is
that this needs to be actively conveyed to the maintainers with a [DNM]
or a comment to not merge the PR yet. All of this causes weird
workarounds and noises which I believe isn't necessary.

The reason why I don't think this workaround is needed anymore is that
our CI now aborts a job if a new job from the same pull requests is
created, which makes the "10 simultaneous jobs per PR" situations that
triggered this not possible.
2022-05-15 08:18:38 -07:00
793496aecc fix PVS warnings (#18459)
* fix(PVS/V547): remove ifs that are always true or false

* fix(PVS/V560): remove partial conditions that are always true

* fix(PVS/V1044): suppress warning about loop break conditions

* fix(PVS/V1063): suppress "modulo by 1 operation is meaningless"

* fix(PVS/V568): suppress "operator evaluates the size of a pointer"

Also mark vim-patch:8.2.4958 as ported.
2022-05-15 21:04:56 +08:00
4c7462fdb3 build: enable EXITFREE on Debug builds (#17783)
This makes it more convenient to find memory leaks since you don't need
to remember to set the EXITFREE flag every time you use valgrind or a
sanitizer.
2022-05-15 11:41:17 +02:00
b1b5802009 build(gen_vimdoc): eliminate non-constant global variables (#17781) 2022-05-15 11:23:56 +02:00
0a66c4a72a docs(nvim_set_keymap): specify that optional arguments defaults to false (#18177)
Closes: https://github.com/neovim/neovim/issues/16919
2022-05-15 16:44:48 +08:00
bc45b5be1c vim-patch:partial: 30ab04e16e1e (#18568)
Update runtime files, new color schemes
30ab04e16e

Skip: doc/* (in-progress rewrite of the user manual on creating vim(9)script plugins)
2022-05-15 10:25:02 +02:00
0adc66171a refactor(uncrustify): enable formatting for regexp and indent files (#18549)
The formatting for these files were originally disabled as to signal
that "we don't own these files", meaning we intentionally want to
minimize the amount of work put in these files as the return will be
very little. This unfortunately conflicts with other refactoring efforts
that happen to touch these files, and it's easier to simply enable
formatting.
2022-05-14 20:35:39 +02:00
83da441d16 Merge pull request #18537 from dundargoc/ci/clint
ci(clint): remove check for include order
2022-05-14 19:09:33 +02:00
3bd7246f5a ci(clint): remove check for include order
Uncrustify and clang-format are already both excellent at ordering
includes; this isn't something we need to check for ourselves. Also
remove the section on include order in the dev-style documentation.
2022-05-14 15:09:02 +02:00
adf967331f ci(clint): fix all pyright warnings 2022-05-14 15:09:02 +02:00
d547e21f9e Merge pull request #18567 from zeertzjq/vim-8.2.4951
vim-patch:8.2.{4951,4953}: with 'si' inserting char after completion goes wrong
2022-05-14 20:48:05 +08:00
dca0412d37 vim-patch:8.2.4953: with 'si' inserting '}' after completion goes wrong
Problem:    With 'smartindent' inserting '}' after completion goes wrong.
Solution:   Check the cursor is in indent.  (closes vim/vim#10420)
2e444bbef0
2022-05-14 20:05:39 +08:00
24eb1af475 vim-patch:8.2.4951: smart indenting done when not enabled
Problem:    Smart indenting done when not enabled.
Solution:   Check option values before setting can_si. (closes vim/vim#10420)
de5cf28781
2022-05-14 20:05:39 +08:00
99f3e74fc2 Merge pull request #18542 from famiu/feat/api/nvim_cmd/kvec_t
refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline string
2022-05-14 11:20:13 +02:00
566f8f80d6 refactor(api/nvim_cmd): use kvec_t for constructing cmdline string
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-14 10:25:52 +06:00
Roj
9e4286294f build(nvim.desktop): central Kurdish translation #17065
Co-authored-by: Sarchia <74000088+Sarchia@users.noreply.github.com>
2022-05-13 11:58:22 -07:00
f6ba7d69be fix(man.vim): q in "$MANPAGER mode" does not quit #18443
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
    nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")

Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.

Fixes #18281
Ref #17791

Helped-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2022-05-13 07:49:08 -07:00
eb4b337d9e vim-patch:partial:3f32a5f1601a (#18555)
Update runtime files and translations
3f32a5f160

skip eval.txt (requires 8.2.4883)
2022-05-13 15:20:58 +02:00
c196119acb vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947)
Problem:    Search highlight disappears in the Visual area.
Solution:   Combine the search attributes. (closes vim/vim#8134)
2d5f385cee
2022-05-13 21:20:15 +08:00
2875d45e79 ci(commitlint): ignore "fixup" commits #18556 2022-05-13 05:37:33 -07:00
a33caf9b45 perf(_editor): no need to stop inside vim.defer_fn
uv_run:
1. remove timer handle from heap
2. will start again if repeat is not 0
2022-05-13 14:16:47 +08:00
030417d80b revert: "feat(mappings): do not simplify the rhs of a mapping" (#18553)
This reverts commit 7ac5359143.
This fix can cause more problems than it solves.
2022-05-13 11:31:17 +08:00
233c41cb8c feat(defaults): search selection by * and # in visual mode (#18538) 2022-05-13 08:28:10 +08:00
b96037e42d ci: remove remnants of gperf #18550
gperf was removed in 36613b888b
yay!
2022-05-12 16:55:27 -07:00
0d5d9e90ab fix(windows): stdpath("state") => "nvim-data" #18546
This was missed in https://github.com/neovim/neovim/pull/15583
2022-05-12 16:54:44 -07:00
aaeffba684 vim-patch:8.2.4943: changing 'switchbuf' may have no effect (#18545)
Problem:    Changing 'switchbuf' may have no effect.
Solution:   Handle 'switchbuf' in didset_string_options(). (Sean Dewar,
            closes vim/vim#10406)
39c46b4378

Guess it doesn't hurt to cherry-pick didset_string_options from v8.1.2045
(but in option.c, for now).
2022-05-13 00:41:20 +01:00
af9c1e572d Merge pull request #18489 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-13 00:14:46 +02:00
e2d3e73748 Merge pull request #18544 from bfredl/hashyhash
refactor(eval): use Hashy McHashFace instead of gperf
2022-05-12 21:24:33 +02:00
36613b888b refactor(eval): use Hashy McHashFace instead of gperf
this removes gperf as a build dependency
2022-05-12 20:01:04 +02:00
a9d25e9472 fix(lsp): perform client side filtering of code actions (#18392)
Implement filtering of actions based on the kind when passing the 'only'
parameter to code_action(). Action kinds are hierachical with a '.' as
the separator, and the filter thus allows, for example, both 'quickfix'
and 'quickfix.foo' when requestiong only 'quickfix'.

Fix https://github.com/neovim/neovim/pull/18221#issuecomment-1110179121
2022-05-12 18:48:02 +02:00
de5ccf2348 Merge pull request #18540 from zeertzjq/vim-8.2.4919
vim-patch:8.2.{4919,4921}: can add invalid bytes with :spellgood
2022-05-12 23:48:58 +08:00
0c8e48c78d chore(editorconfig): remove "charset" (#18541)
Hardcoding a charset causes trouble when porting Vim patches.
I previously tried to unset "charset" for certain file extensions, but
vim-patch.sh can generate more files, and automatically detecting file
encoding is more correct anyway.
2022-05-12 23:48:42 +08:00
a200ce0d85 vim-patch:8.2.4941: '[ and '] marks may be wrong after undo (#18539)
Problem:    '[ and '] marks may be wrong after undo.
Solution:   Adjust the '[ and '] marks if needed. (closes vim/vim#10407, closes vim/vim#1281)
82444cefa3
2022-05-12 23:38:26 +08:00
8c0510af71 vim-patch:8.2.4921: spell test fails because of new illegal byte check
Problem:    Spell test fails because of new illegal byte check.
Solution:   Remove the test.
fe978c2b6b
2022-05-12 23:09:41 +08:00
274f260806 vim-patch:8.2.4919: can add invalid bytes with :spellgood
Problem:    Can add invalid bytes with :spellgood.
Solution:   Check for a valid word string.
7c824682d2
2022-05-12 23:07:35 +08:00
8fba428bc6 fix(cmd): make :-tabmove work with modifiers (#18447)
`:tabmove` takes either an argument (`:tabmove -`) or an address (`:-tabmove`).

The code assumed that `:tabmove` is the first command on the cmdline, but that
is not the case when using additional modifiers like `:silent`.

Make the addr parsing more robust by searching the command first, then going
back to check for a potential address `-`.
2022-05-12 16:43:20 +02:00
78a1e6bc00 feat(defaults): session data in $XDG_STATE_HOME #15583
See: 4f2884e16d

- Move session persistent data to $XDG_STATE_HOME Change 'directory',
  'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to
  $XDG_STATE_HOME/nvim.
- Move logs to $XDG_STATE_HOME, too.
- Add stdpath('log') support.

Fixes: #14805
2022-05-12 07:13:45 -07:00
a1b663cce8 build(lua2dox): add parenthesis around parameter types in documentation (#18532)
This will check if the string after the variable in a @param is either
"number", "string", "table", "boolean" and "function" and if so add a
parenthesis around it. This will help separate the variable type with
the following text. Had all our functions been annotated with emmylua
then a more robust solution might have been preferable (such as always
assuming the third string is parameter type without making any checks).
I believe however this is a clear improvement over the current situation
and will suffice for now.
2022-05-12 08:02:46 -06:00
2bbd588e73 feat(lua): vim.cmd() with kwargs acts like nvim_cmd() #18523 2022-05-12 06:34:38 -07:00
963cfa7020 fix(terminal): invalid pointer comparison #18453
At the moment of comparison, the pointer save_curwin can be invalid (as
suggested by the comment) because it has been free'd. Worst, the new
curwin could have been re-allocated to that same pointer, altering the
execution flow unpredictably.

While there are many other potential similar cases to fix in the
codebase, the presented scenario is not hypothetical and does happen in
practice (while spawning new windows from fzf for instance).

There are numerous other instances of curwin comparisons in the
codebase, and they may need further investigation.

closes #16941
2022-05-12 05:53:08 -07:00
3a91adabda refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)
Most code in keymap.h is for keycode definitions, while most code in
keymap.c is for the parsing and conversion of keycodes.

The name "keymap" may also make people think these two files are for
mappings, while in fact keycodes are used even when no mappings are
involved, so "keycodes" should be a better file name than "keymap".
2022-05-12 20:19:29 +08:00
a2d4b862f1 ci(bsd): conditional runs for faster builds #18439
(undocumented) sourcehut feature for conditionally running consequent tasks.

ref:
https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C3cd90a91b7ce113bb3c5f07898c77543%40hacktivista.com%3E
https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/worker/tasks.go#L196-198
2022-05-11 18:26:07 -07:00
c24b442e31 fix(runtime/genvimvim): omit s[ubstitute] from vimCommand #18480
It's special cased by the vimSubst syntax group, and isn't present in Vim's
vimCommand group.

For example, this fixes `call s:Foo()` highlighting `:` as Error in Nvim, as the
`s` is parsed as vimCommand rather than as vimUserFunc since
`contains=vimCommand` was added to vimUserFunc (and vimFunc) in a rt update.

Interestingly, `g:`, `l:`, etc. have the same issues due to :global, :list, etc.
Vim also has that problem, so it should ideally be fixed upstream.

We could also omit g[lobal] from vimCommand and rely on vimGlobal instead, but
it doesn't work in some cases, like when there's a `:` before the command. Also,
Vim matches only `g` in vimCommand for some reason, which doesn't produce any
highlight for `:global/foo/bar` (with Nvim you at least get some highlights on
the `global` bit despite the leading `:`).

Also, remove special handling of :py3 in syntax/vim.vim, as the generator seems
to have no problems finding it.
2022-05-11 17:08:25 -07:00
60b1e314ed docs: nvim_buf_[get|set]_[text|lines] (#18404)
- Use consistent formatting for args docs.
- Clarify inclusivity/exclusivity in `nvim_buf_[get|set]_text`.
2022-05-11 17:05:56 -07:00
7900a8b713 docs(api): how to check if window is floating #18503 2022-05-11 16:49:19 -07:00
85aae12a6d refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-11 23:19:57 +02:00
cf68f0a512 fix(api): make nvim_cmd work correctly with empty arguments list (#18527)
Closes #18526.
2022-05-11 10:51:53 -06:00
a6f4cfdefa docs(api): improve shared lua functions docs (#17933) 2022-05-11 10:23:46 -06:00
e36e0f7b2f vim-patch:8.2.4939: matchfuzzypos() with "matchseq" does not have all positions (#18525)
Problem:    matchfuzzypos() with "matchseq" does not have all positions.
Solution:   Also add a position for white space. (closes vim/vim#10404)
9af2bc0751
2022-05-11 21:51:31 +08:00
b13089c956 Merge pull request #18522 from zeertzjq/vim-8.2.4901
vim-patch:8.2.{4901,4938}: NULL pointer access when using invalid pattern
2022-05-11 19:47:05 +08:00
6f52bc5dee vim-patch:8.2.4938: crash when matching buffer with invalid pattern
Problem:    Crash when matching buffer with invalid pattern.
Solution:   Check for NULL regprog.
a59f2dfd0c
2022-05-11 19:13:07 +08:00
0019886a84 vim-patch:8.2.4901: NULL pointer access when using invalid pattern
Problem:    NULL pointer access when using invalid pattern.
Solution:   Check for failed regexp program.
8e4b76da1d
2022-05-11 19:09:21 +08:00
96a125b207 Merge pull request #18366 from famiu/feat/api/nvim_cmd
feat(api): add `nvim_cmd`
2022-05-11 10:39:02 +02:00
3a5abcd649 chore: git-blame-ignore stylua format PR (#18516)
add aefdc6783c
to .git-blame-ignore-revs
2022-05-11 09:31:58 +02:00
dfcc584665 feat(api): add nvim_cmd
Adds the API function `nvim_cmd` which allows executing an Ex-command through a Dictionary which can have the same values as the return value of `nvim_parse_cmd()`. This makes it much easier to do things like passing arguments with a space to commands that otherwise may not allow it, or to make commands interpret certain characters literally when they otherwise would not.
2022-05-11 13:12:16 +06:00
39afa64eed build(deps): bump Luv to HEAD - c51e7052e (#18510) 2022-05-11 08:58:06 +02:00
cb7ab98925 Merge pull request #18487 from clason/stylua
CI: format and lint runtime with Stylua
2022-05-11 08:54:24 +02:00
e50b1fe60d vim-patch:921bde888046 (#18511)
Update runtime files, translations
921bde8880

skip: translations
skip: builtin.txt (requires 8.2.4861)
2022-05-10 10:55:33 +02:00
5359be7893 Merge pull request #18509 from zeertzjq/vim-8.2.4929
vim-patch:8.2.4929: off-by-one error in in statusline item
2022-05-10 08:54:37 +08:00
65df08aade test: convert two statusline oldtests to Lua screen tests 2022-05-10 08:15:46 +08:00
406c2e35b3 vim-patch:8.2.4929: off-by-one error in in statusline item
Problem:    Off-by-one error in in statusline item.
Solution:   Subtrace one less. (closes vim/vim#10394, closes vim/vim#5599)
57ff52677b
2022-05-10 07:59:43 +08:00
9aa5647e68 vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)
Problem:    The mode #defines are not clearly named.
Solution:   Prepend MODE_.  Renumber them to put the mapped modes first.
249591057b

A hunk from the patch depends on patch 8.2.4861, which hasn't been
ported yet, but that should be easy to notice.
2022-05-10 07:58:58 +08:00
c55867b46d docs(lsp): fix description of only in vim.lsp.buf.code_action() (#18492) 2022-05-09 18:08:04 +02:00
aefdc6783c chore: format runtime with stylua 2022-05-09 16:31:55 +02:00
676e9e9334 ci: lint runtime with stylua 2022-05-09 16:31:55 +02:00
77863b8e96 feat(keyset): allow hash conflicts 2022-05-09 19:53:47 +06:00
8658e82357 vim-patch:8.2.4925: trailing backslash may cause reading past end of line (#18493)
Problem:    Trailing backslash may cause reading past end of line.
Solution:   Check for NUL after backslash.
53a70289c2

N/A patches for version.c:

vim-patch:8.2.4926: #ifdef for crypt feature around too many lines

Problem:    #ifdef for crypt feature around too many lines.
Solution:   Move code outside of #ifdef. (closes vim/vim#10388)
51f0bc31d3
2022-05-09 21:10:53 +08:00
f0135d9cd9 Merge pull request #18491 from zeertzjq/vim-8.2.4924
vim-patch:8.2.4924: maparg() may return a string that cannot be reused
2022-05-09 19:44:31 +08:00
db506d991d vim-patch:8.2.4924: maparg() may return a string that cannot be reused
Problem:    maparg() may return a string that cannot be reused.
Solution:   use msg_outtrans_special() instead of str2special().
            (closes vim/vim#10384)
0519ce0039
2022-05-09 19:19:21 +08:00
41ce7b07e2 Merge pull request #18490 from zeertzjq/vim-8.2.4918
vim-patch:8.2.{4918,4923}: conceal character from matchadd() displayed too many times
2022-05-09 18:39:32 +08:00
79929cf44d vim-patch:8.2.4923: test checks for terminal feature unnecessarily
Problem:    Test checks for terminal feature unnecessarily.
Solution:   Remove CheckRunVimInTerminal. (closes vim/vim#10383)
194843028e
2022-05-09 18:07:09 +08:00
a56a43614c vim-patch:8.2.4918: conceal character from matchadd() displayed too many times
Problem:    Conceal character from matchadd() displayed too many times.
Solution:   Check the syntax flag. (closes vim/vim#10381, closes vim/vim#7268)
9830db6305
2022-05-09 18:06:55 +08:00
5382ed8028 Merge pull request #18485 from zeertzjq/vim-8.2.4915
vim-patch:8.2.{4916,4922}: mouse in Insert mode test fails
2022-05-09 17:42:06 +08:00
84c031fade vim-patch:8.2.4922: mouse test fails on MS-Windows
Problem:    Mouse test fails on MS-Windows.
Solution:   Set 'mousemodel' to "extend".
b370771bff
2022-05-09 17:16:22 +08:00
a501127899 vim-patch:8.2.4916: mouse in Insert mode test fails
Problem:    Mouse in Insert mode test fails.
Solution:   Fix the text and check relevant positions.
8e8dc9b323

Use nvim_input_mouse() to set mouse position, and discard mouse event
using getchar().
2022-05-09 17:16:22 +08:00
dfeb5b47bc Merge pull request #18466 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-09 10:29:51 +02:00
e31b32a293 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-09 10:03:29 +02:00
dbdd58e548 feat: cmdline funcs (#18284)
vim-patch:8.2.4903: cannot get the current cmdline completion type and position

Problem:    Cannot get the current cmdline completion type and position.
Solution:   Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita,
            closes vim/vim#10344)
79d599b877

vim-patch:8.2.4910: imperfect coding

Problem:    Imperfect coding.
Solution:   Make code nicer.
9ff7d717aa
2022-05-09 12:52:31 +08:00
f6be28c61a Merge pull request #18478 from bfredl/gridfile
refactor(grid): move out grid_* functions from screen.c
2022-05-09 00:44:33 +02:00
6cfb1d4c28 fix(lsp): detach spawned LSP server processes (#18477)
LSP servers should be daemonized (detached) so that they run in a
separate process group from Neovim's. Among other things, this ensures
the process does not inherit Neovim's TTY (#18475).

Make this configurable so that clients can explicitly opt-out of
detaching from Nvim.
2022-05-08 13:00:30 -06:00
df41d884a7 refactor(grid): move out grid_* functions from screen.c
Also normalize some types. use "size_t" for unsigned array offsets.
Fix -Wconversion issues missed as screen.c is missing this check.
2022-05-08 13:22:09 +02:00
0d3f17a6c3 vim-patch:partial:d899e5112079 (#18474)
Update runtime files
d899e51120

- Skip vimhelp.vim stuff (syntax/help.vim, syntax.txt; v8.2.4891).
- Skip :let heredoc eval stuff (eval.txt; v8.2.4770).
- Skip uk.cp1251.po.
- Skip `*hl-CurSearch*` change (syntax.txt):
  - Vim's CurSearch works differently (Nvim's uses current cursor pos).
    Dunno know how applicable the redrawing comment is to Nvim...
  - Might be preferred to move it under `*hl-Search*` like Vim?
2022-05-08 10:15:36 +01:00
1b1cc4d864 vim-patch:8.2.4908: no text formatting for // comment after a statement (#18472)
Problem:    No text formatting for // comment after a statement.
Solution:   format a comment when the 'c' flag is in 'formatoptions'.
48a8a83303
2022-05-08 07:51:12 +08:00
0a00792332 vim-patch:8.2.4907: some users do not want a line comment always inserted (#18463)
Problem:    Some users do not want a line comment always inserted.
Solution:   Add the '/' flag to 'formatoptions' to not repeat the comment
            leader after a statement when using "o".
2bf875f881
2022-05-07 16:49:36 +02:00
03471e292d Merge pull request #18425 from dundargoc/refactor/char_u/1
refactor: replace char_u variables and functions with char
2022-05-07 16:40:00 +02:00
eccb989689 Merge pull request #18460 from bfredl/decor33
refactor(decor): use decor levels properly
2022-05-07 14:57:23 +02:00
2a378e6e82 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-07 14:54:01 +02:00
add3ad6a48 Merge pull request #18450 from dundargoc/build/clint/remove-function-size-warning
build(clint): remove "function size is too large" warning
2022-05-07 14:21:01 +02:00
5e2346178c refactor(decor): use decor levels properly 2022-05-07 14:08:21 +02:00
d306210641 docs: change wrap_at type to number (#18456) 2022-05-07 10:35:08 +02:00
6c39f9d427 Merge pull request #18457 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` work correctly with both range and count
2022-05-07 09:46:06 +02:00
14f3383c0d fix(api): make nvim_parse_cmd work correctly with both range and count
It seems range and count can be used together in commands. This PR fixes
the behavior of `nvim_parse_cmd` for those cases by removing the mutual
exclusivity of "range" and "count". It also removes range line number
validation for `nvim_parse_cmd` as it's not its job to validate the
command.
2022-05-07 12:26:49 +06:00
cd8edb551b Merge pull request #18455 from zeertzjq/extmarksplice
fix(extmarks): revert to int for extmark row
2022-05-07 11:09:08 +08:00
f1bc321b56 Merge pull request #18444 from zeertzjq/ci-unsigned-char
ci: add a check with -funsigned-char
2022-05-06 22:47:24 -04:00
f5ed1b3908 fix(extmarks): revert to int for extmark row 2022-05-07 09:55:13 +08:00
b2a8ed0855 Merge pull request #18452 from dundargoc/vim-8.2.4469
vim-patch:8.2.4469: Coverity warns for uninitialized variable
2022-05-07 06:47:56 +08:00
11631354cb vim-patch:8.2.4469: Coverity warns for uninitialized variable
Problem:    Coverity warns for uninitialized variable.
Solution:   Set the value to zero.
05c1734c4f
2022-05-06 23:17:56 +02:00
44a4af0ed0 fix(lsp): skip clients without rename capability (#18449)
Follow up to https://github.com/neovim/neovim/pull/18441
This way rename should "just work" in most cases without having to
manually filter the client
2022-05-06 18:57:08 +02:00
d0897243f6 build(clint): remove "function size is too large" warning
This warning is essentially only triggered for ported vim functions.
It's unlikely that we'll refactor vim functions solely based on their
size since it'd mean we'd greatly deviate from vim, which is a high cost
when it comes to importing the vim patches. Thus, this warning only
serves as an annoyance and should be removed.
2022-05-06 18:03:57 +02:00
d9ec57e16a Merge pull request #18302 from dundargoc/refactor/enable-conversion-warning/edit
refactor: enable -Wconversion warning for edit.c
2022-05-06 15:00:40 +02:00
7978660efb vim-patch:8.2.4881: "P" in Visual mode still changes some registers (#18445)
Problem:    "P" in Visual mode still changes some registers.
Solution:   Make "P" in Visual mode not change any register. (Shougo
            Matsushita, closes vim/vim#10349)
509142ab7a
2022-05-06 19:26:28 +08:00
21a31ea929 refactor: enable -Wconversion warning for edit.c
Work on https://github.com/neovim/neovim/issues/567
2022-05-06 11:00:29 +02:00
8bbeab9989 Merge pull request #18442 from dundargoc/uncrustify
refactor: upgrade uncrustify configuration to version 0.75
2022-05-06 10:41:51 +02:00
e3edcd06e3 Merge pull request #18438 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` propagate errors
2022-05-06 10:30:48 +02:00
21abb24bd0 ci: add a check with -funsigned-char 2022-05-06 08:49:26 +08:00
544ef994df refactor: upgrade uncrustify configuration to version 0.75 2022-05-06 00:46:30 +02:00
eb0cc2a62e refactor: move macro definiton outside of enums
Uncrustify version 0.75 assumes the macro inside the enum is an enum
element, and thus adds a comma after it. This breaks neovim and makes it
impossible to build it.
2022-05-06 00:45:57 +02:00
55187de115 fix(lsp): fix rename capability checks and multi client support (#18441)
Adds filter and id options to filter the client to use for rename.
Similar to the recently added `format` function.

rename will use all matching clients one after another and can handle a
mix of prepareRename/rename support. Also ensures the right
`offset_encoding` is used for the `make_position_params` calls
2022-05-05 23:56:00 +02:00
d14d308ce8 Merge pull request #18431 from famiu/feat/api/nvim_get_autocmds/group_name
feat(api): add `group_name` to `nvim_get_autocmds`
2022-05-05 20:17:11 +02:00
96289f2416 feat(api): add group_name to nvim_get_autocmds 2022-05-05 23:17:36 +06:00
511f06a56e fix(api): make nvim_parse_cmd propagate errors
Makes `nvim_parse_cmd` propagate any errors that occur while parsing to
give the user a better idea of what's wrong with the command.
2022-05-05 23:11:57 +06:00
94eb72cc44 fix(lsp): make sure to always reset active codelens refreshes (#18331)
This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.

Examples of how such scenarios would occur are:
  - A textDocument/codeLens result yielded an error.
  - The 'textDocument/codeLens' handler was overriden in such a way that
    it no longer called vim.lsp.codelens.on_codelens().
2022-05-05 18:50:12 +02:00
b2fb3614b0 Revert "ci(bsd): conditional runs for faster builds" #18437
The change has a syntax error.

This reverts commit 3e3e9c3125.
2022-05-05 09:47:53 -07:00
d4f47fe17d Merge pull request #18416 from dundargoc/refactor/remove-char_u
refactor/remove char u
2022-05-05 18:42:00 +02:00
3e3e9c3125 ci(bsd): conditional runs for faster builds #18434
sourcehut undocumented feature for conditionally running tasks.

The current condition is based on git's pathspec, see `man gitglossary(7)`, to
skip commits that only changed files under `.github/*`.

refs
- https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
- https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C3cd90a91b7ce113bb3c5f07898c77543%40hacktivista.com%3E
- https://git.sr.ht/~sircmpwn/builds.sr.ht/tree/master/item/worker/tasks.go#L196-198
2022-05-05 09:35:14 -07:00
7fa8109881 Merge pull request #18314 from tk-shirasaka/global-statusline-on-ext_messages
fix: display global statusline correctly with ext_messages
2022-05-05 18:33:52 +02:00
9a671e6a24 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-05 18:10:46 +02:00
1eecea8449 Merge pull request #18417 from famiu/feat/api/nvim_parse_cmd
refactor(api): make `range` in `nvim_parse_cmd` an array
2022-05-05 17:31:02 +02:00
7aedcd8feb refactor(api): make range in nvim_parse_cmd an array
Changes the `range` value in `nvim_parse_cmd` into an array to describe
range information more concisely. Also makes `range` and `count` be
mutually exclusive by making count `-1` when command takes a range
instead of a count. Additionally corrects the behavior of `count` for
built-in commands by making the default count `0`.
2022-05-05 20:35:14 +06:00
82c7a82c35 vim-patch:8.2.4868: when closing help window autocmds triggered for wrong window (#18420)
Problem:    When closing help window autocmds triggered for the wrong window.
Solution:   Figure out the new current window earlier. (closes vim/vim#10348)
2a2707d033
2022-05-05 07:26:42 +08:00
beb8f48489 vim-patch:8.2.4867: listing of mapping with K_SPECIAL is wrong (#18419)
Problem:    Listing of mapping with K_SPECIAL is wrong.
Solution:   Adjust escaping of special characters. (closes vim/vim#10351)
ac402f4d64

Avoid overshadowing.
Cherry-pick Test_list_mapping() from Vim patches 8.2.{0148,2994}.
Fix rhs_is_noop.
2022-05-05 07:23:27 +08:00
6798f1fab0 vim-patch:8.2.4865: :startinsert right after :stopinsert may not work (#18418)
Problem:    :startinsert right after :stopinsert does not work when popup menu
            is still visible.
Solution:   Use ins_compl_active() instead of pum_visible(). (closes vim/vim#10352)
cd5dbad184
2022-05-05 06:58:20 +08:00
b5957c3c32 fix: display global statusline correctly with ext_messages 2022-05-05 06:15:09 +09:00
e6c71574a0 Merge pull request #18386 from ii14/version_dict_prerelease
feat: add "prerelease" to version dict
2022-05-04 18:49:05 +02:00
f98149d87a Merge pull request #18413 from dundargoc/refactor/remove-char_u-autocmd
refactor/remove char u autocmd
2022-05-04 10:23:21 -06:00
f08477789f refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-04 17:49:37 +02:00
4f17e7e1c3 Merge pull request #18387 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-04 17:34:25 +02:00
5576d30e89 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-04 15:25:54 +02:00
3ec93ca92c feat(nvim_parse_cmd): add range, count, reg #18383
Adds range, count and reg to the return values of nvim_parse_cmd. Also makes
line1 and line2 be -1 if the command does not take a range. Also moves
nvim_parse_cmd to vimscript.c because it fits better there.
2022-05-04 05:04:01 -07:00
95b7851f62 build(deps): bump LuaJIT to HEAD - 91bc6b8ad (#18378) 2022-05-04 08:38:07 +02:00
c051ea83dd refactor(lua): replace hard-coded gsub with vim.pesc() (#18407) 2022-05-04 08:13:01 +02:00
815b65d777 fix(filetype): fixup scd filetype detection (#18403) 2022-05-03 23:03:42 +02:00
9005ffbe77 Merge pull request #18398 from vigoux/perf/ts_reuse_list
perf(treesitter): use a reuse list for query cursors
2022-05-03 21:11:10 +02:00
8ef03188e6 refactor(runtime): convert dist#ft functions to lua (#18247)
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-05-03 12:29:04 -06:00
1924883796 Merge pull request #18397 from vigoux/fix/ts_match_limit
fix(treesitter): bump match limit up
2022-05-03 20:18:15 +02:00
a0f17fd4d8 perf(treesitter): use a reuse list for query cursors 2022-05-03 19:51:30 +02:00
e453b6391e fix(treesitter): bump match limit up
This avoids ignoring too many match results, and avoid highlighting
being blank in some files.
2022-05-03 19:46:11 +02:00
4df11463b2 Merge pull request #15674 from yatli/ui_event_extmark
API/UI: ui_event_extmark
2022-05-03 16:59:24 +02:00
70e2c5d10d feat(lsp): add logging level "OFF" (#18379) 2022-05-03 08:49:23 -06:00
29a6cda3ff feat(api/ui): win_extmarks 2022-05-03 22:26:02 +08:00
73741e9486 feat(lua): vim.deprecate() #18320
This is primarily intended to act as documentation for the developer so
they know exactly when and what to remove. This will help prevent the
situation of deprecated code lingering for far too long as developers
don't have to worry if a function is safe to remove.
2022-05-03 06:42:41 -07:00
4fb48c5654 feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
2022-05-03 06:08:35 -07:00
b5c15ba7e5 fix(lsp): add missing bufnr argument (#18382) 2022-05-03 08:54:49 -04:00
20aaa59fb3 ci(MinGW): run pacman -Syu twice (#18384) 2022-05-03 20:38:24 +08:00
b2c92f36e1 feat: add "prerelease" to version dict 2022-05-03 11:33:55 +02:00
8ea84eee57 Merge pull request #18345 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-03 11:02:04 +02:00
b9bdd0f61e refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-03 10:33:40 +02:00
46734cf7c1 vim-patch:8.2.4859: wget2 files are not recognized (#18385)
Problem:    wget2 files are not recognized.
Solution:   Add patterns to recognize wget2. (Doug Kearns)
3a974a8933
2022-05-03 10:23:11 +02:00
13520aae16 fix(coverity): use xstrndup() instead of vim_strsave() (#18363) 2022-05-03 09:29:55 +08:00
cf474021ed Merge pull request #18381 from zeertzjq/vim-8.2.4858
vim-patch:8.2.4858: K_SPECIAL may be escaped twice
2022-05-03 07:30:12 +08:00
15602a7ce4 test: add more tests for K_SPECIAL escaping in <Cmd> mapping 2022-05-03 06:44:14 +08:00
27149e0071 vim-patch:8.2.4858: K_SPECIAL may be escaped twice
Problem:    K_SPECIAL may be escaped twice.
Solution:   Avoid double escaping. (closes vim/vim#10340)
db08887f24
2022-05-03 06:21:50 +08:00
ddf7bb24f9 Merge pull request #18357 from bfredl/ui_stdin
feat(ui): allow embedder to emulate "cat data | nvim -" behaviour
2022-05-02 23:24:37 +02:00
ad63b94b03 refactor(ui): simplify stdin handling 2022-05-02 22:19:41 +02:00
a1542b091d Merge pull request #18353 from jamessan/ft-match-fix 2022-05-02 11:01:51 -04:00
619c8f4b91 feat(api): support handling stdin stream in remote ui 2022-05-02 16:27:29 +02:00
88595fbb21 fix(filetype.lua): escape expansion of ~ when used as a pattern 2022-05-02 08:38:35 -04:00
af53fa0663 Merge pull request #18342 from kylo252/msgpack-bump
build: bump msgpack to 4.0.0
2022-05-02 08:10:51 -04:00
e6d62d5a3d vim-patch:8.2.4857: Yaml indent for multiline is wrong (#18365)
Problem:    Yaml indent for multiline is wrong.
Solution:   Adjust patterns. (closes vim/vim#10328, closes vim/vim#8740)
f4f579b46b
2022-05-02 13:57:33 +02:00
d23ce6ef76 vim-patch:8.2.4855: robot files are not recognized (#18364)
Problem:    Robot files are not recognized.
Solution:   Add patterns for robot files. (Zoe Roux, closes vim/vim#10339)
2096a5f128
2022-05-02 13:54:07 +02:00
e5f6f20968 Merge pull request #18356 from dundargoc/ci/gen_vimdoc/conda-edge-case
build(gen_vimdoc): handle conda edge case when parsing doxygen version
2022-05-02 06:24:54 -04:00
40864126d5 fix(mac): add CoreServices to flake.nix #18358
The `include` was added in e038625b87
2022-05-02 03:17:38 -07:00
59162584b1 build(gen_vimdoc): print user's doxygen version if it's too old
@theHamsta suggested in
https://github.com/neovim/neovim/pull/18348#discussion_r862594173 to
also print the users doxygen version if the version is too old.
2022-05-02 11:17:06 +02:00
327a6d885c vim-patch:8.2.1835: ":help ??" finds the "!!" tag (#18350)
* vim-patch:8.2.1835: ":help ??" finds the "!!" tag

Problem:    ":help ??" finds the "!!" tag.
Solution:   Do not translate "?" into ".".  (Naruhiko Nishino, closes vim/vim#7114,
            closes vim/vim#7115)
6eb36ade98

Change test because patch 8.2.1794 hasn't been ported yet.
2022-05-02 17:01:40 +08:00
649cdc14ba ci(gen_vimdoc): handle edge case when checking doxygen version
When checking the version of the doxygen installed from conda the output
has the following format:

1.9.2 (ee54ebd4f0ad83d9c44f19a459146de64d0ffba2*)

This would cause an error in the "Missing API docs" CI job. This fix
will correctly parse the doxygen version for both stable releases
("1.9.2") as well as the version with the git commit hash attached.
2022-05-02 10:58:40 +02:00
1e970c003f vim-patch:8.2.3306: unexpected "No matching autocommands" (#17912)
Problem:    Unexpected "No matching autocommands".
Solution:   Do not give the message when aborting.  Mention the arguments in
            the message. (closes vim/vim#8690)
1b154ea121
2022-05-02 16:39:05 +08:00
a23440bf7c Merge pull request #18354 from famiu/feat/api/parse_cmd
fix(api): make `nvim_parse_cmd` preserve command modifiers
2022-05-02 08:27:20 +02:00
bfb72f637b fix(api): preserve cmdmod on nvim_parse_cmd 2022-05-02 11:46:24 +06:00
371dfb1746 Merge pull request #18294 from mhinz/mac/simpler-locale-fallback
fix(mac): use same $LANG fallback mechanism as Vim
2022-05-01 19:15:11 -04:00
c04b979331 Merge pull request #18348 from dundargoc/build/abort-if-old-doxygen
build(gen_vimdoc): abort if doxygen version is too old
2022-05-01 18:47:43 -04:00
069da468d5 fix(shared): avoid indexing unindexable values in vim.tbl_get() (#18337) 2022-05-01 21:08:05 +02:00
5fc251daeb build(gen_vimdoc): abort if doxygen version is too old
There have been a few instances where developers got confused as to why
their generated documentation differs from the one generated by the CI.
More often than not, the reason is that their doxygen version is older
than 1.9.0, which is the current minimum version. Having a simple
version check will help save future developers avoid this problem.
2022-05-01 18:05:12 +02:00
651b595271 build: bump msgpack to 4.0.0
see https://github.com/msgpack/msgpack-c/releases/tag/c-4.0.0
2022-05-01 13:40:10 +02:00
65b4bf055f docs: syntax is enabled by default (#17637)
`:syntax enable` is no longer necessary (and may even be harmful). Do not recommend it in `usr_05.txt` and `usr_06.txt`, and mention the new default in `syntax.txt`.
2022-05-01 13:31:49 +02:00
d9dcfd0219 Merge pull request #18334 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-05-01 10:35:48 +02:00
07660193a3 chore(editorconfig): unset "charset" for *.vim and *.po files
There  are *.vim and *.po files ported from Vim that use a non-UTF-8 encoding.
2022-05-01 12:57:55 +08:00
7502f1cae0 docs(api): more API attributes #18336 2022-04-30 16:16:16 -07:00
7e10b0dae6 docs: move "hl-VertSplit" to deprecated.txt #18328 2022-04-30 15:23:30 -07:00
af782a6306 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-30 23:39:17 +02:00
039d60bd9c fix(lsp): fix infinite loop in resolved_capabilities deprecation message (#18333)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-04-30 23:22:47 +02:00
0344736aa6 fix(lsp): handle textDocumentSync.save bool capability (#18332)
Follow up to https://github.com/neovim/neovim/pull/17814
2022-04-30 22:13:26 +02:00
cc27540560 Merge pull request #18231 from famiu/feat/api/parse_cmdline
feat(api): `nvim_parse_cmd`
2022-04-30 18:41:17 +02:00
872622bcdb vim-patch:8.2.4849: Gleam filetype not detected (#18326)
Problem:    Gleam filetype not detected.
Solution:   Add a pattern for Gleam files. (Mathias Jean Johansen,
            closes vim/vim#10326)
917c32c4f7
2022-04-30 17:31:53 +02:00
88411613e2 feat(lsp): add async option to vim.lsp.buf.format (#18322)
Deprecates the existing `vim.lsp.buf.formatting` function.
With this, `vim.lsp.buf.format` will replace all three:

- vim.lsp.buf.formatting
- vim.lsp.buf.formatting_sync
- vim.lsp.buf.formatting_seq_sync
2022-04-30 17:23:50 +02:00
338b903219 Merge pull request #18323 from zeertzjq/vim-8.1.2191
vim-patch:8.1.2191,8.2.4848: mappings for completion keys not ignored
2022-04-30 23:09:58 +08:00
8dbb11ebf6 feat(api): add nvim_parse_cmdline
Adds an API function to parse a command line string and get command information from it.
2022-04-30 21:04:51 +06:00
3c23100130 refactor: replace char_u variables and functions with char (#18288)
Work on https://github.com/neovim/neovim/issues/459
2022-04-30 16:48:00 +02:00
0b12f6d7be vim-patch:8.2.4848: local completion with mappings and simplification not working
Problem:    Local completion with mappings and simplification not working.
Solution:   Fix local completion <C-N>/<C-P> mappings not ignored if keys are
            not simplified. (closes vim/vim#10323)
ee44603069
2022-04-30 22:27:27 +08:00
db355ca4e5 vim-patch:8.1.2191: when using modifyOtherKeys CTRL-X mode may not work
Problem:    When using modifyOtherKeys CTRL-X mode may not work.
Solution:   Recognize a control character also in the form with a modifier.
88d3d09e07
2022-04-30 22:27:27 +08:00
fcdf24d8be fix(tui): disable extended keys before exiting alternate screen (#18318) 2022-04-30 22:18:14 +08:00
5b04e46d23 feat(lsp): add vim.lsp.buf.format (#18193) 2022-04-30 15:36:40 +02:00
eecc6535eb fix(handlers): more specific error messages (#16772)
Specify which message, or request, was last received in case of an error
instead of the same generic message
2022-04-30 13:55:26 +02:00
c618b314c6 chore(lsp): remove capabilities sanitization (#17814)
* feat(lsp)!: remove capabilities sanitization

Users must now access client.server_capabilities which matches the same
structure as the protocol.

https://microsoft.github.io/language-server-protocol/specification

client.resolved_capabilities is no longer used to gate capabilities, and
will be removed in a future release.

BREAKING CHANGE


Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2022-04-30 11:22:30 +02:00
df09e03cf7 feat(lsp): options to filter and auto-apply code actions (#18221)
Implement two new options to vim.lsp.buf.code_action():
 - filter (function): predicate taking an Action as input, and returning
   a boolean.
 - apply (boolean): when set to true, and there is just one remaining
   action (after filtering), the action is applied without user query.

These options can, for example, be used to filter out, and automatically
apply, the action indicated by the server to be preferred:

    vim.lsp.buf.code_action({
        filter = function(action)
            return action.isPreferred
        end,
        apply = true,
    })

Fix #17514.
2022-04-30 10:14:31 +02:00
de2232878f vim-patch:8.2.0144: some mapping code is not fully tested (#18313)
Problem:    Some mapping code is not fully tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5519)
c2a60ae10e
2022-04-30 14:00:53 +08:00
2ba539f449 fix(input): only disable mapped CTRL-C interrupts when getting input (#18310) 2022-04-30 13:11:35 +08:00
7df25a1372 Merge pull request #18309 from zeertzjq/vim-8.2.4845
vim-patch:8.2.{4844,4845,4846}
2022-04-30 07:04:53 +08:00
1f72e31550 vim-patch:8.2.4845: duplicate code
Problem:    Duplicate code.
Solution:   Move code below if/else. (closes vim/vim#10314)
590f365f91

N/A patches for version.c:

vim-patch:8.2.4844: <C-S-I> is simplified to <S-Tab>

Problem:    <C-S-I> is simplified to <S-Tab>.
Solution:   Do not simplify CTRL if there is also SHIFT. (closes vim/vim#10313)
758a8d1999

vim-patch:8.2.4846: termcodes test fails

Problem:    Termcodes test fails.
Solution:   use CTRL-SHIFT-V to insert an unsimplified key. (closes vim/vim#10316)
bad8a013c2
2022-04-30 06:07:00 +08:00
02e9a402ca test: add test for <Cmd> mapping with character containing K_SPECIAL byte 2022-04-30 06:06:11 +08:00
9a1920e223 feat(lsp): show feedback on empty hover response (#18308)
Without any feedback it gives the impression that the language server is
not working properly, which isn't the case.
2022-04-29 23:04:00 +02:00
6d4180a0d2 Merge pull request #18162 from dundargoc/refactor/unctustify
refactor/uncrustify
2022-04-29 19:33:05 +02:00
d5dc3dad80 Merge pull request #18305 from zeertzjq/mapping-rhs
feat(mappings): do not simplify the rhs of a mapping
2022-04-29 22:10:25 +08:00
7ac5359143 feat(mappings): do not simplify the rhs of a mapping 2022-04-29 21:12:48 +08:00
98f62a2cfa feat(mappings): allow special keys and modifiers in <Cmd> mapping 2022-04-29 21:12:48 +08:00
eef8de4df0 refactor(uncrustify): change rules to better align with the style guide
Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
2022-04-29 14:13:06 +02:00
0b3ae64480 refactor(uncrustify): format all c code under /src/nvim/ 2022-04-29 13:52:43 +02:00
995c186368 refactor(uncrustify): disable formatting in problematic code sections 2022-04-29 13:52:12 +02:00
8c548c9e54 Merge pull request #18301 from zeertzjq/fix-lua-unmap-crash
fix(mappings): fix double-free when unmapping simplifiable Lua mapping
2022-04-29 18:09:25 +08:00
c8e45366b9 fix(mappings): fix double-free when unmapping simplifiable Lua mapping 2022-04-29 17:39:24 +08:00
35a7b0f9b9 Merge pull request #17932 from zeertzjq/vim-8.1.2145
vim-patch:8.1.{2145,2159,2165,2167,2333,2346,2350},8.2.{0839,0851,0855,0867,0916,0919,2084,2728,3595,4504,4819,4824,4827,4828,4829,4833,4837}
2022-04-29 17:13:28 +08:00
c671822d4d ci: remove mjlbach from reviewers (#18297) 2022-04-29 10:48:12 +02:00
3601cef137 feat(mappings): do not replace existing mapping for simplified form 2022-04-29 15:51:04 +08:00
4adf2123dd vim-patch:8.2.4837: modifiers not simplified when timed out
Problem:    Modifiers not simplified when timed out or using feedkeys() with
            'n" flag.
Solution:   Adjust how mapped flag and timeout are used. (closes vim/vim#10305)
68a573ce2b
2022-04-29 15:51:04 +08:00
1d97781dc5 vim-patch:8.2.4833: failure of mapping not checked for
Problem:    Failure of mapping not checked for.
Solution:   Check return value of ins_typebuf(). (closes vim/vim#10299)
12e21e387b
2022-04-29 15:51:04 +08:00
bf065d9bb6 vim-patch:8.2.4829: a key may be simplified to NUL
Problem:    A key may be simplified to NUL.
Solution:   Use K_ZERO instead.  Use macros instead of hard coded values.
            (closes vim/vim#10290)
17c95d9608
2022-04-29 15:51:04 +08:00
f2b512ad75 vim-patch:8.2.4828: fix for unmapping simplified key not fully tested
Problem:    Fix for unmapping simplified key not fully tested.
Solution:   Add a test case. (closes vim/vim#10292)
abeb09b2c5
2022-04-29 15:51:04 +08:00
11b5a376bc vim-patch:8.2.4827: typo in variable name
Problem:    Typo in variable name. (Gabriel Dupras)
Solution:   Rename the variable.
87f74106f9
2022-04-29 15:51:04 +08:00
e38cddc989 vim-patch:8.2.4824: expression is evaluated multiple times
Problem:    Expression is evaluated multiple times.
Solution:   Evaluate expression once and store the result. (closes vim/vim#10278)
23d5770ef5
2022-04-29 15:51:04 +08:00
c14d89f306 vim-patch:8.2.4819: unmapping simplified keys also deletes other mapping
Problem:    Unmapping simplified keys also deletes other mapping.
Solution:   Only unmap a mapping with m_simplified set. (closes vim/vim#10270)
a4e3332650
2022-04-29 15:51:04 +08:00
04a437b280 vim-patch:8.2.4504: when there is a partially matching map full map may not work
Problem:    When there is a partially matching map and modifyOtherKeys is
            active a full map may not work.
Solution:   Only simplify modifiers when there is no matching mapping.
            (closes vim/vim#8792)
196c3850db

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
096923e990 vim-patch:8.2.3595: check for signed overflow might not work everywhere
Problem:    Check for signed overflow might not work everywhere.
Solution:   Limit to 32 bit int. (closes vim/vim#9043, closes vim/vim#9067)
0d5a12ea04
2022-04-29 15:51:04 +08:00
4531ddaa62 vim-patch:8.2.2728: special key names don't work if 'isident' is cleared
Problem:    Special key names don't work if 'isident' is cleared.
Solution:   Add vim_isNormalIDc() and use it for special key names.
            (closes vim/vim#2389)
e3d1f4c982

Code is N/A as Nvim already has ascii_isident(), so just port the test.
2022-04-29 15:51:04 +08:00
78a7e2d55c vim-patch:8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Problem:    CTRL-R CTRL-R doesn't work with modifyOtherKeys.
Solution:   Allow key codes when fetching argument for CTRL-R. (closes vim/vim#5266)
            Also fix CTRL-G in Insert mode.
38571a04b4

Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
3090648584 test: revert test and doc changes from #6724, add a test for #6716
Multi-char 'pastetoggle' now works without breaking character-find.
2022-04-29 15:51:04 +08:00
9660ddd512 vim-patch:8.2.0919: merging modifier for modifyOtherKeys is done twice
Problem:    Merging modifier for modifyOtherKeys is done twice.
Solution:   Remove the merging done in vgetc().
673fc3e23f

Omit ex_getln.c change as it was removed in patch 8.2.2084, so
no_reduce_keys is still not needed in Nvim.
2022-04-29 15:51:04 +08:00
32da3e56cd vim-patch:8.2.0916: mapping with partly modifyOtherKeys code does not work
Problem:    Mapping with partly modifyOtherKeys code does not work.
Solution:   If there is no mapping with a separate modifier include the
            modifier in the key and then try mapping again. (closes vim/vim#6200)
975a880a13

Cherry-pick applicable part of put_string_in_typebuf().
Revert related changes from 10a5825.
Use KEYLEN_PART_KEY for incomplete modifier sequence.
Omit test as it sends terminal codes. Use a Lua test instead.
2022-04-29 15:51:04 +08:00
f6afc7c324 revert: "refactor: Remove allow_keys global (#6346)" 2022-04-29 15:51:04 +08:00
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
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
6832b626ea vim-patch:8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Problem:    Can't distinguish <M-a> from accented "a" in the GUI.
Solution:   Use another way to make mapping <C-bslash> work. (closes vim/vim#6163)
f4ae6b245a
2022-04-29 15:51:04 +08:00
66747f18de vim-patch:8.2.0839: dropping modifier when putting a character back in typeahead
Problem:    Dropping modifier when putting a character back in typeahead.
Solution:   Add modifier to ins_char_typebuf(). (closes vim/vim#6158)
b42c0d5427

Vim's test doesn't seem to work properly as the hit-enter prompt seems
to be delayed. Add a Lua screen test.
2022-04-29 15:51:04 +08:00
82a13a78bb vim-patch:partial:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

This only includes the "lhs" value part.
2022-04-29 15:51:04 +08:00
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
44269c73a3 vim-patch:8.1.2167: mapping test fails on MS-Windows
Problem:    Mapping test fails on MS-Windows.
Solution:   Remove all the existing Insert-mode mappings.
2559a47823
2022-04-29 15:51:03 +08:00
b5837e55e6 vim-patch:8.1.2165: mapping test fails on Mac
Problem:    Mapping test fails on Mac.
Solution:   Remove the default Mac mapping.
4f2f61a014
2022-04-29 15:51:03 +08:00
c3634a0261 vim-patch:8.1.2159: some mappings are listed twice
Problem:    Some mappings are listed twice.
Solution:   Skip mappings duplicated for modifyOtherKeys. (closes vim/vim#5064)
fafb4b18cd
2022-04-29 15:51:03 +08:00
7029b4b44a feat(input): delay all simplifications
Avoid unsimplfied Ctrl-C in input buffer when it is not mapped.
2022-04-29 15:51:03 +08:00
68ddbdd03b test(old): revert changes from ed88ca7503
Copy test_regex_char_classes.vim from upstream to avoid future encoding
problems.
2022-04-29 15:51:03 +08:00
dde4f09f51 vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Problem:    Cannot map <C-H> when modifyOtherKeys is enabled.
Solution:   Add the <C-H> mapping twice, both with modifier and as 0x08.  Use
            only the first one when modifyOtherKeys has been detected.
459fd785e4

Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of
"special" is different between Vim and Nvim.
Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs.
Omit tests as they send terminal codes.
Keep the behavior of API functions.
2022-04-29 15:51:03 +08:00
e038625b87 fix(mac): use same $LANG fallback mechanism as Vim
In a locale "en_US", "en" is the language and "US" is the region.

Before this change, we were too clever for our own good and tried to handle the
region as well. But if the macOS primary language is set to "English" and the
region to "Norway", we would end up with "en_NO", which is a locale that does
not exist.

Now we only take the language into account. Taking the example from above would
yield "en_US", which is a sensible fallback.

If the region is important to you, set $LANG and the more specific LC_*
variables in your shell config or alternatively use `:help :language`.

References https://github.com/neovim/neovim/issues/18292
2022-04-28 23:36:12 +02:00
188537efb3 fix: suppress "is a directory" messages with shortmess 'F' (#18296)
When 'F' is in 'shortmess', don't show messages when editing a
directory. This fixes a regression introduced by 0956283.
2022-04-28 15:27:34 -06:00
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
ee85d8d756 Merge pull request #18254 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-27 13:37:56 +02:00
8e20c04fa0 refactor: enable -Wconversion warning for ex_docmd.c (#18277)
* refactor: enable -Wconversion warning for ex_docmd.c

Work on https://github.com/neovim/neovim/issues/567
2022-04-27 13:35:56 +02:00
0d41c4dee1 refactor(build): remove unused includes #17078
Remove unused includes in src/nvim/buffer.c|h using the IWYU library.
Yet another step towards #6371 and #549
2022-04-26 21:38:12 -07:00
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
3933592338 fix: has() should preserve v:shell_error #18280
fixes #18278
2022-04-26 20:58:25 -07:00
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
39d149752f fix(build): missing definitions for sizeof macros #16393
Verified with -Wundef

Fixes #16392
2022-04-26 19:41:11 -07:00
f3e99e691d Merge pull request #18260 from dundargoc/refactor/enable-conversion-warning
refactor: enable -Wconversion warning for funcs.c and userfuncs.c
2022-04-26 19:57:02 +02:00
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
909dbbbd4b refactor: enable -Wconversion warning for funcs.c and userfuncs.c
Work on https://github.com/neovim/neovim/issues/567
2022-04-26 10:43:37 +02:00
a75efc237d Merge pull request #18267 from zeertzjq/test-eq-arg-order
test: correct order of arguments to eq() and neq()
2022-04-26 12:20:19 +08:00
519e4c4472 test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
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
d7a7315957 Merge pull request #18249 from zeertzjq/vim-8.2.4760
vim-patch:8.2.{4760,4765}: matchfuzzy() limit
2022-04-26 08:38:21 +08:00
13e54f7130 vim-patch:8.2.4765: function matchfuzzy() sorts too many items
Problem:    Function matchfuzzy() sorts too many items.
Solution:   Only put matches in the array. (Yegappan Lakshmanan,
            closes vim/vim#10208)
047a7019b2
2022-04-26 08:06:33 +08:00
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
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
35aa072647 Merge pull request #18257 from dundargoc/refactor/enable-conversion-warning/tag
refactor: enable Wconversion warning for tag
2022-04-25 18:59:20 +02:00
4d092af32d refactor: enable Wconversion warning for tag
Work on https://github.com/neovim/neovim/issues/567
2022-04-25 18:12:27 +02:00
f765c30b38 Merge pull request #18255 from bfredl/workaround_version
fix(ci): workaround bug in msgpackparse() on windows caused by api level bump
2022-04-25 17:29:54 +02:00
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
10693a9e8a fix(ci): workaround bug in msgpackparse() on windows caused by api level bump 2022-04-25 16:30:20 +02:00
4aae0eebb2 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-25 13:32:01 +02:00
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
89df042a89 Merge pull request #18234 from zeertzjq/cursearch-reduce-redraw
perf: only redraw for CurSearch when it is currently in use
2022-04-25 10:53:54 +08:00
0648100fed refactor: convert macros to all-caps (#17895)
Closes https://github.com/neovim/neovim/issues/6297
2022-04-24 20:18:43 -06:00
7813fa2f8c refactor: enable Wconversion warning for diff (#18094)
Work on https://github.com/neovim/neovim/issues/567
2022-04-24 20:13:59 -06:00
cf2d77763f Merge pull request #18110 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
2022-04-24 20:13:23 -06:00
c582194135 refactor: add pure attribute to pure functions (#18165)
This will allow the compilers that support the pure attribute to make
further optimizations.
2022-04-24 20:12:47 -06:00
38ee2a41df perf: only redraw for CurSearch when it is currently in use
The check in redraw_for_cursorline() is not needed because VALID_VIRTCOL
is always cleared when the cursor moves to another line, so the check in
redraw_for_cursorcolumn() is enough.
2022-04-25 09:57:26 +08:00
933274c438 fix/PVS #17863
* fix(PVS/V002): disable rule completely

V002: "Some diagnostic messages may contain incorrect line number in
this file." This particular check seems unreliable. It says on their
website https://pvs-studio.com/en/docs/warnings/v002/ that this warning
occurs when there are multiline pragmas, but there are none in
extmark.c.

* fix(PVS/V756): ignore "counter is not used inside a nested loop" warning

The nested loop starts with "AutoCmd *ac = ap->cmds" so "ap" is
definitely used.

* fix(PVS/V560): disable "a part of conditional expression is always true"

* fix(PVS/V614): potentially uninitialized variable 'blen' used
2022-04-24 18:51:22 -07:00
68d27e156c build: bump Doxyfile to minimum required version 1.9.0 #18118 2022-04-24 18:50:42 -07:00
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
ac3794c351 ci: label all markdown edits as "documentation" #18120 2022-04-24 18:40:13 -07:00
aede28ab3b fix(packaging): remove excess forward slash in Wix Patch (#18121) 2022-04-24 17:53:09 -07:00
4cf1bcf183 Merge pull request #18248 from zeertzjq/vim-8.2.4806
vim-patch:8.2.{4806,4818}: a mapping using <LeftDrag> does not start Select mode
2022-04-25 07:52:35 +08:00
48a35106ef vim-patch:8.2.4818: no test for what 8.2.4806 fixes
Problem:    No test for what 8.2.4806 fixes.
Solution:   Add a test. (closes vim/vim#10727)
ac92ab7719

Test cannot be used because it must use test_setmouse(). Use a Lua test.
2022-04-25 07:23:24 +08:00
c8fe8c5ea4 vim-patch:8.2.4806: a mapping using <LeftDrag> does not start Select mode
Problem:    A mapping using <LeftDrag> does not start Select mode.
Solution:   When checking for starting select mode with the mouse also do this
            when there is typeahead. (closes vim/vim#10249)
53ef573148
2022-04-25 07:23:23 +08:00
2caf5bbbc5 Merge pull request #18243 from zeertzjq/vim-8.2.4808
vim-patch:8.2.{4808,4810,4813}: pasting text while indent folding may mess up folds
2022-04-24 22:21:54 +08:00
2511f3e76d vim-patch:8.2.4813: pasting text while indent folding may mess up folds
Problem:    Pasting text while indent folding may mess up folds.
Solution:   Adjust the way folds are split. (Brandon Simmons, closes vim/vim#10254)
2c40707baa
2022-04-24 21:49:47 +08:00
3e41e7d9c1 vim-patch:8.2.4810: missing changes in one file
Problem:    Missing changes in one file.
Solution:   Also change the struct initializers.
56dba60216
2022-04-24 21:47:57 +08:00
321db867d5 vim-patch:8.2.4808: unused item in engine struct
Problem:    Unused item in engine struct.
Solution:   Remove "expr".  Add comment with tags.
33d3ce640c
2022-04-24 21:47:25 +08:00
843d9223a1 build(clang-format): align with project style #18192 2022-04-23 20:48:38 -07:00
92f7286377 docs: make docstring consistent with parameters #18178
Closes: https://github.com/neovim/neovim/issues/12691
2022-04-23 17:01:01 -07:00
cfaf7440fc ci(backport): remove triggering by comment (#18210)
Triggering by comment is not needed. Applying the label is enough to
trigger the backport action.
2022-04-23 14:26:42 -07:00
d3df415228 Merge pull request #18197 from dundargoc/build/clint/python3
build/clint/python3
2022-04-23 14:06:50 -06:00
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
a98cf154ed Merge pull request #18226 from zeertzjq/vim-8.2.4805
vim-patch:8.2.{4805,4812}: CurSearch used for all matches in current line
2022-04-23 19:51:32 +08:00
79ab277011 vim-patch:8.2.4812: unused struct item
Problem:    Unused struct item.
Solution:   Remove "lines" match_T.  Simplify the code. (closes vim/vim#10256)
8279cfe499
2022-04-23 19:25:51 +08:00
8db55aedb5 vim-patch:8.2.4805: CurSearch used for all matches in current line
Problem:    CurSearch used for all matches in current line.
Solution:   Don't use the non-zero line count. (closes vim/vim#10247)
9b36750640
2022-04-23 19:24:47 +08:00
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
116a3f4683 fix(treesitter): create new parser if language is not the same as cached parser (#18149) 2022-04-22 16:15:28 +02:00
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
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
64784dccb5 chore: update inspect.lua to 3.1.3 2022-04-21 16:23:10 +02:00
28fb40b16f refactor(normal): fix most clint warnings (#18196) 2022-04-21 14:06:23 +01:00
af5a7a0582 Merge pull request #18209 from zeertzjq/vim-8.2.4759
vim-patch:8.2.4759: CurSearch highlight does not work for multi-line match
2022-04-21 20:44:15 +08:00
4b19f94c28 vim-patch:8.2.4759: CurSearch highlight does not work for multi-line match
Problem:    CurSearch highlight does not work for multi-line match.
Solution:   Check cursor position before adjusting columns. (closes vim/vim#10133)
693ccd1160
2022-04-21 20:19:58 +08:00
e6dec30332 Merge pull request #18182 from zeertzjq/vim-8.2.2472
vim-patch:8.1.1756,8.2.{2472,2474,2475,2476,2477,4791,4802}: autocommand fixes
2022-04-21 19:43:09 +08:00
5e9afca1c1 vim-patch:8.2.4802: test is not cleaned up
Problem:    Test is not cleaned up.
Solution:   Make test clean up after itself.  Avoid NUL. (closes vim/vim#10233)
7851c69a12

Adapt test_autocmd_vimgrep() to Nvim.
2022-04-21 19:07:50 +08:00
e69cb86750 test: add a Lua functional test for NoName buffer event order 2022-04-21 19:07:50 +08:00
f531fb97ff vim-patch:8.2.4791: events triggered in different order when reusing buffer
Problem:    Autocmd events triggered in different order when reusing an empty
            buffer.
Solution:   Call buff_freeall() earlier. (Charlie Groves, closes vim/vim#10198)
fef4485ef5

Test failure becomes very strange.
2022-04-21 19:07:50 +08:00
69fc23ed98 vim-patch:8.2.2477: autocommand tests hang on MS-Windows
Problem:    Autocommand tests hang on MS-Windows.
Solution:   Skip a couple of tests.  Fix file name.
dd07c02232
2022-04-21 19:07:50 +08:00
1664e3d4bc vim-patch:8.2.2476: using freed memory when splitting window while closing buffer
Problem:    Using freed memory when using an autocommand to split a window
            while a buffer is being closed.
Solution:   Disallow splitting when the buffer has b_locked_split set.
983d83ff1c

Put the error message in window.c.
Cherry-pick a memory leak fix from Vim patch 8.2.0399.
Test still fails.
2022-04-21 19:07:50 +08:00
407be5975d vim-patch:8.2.2475: autocommand tests hangs on MS-Windows
Problem:    Autocommand tests hangs on MS-Windows.
Solution:   Skip one test.
dfc3db76b9
2022-04-21 19:07:50 +08:00
69ac382a28 vim-patch:8.2.2474: using freed memory when window is closed by autocommand
Problem:    Using freed memory when window is closed by autocommand.
            (houyunsong)
Solution:   Check the window pointer is still valid.
2c7080bf1c

Add missing comment from Vim patch 8.0.1420.
Test fails.
2022-04-21 19:07:50 +08:00
fa15f2f938 vim-patch:8.2.2472: crash when using command line window in an autocommand
Problem:    Crash when using command line window in an autocommand.
            (houyunsong)
Solution:   Save and restore au_new_curbuf.
aad5f9d79a

Nvim has removed :open, so use :edit in the test instead.
2022-04-21 19:07:50 +08:00
9b10b4cc64 vim-patch:8.1.1756: autocommand that splits window messes up window layout
Problem:    Autocommand that splits window messes up window layout.
Solution:   Disallow splitting a window while closing one.  In ":all" give an
            error when moving a window will not work.
1417c766f5

Expected error number was changed to E242 in Vim in patch 8.2.1183, and
patch 8.2.2420 (which has already been ported) made the test no longer
throw E249 in Vim, so just use E242 in the test.
2022-04-21 19:06:50 +08:00
5c4ec25478 Merge pull request #18200 from atusy/doc-vim-keymap-set
docs: vim.keymap.set can specify buffer as an option
2022-04-21 17:31:40 +08:00
5ecbbba6ee docs: vim.keymap.set can specify buffer as an option 2022-04-21 10:45:39 +09:00
db851cb105 Merge pull request #18199 from zeertzjq/vim-8.2.4797
vim-patch:8.2.4797: getwininfo() may get oudated values
2022-04-21 08:06:18 +08:00
a4b75010ba Merge pull request #18180 from zeertzjq/vim-8.2.4792
vim-patch:8.2.{0358,4792,4794}: indent operator creates an undo entry for every line
2022-04-21 07:50:02 +08:00
f9c8ba0b85 vim-patch:8.2.4794: compiler warning for not initialized variable
Problem:    Compiler warning for not initialized variable.
Solution:   Initialize the variable. (John Marriott)
4c84dd33ad
2022-04-21 07:24:50 +08:00
f8b832b171 vim-patch:8.2.4792: indent operator creates an undo entry for every line
Problem:    Indent operator creates an undo entry for every line.
Solution:   Create one undo entry for all lines. (closes vim/vim#10227)
e468698994
2022-04-21 07:24:50 +08:00
c72857d396 vim-patch:8.2.0358: insufficient testing for indent.c
Problem:    Insufficient testing for indent.c.
Solution:   Add indent tests. (Yegappan Lakshmanan, closes vim/vim#5736)
bd7206e02c

Cherry-pick Test_ex_mode() changes from Vim patches 8.2.{0342,0347}.
Reorder test_expand_func.vim to match upstream.
2022-04-21 07:24:47 +08:00
87e1693ba6 vim-patch:8.2.4797: getwininfo() may get oudated values
Problem:    getwininfo() may get oudated values.
Solution:   Make sure w_botline is up-to-date. (closes vim/vim#10226)
8530b41fd3

Correct test order and add a modeline in test_bufwintabinfo.vim.
2022-04-21 07:09:42 +08:00
c6dcc6acd8 Merge pull request #18189 from zeertzjq/vim-8.2.4795
vim-patch:8.2.{4795,4796,4801}: 'cursorbind' scrolling depends on whether 'cursorline' is set
2022-04-21 06:57:13 +08:00
61eca90f65 Merge pull request #18187 from zeertzjq/vim-8.2.4724
vim-patch:8.2.4724: current instance of last search pattern not easily spotted
2022-04-21 06:55:28 +08:00
8145357974 vim-patch:8.2.4724: current instance of last search pattern not easily spotted
Problem:    Current instance of last search pattern not easily spotted.
Solution:   Add CurSearch highlighting. (closes vim/vim#10133)
a43993897a

This fixes CurSearch highlight for multiline match.
Omit screen redrawing code because Nvim redraws CurSearch differently.
2022-04-21 06:24:11 +08:00
94f12e8a59 vim-patch:8.2.4801: fix for cursorbind fix not fully tested
Problem:    Fix for cursorbind fix not fully tested.
Solution:   Add another test case. (Christian Brabandt, closes vim/vim#10240)
3fd7480cd2
2022-04-21 06:10:42 +08:00
4c5a2e8ebf vim-patch:8.2.4796: file left behind after running cursorline tests
Problem:    File left behind after running cursorline tests.
Solution:   Uncomment the line that deletes the file.
da1050cd6f
2022-04-21 06:10:42 +08:00
5600766b41 vim-patch:8.2.4795: 'cursorbind' scrolling depends on whether 'cursorline' is set
Problem:    'cursorbind' scrolling depends on whether 'cursorline' is set.
Solution:   Always call validate_cursor(). (Christian Brabandt, closes vim/vim#10230,
            closes vim/vim#10014)
2c645e8b00
2022-04-21 06:10:42 +08:00
92844b4499 build(clint): remove all python2-isms with pyupgrade
The script is functionally the same, just with some nicer syntactic
sugar thanks to only supporting python3.
2022-04-20 23:15:26 +02:00
df48b355d2 build(clint): change shebang to python3
There are distributions that doesn't symlink python to python3.
This will make clint work for these without any additional steps from
the user.
2022-04-20 23:01:15 +02:00
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
85b13f6db4 docs(filetype): proper example for did_load_filetypes (#18191) 2022-04-20 21:41:35 +02:00
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
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
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
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
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
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
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
245858460f Merge pull request #18157 from famiu/feat/undo!
feat: add `undo!`
2022-04-19 20:55:49 +02:00
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
dbc4af7186 Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
2022-04-19 18:56:51 +02:00
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
147cc60d24 fix(tui): update modifyOtherKeys reporting (#18158)
* Use the Eneks and Dseks terminfo attributes if they exist
* Add VTE versions below 0.54.0 to the blacklist
2022-04-18 20:03:26 -06:00
d3121f1e63 Merge pull request #18091 from dundargoc/refactor/pure-attribute
refactor: add pure attribute to pure functions
2022-04-18 21:40:14 +02:00
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
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
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
8973768a4e feat(api): add tests for setting terminal ui options 2022-04-17 11:41:56 +02:00
d63ad42e49 feat(api): ui options relevant for remote TUI 2022-04-17 11:41:56 +02:00
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
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
ae325e6274 Merge pull request #18139 from zeertzjq/vim-8.2.0791
vim-patch:8.2.0791
2022-04-17 10:42:06 +08:00
f823dce100 test: add a test for #18135 2022-04-17 10:13:47 +08:00
2116ff47ea vim-patch:8.2.0791: a second popup window with terminal causes trouble
Problem:    A second popup window with terminal causes trouble.
Solution:   Disallow opening a second terminal-popup window. (closes vim/vim#6101,
            closes vim/vim#6103) Avoid defaulting to an invalid line number.
b5383b174b

This is the only applicable hunk.
2022-04-17 10:12:50 +08:00
813ecdac79 fix(paste): ignore mappings in Cmdline mode (#18114) 2022-04-17 08:11:53 +08:00
dcf7bc4140 vim-patch:8.2.4762: using freed memory using synstack() and synID() in WinEnter (#18136)
Problem:    Using freed memory when using synstack() and synID() in WinEnter.
Solution:   Check using the syntax window. (closes vim/vim#10204)
ca7e86c237
2022-04-17 03:54:28 +08:00
88270a5735 refactor: add function xstrnsave
xstrnsave is a clone of vim_strnsave that uses char* instead of char_u*.
Its purpose short-term is to help reduce the number of casts and for
long-term to replace vim_strnsave as the need to use char_u is
eliminated.
2022-04-16 18:09:26 +02:00
7a2fcbbbec refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-04-16 13:07:35 +02:00
3f2e9298bd chore: remove vestigial sfname freeing (#18123)
This freeing is necessary in Vim since the alloc can fail. Since we're
using xcalloc, that's not possible and the freeing will never run.
2022-04-16 09:58:48 +08:00
08a144912c vim-patch:8.2.4752: wrong 'statusline' value can cause illegal memory access (#18117)
Problem:    Wrong 'statusline' value can cause illegal memory access.
Solution:   Properly check the value. (closes vim/vim#10192)
5dc294a7b6

Make two error messages static variables.
2022-04-15 21:21:51 +08:00
a8d5a9e819 version bump 2022-04-15 13:43:50 +02:00
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
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
4503cb6b64 vim-patch:8.2.4750: small pieces of dead code (#18113)
Problem:    Small pieces of dead code.
Solution:   Remove the dead code. (Goc Dundar, closes vim/vim#10190) Rename the
            qftf_cb struct member to avoid confusion.
b836658a04
2022-04-15 17:15:47 +08:00
6160973f36 fix(lsp): fix lookup of boolean values in workspace/configuration (#18026) 2022-04-15 11:12:41 +02:00
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
0fb571e3b5 refactor: add pure attribute to pure functions
This will allow compilers that support the pure attribute to make
further optimizations to functions.
2022-04-13 22:12:12 +02:00
a9cd9de01d Merge pull request #15972 from seandewar/vim-8.2.3487
vim-patch:8.2.{3416,3448,3470,3478,3480,3486,3487}
2022-04-13 20:50:44 +01:00
9a35704333 Merge pull request #15491 from Diomendius/lua_docs
docs(lua): fix, clarify Lua require() docs
2022-04-13 10:50:03 -06:00
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
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
e463eb8146 fix(api): correctly pass f-args for nvim_create_user_command (#18098)
Skip runs of whitespace and do not include `\` characters when
followed by another `\` or whitespace. This matches the behavior
of <f-args> when used with `:command`.
2022-04-13 08:04:56 -06:00
76e6b81b23 vim-patch:8.2.3487: illegal memory access if buffer name is very long
Problem:    Illegal memory access if buffer name is very long.
Solution:   Make sure not to go over the end of the buffer.
826bfe4bbd

Adjust the test to use :noswapfile, as Nvim fails to create the swap file on Windows due to the file
name's length (E303).

We don't have this behaviour on Linux as we get "[Permission denied]" from readfile(), so there is
no attempt to create the swap file. However, Vim doesn't try to create the swap file on Windows
either for a different reason: MAXPATHL in Vim for Windows is only 1024 (compared to Nvim's 4096 on
the Windows CI), so readfile() gives "Illegal file name" instead, thus not needing :noswapfile for
both cases.
2022-04-13 21:31:24 +08:00
fc954d0a61 vim-patch:8.2.3486: illegal memory access with invalid sequence of commands
Problem:    Illegal memory access with invalid sequence of commands.
Solution:   Do not call leave_block() when not in a try block. (closes vim/vim#8966)
            Reset did_emsg so that exception is shown as an error.
cce81e9673

Vim9script is N/A, which includes leave_block.
2022-04-13 21:28:05 +08:00
789558d365 vim-patch:8.2.3480: test does not fail without the fix for a crash
Problem:    Test does not fail without the fix for a crash.
Solution:   Write the bad code in a file and source it. (Dominique Pellé,
            closes vim/vim#8961)
949de97da3
2022-04-13 21:27:38 +08:00
5feb8cdbb4 vim-patch:8.2.3478: still crash with error in :catch and also in :finally
Problem:    Still crash with error in :catch and also in :finally.
Solution:   Only call finish_exception() once. (closes vim/vim#8954)
f67d3fb736

Exclude CSF_FUNC_DEF change (Vim9script).
2022-04-13 21:15:24 +08:00
6415051796 refactor(ex_eval): cherry-pick CSF flags changes from v8.2.3099
4197828dc6

Cherry-pick the changes to existing flags values.
Required for v8.2.3478.

That patch mostly relates to Vim9script, but I'm careful not to mark it N/A in
case the flags have some use outside of Vim9 in the future.

Excludes CSF_FUNC_DEF (flag introduced in v8.2.1870 for Vim9's block scopes).
2022-04-13 21:15:24 +08:00
a25c35d6e4 vim-patch:8.2.3470: crash with error in :catch and also in :finally
Problem:    Crash with error in :catch and also in :finally.
Solution:   Only discard an exception if there is one. (closes vim/vim#8954)
a684a68409
2022-04-13 21:15:24 +08:00
93c72d866b vim-patch:8.2.3448: :endtry after function call that throws not found
Problem:    :endtry after function call that throws not found.
Solution:   Do check for following :endtry if an exception is being thrown.
            (closes vim/vim#8889)
1d34189ecb

Nvim obsoleted did_throw; check current_exception is not NULL instead.
2022-04-13 21:15:24 +08:00
b6026337f2 vim-patch:8.2.3416: second error is reported while exception is being thrown
Problem:    Second error is reported while exception is being thrown.
Solution:   Do not check for trailing characters when already aborting.
            (closes vim/vim#8842)
36f691f5f1
2022-04-13 21:15:24 +08:00
4dc09f38ee fix(translation): po file for Ukrainian (#18100) 2022-04-13 10:25:59 +02:00
18152cf6f1 Merge pull request #18092 from zeertzjq/test-termxx-no-pending
test: unskip tests skipped in #14661
2022-04-13 05:29:23 +08:00
bc19ae4e11 test: unskip tests skipped in #14661 2022-04-13 05:04:14 +08:00
4bef2f02e8 Merge pull request #17440 from zeertzjq/vim-8.2.3184
vim-patch:8.2.{3184,3226,3325}: digraph functions
2022-04-12 21:54:01 +08:00
c9d1fcd850 refactor(digraph.c): add more const qualifiers 2022-04-12 21:26:46 +08:00
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
0a813ae291 vim-patch:8.2.3325: digraph test fails when LC_ALL is set to "C"
Problem:    Digraph test fails when LC_ALL is set to "C".
Solution:   When restoring 'encoding' set it to "utf-8". (closes vim/vim#8742)
52eb372a04
2022-04-12 21:26:46 +08:00
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
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
7e1e906738 vim-patch:8.2.4739: accessing freed memory after WinScrolled autocmd event (#18090)
Problem:    Accessing freed memory after WinScrolled autocmd event.
Solution:   Check the window pointer is still valid. (closes vim/vim#10156)
            Remove the argument from may_trigger_winscrolled().
d58862d18f
2022-04-12 19:16:47 +08:00
dbd5242d8e Merge pull request #18075 from zeertzjq/vim-8.2.4713
vim-patch:8.2.4713: plugins cannot track text scrolling
2022-04-12 05:48:23 +08:00
6be4fd888c test: properly test WinScrolled event 2022-04-12 05:02:05 +08:00
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
10b40440dd test(old): fix mistakes in porting Vim patches 8.1.1362 and 8.1.1585 (#18080) 2022-04-12 04:56:15 +08:00
85b33fc042 vim-patch:8.2.4737: // in JavaScript string recognized as comment (#18083)
Problem:    // in JavaScript string recognized as comment.
Solution:   Only check for linecomment if 'cindent' is set. (closes vim/vim#10151)
1655619717
2022-04-11 22:50:17 +02:00
392cb7ac0c fix(lsp): pass offset_encoding in formatexpr() (#18084) 2022-04-11 12:44:31 -07:00
da31e953b6 docs(term.txt): add documentation about TUI input (#18072) 2022-04-11 23:22:04 +08:00
96b461a000 refactor(packaging): Windows: improve MSI, remove NSIS #18069
- Removed NSIS installer.
  - Prevents undefined behaviour when two installations are performed to the same directory (NSIS + MSI).
  - Reduced cost of maintaining two installers that do the same thing.
  - Chose Wix MSI due to its better integration with Windows.
- Added Wix patch file to add neovim binaries to the system path during installation.
- Replaced neovim installer icons with better looking versions.
- Renamed neovim installer icons from logo.ico -> neovim.ico for all
  icons to better reflect contents.
2022-04-11 07:58:46 -07:00
356cff78ec vim-patch:8.2.4734: getcharpos() may change a mark position (#18077)
Problem:    getcharpos() may change a mark position.
Solution:   Copy the mark position. (closes vim/vim#10148)
3caf1cce2b
2022-04-11 21:29:18 +08:00
f0d07dcb74 Merge pull request #18067 from zeertzjq/vim-8.2.4714
vim-patch:8.2.{4714,4733}
2022-04-11 19:30:42 +08:00
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
18ed556bbd vim-patch:8.2.4714: using g:filetype_dat and g:filetype_src not tested
Problem:    Using g:filetype_dat and g:filetype_src not tested.
Solution:   Add a test. (Patrick Meiser-Knosowski, closes vim/vim#10117)
a8034a4886
2022-04-11 18:38:42 +08:00
8f95f3ea06 fix(vim-patch.sh): fix N/A files patterns (#18073) 2022-04-11 14:41:26 +08:00
f89ca7194f fix(events): make v:event readonly in more events (#18070)
This makes v:event readonly in these four events:
- ChanInfo
- ChanOpen
- RecordingLeave
- TermClose
2022-04-11 11:32:15 +08:00
cdfb045ea0 Merge pull request #18071 from gpanders/create_uc
refactor!: Rename nvim_add_user_command to nvim_create_user_command
2022-04-10 20:46:02 -06:00
379067d038 docs: update dev-api to include "create" 2022-04-10 20:45:17 -06:00
a2f157233f fix(tui)!: remove ESC NUL forced escape (#17198)
This make Nvim recognize `ESC NUL` as <M-C-Space>, as many terminal
emulators (including libvterm) send <M-C-Space> as `ESC NUL`.

There is already another unambiguous way to encode a `ESC` key supported
by libtermkey: `ESC [ 2 7 u`, which is a `CSI u` sequence.

If one still wants to use `ESC NUL` as `ESC`, they can just map
<M-C-Space> to <Esc>.
2022-04-11 10:23:33 +08:00
f94f75dc05 refactor!: rename nvim_add_user_command to nvim_create_user_command 2022-04-10 20:18:41 -06:00
9da0023a66 feat(keymap): add F38-F63 keys (#17893) 2022-04-11 09:54:59 +08:00
b2cb05b53e feat(events): support SIGWINCH for Signal event #18029
closes #15411
2022-04-10 15:56:08 -07:00
8bdcd832ae refactor(globals.h): avoid confusing comment placement (#18066)
These comments were indented in Vim, but their indent was removed in
Nvim, causing them to be placed in a confusing place.
2022-04-10 21:22:22 +08:00
8f3845cdb7 docs: remove mentions of removed flag '#' in 'cpoptions' (#18064) 2022-04-10 14:58:01 +02:00
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
b531e4ea33 Merge pull request #18062 from zeertzjq/vim-8.2.4723
vim-patch:8.2.{4723,4728}: the ModeChanged autocmd event is inefficient
2022-04-10 19:14:29 +08:00
381f8f86da vim-patch:8.2.4728: no test that v:event cannot be modified
Problem:    No test that v:event cannot be modified.
Solution:   Add a test. (closes vim/vim#10139)
021996ffaa
2022-04-10 18:45:16 +08:00
263a7fde35 vim-patch:8.2.4723: the ModeChanged autocmd event is inefficient
Problem:    The ModeChanged autocmd event is inefficient.
Solution:   Avoid allocating memory. (closes vim/vim#10134)  Rename
            trigger_modechanged() to may_trigger_modechanged().
2bf52dd065

Make v:event readonly for ModeChanged.
2022-04-10 08:02:22 +08:00
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
12662ac0c4 vim-patch:8.2.4722: ending recording with mapping records too much (#18060)
Problem:    When a recording is ended with a mapped key that key is also
            recorded.
Solution:   Remember the previous last_recorded_len. (closes vim/vim#10122)
81b46a6ccd
2022-04-10 06:45:27 +08:00
2a2c4e191f vim-patch:8.2.4718: @@@ in the last line sometimes drawn in the wrong place (#18055)
Problem:    @@@ in the last line sometimes drawn in the wrong place.
Solution:   Make sure the column is valid. (closes vim/vim#10130)
cee9c844f2
2022-04-10 04:50:49 +08:00
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
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
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
bf39c5fe4f vim-patch:8.2.4703: memory leak in handling 'cinscopedecls'
Problem:    Memory leak in handling 'cinscopedecls'.
Solution:   Free the memory before returning.
cb49a1d934
2022-04-09 15:39:48 +02:00
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
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
b259426a25 chore(packaging): use transparent windows logo (#18051) 2022-04-09 10:31:11 +02:00
fda9adab5d vim-patch:partial:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work (#18048)
Problem:    With modifyOtherKeys CTRL-^ doesn't work.
Solution:   Handle the exception.
828ffd5963
2022-04-09 13:31:42 +08:00
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
d3068d34cc vim-patch:partial:cbaff5e06ec5 (#18042)
Update runtime files
cbaff5e06e

omit doc updates here
2022-04-08 19:53:41 +02:00
b4ec6af12a Merge pull request #17971 from chentau/extmark_spell
fix(extmarks): splice extmarks on accepting spell
2022-04-08 19:09:48 +02:00
d3603e157a build(deps): bump LuaJIT to HEAD - 5e3c45c43 (#18027) 2022-04-08 16:59:40 +02:00
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
30bc02c636 feat(api)!: pass args table to autocommand callbacks 2022-04-08 15:12:54 +02:00
56ee7c29ab Merge pull request #18038 from zeertzjq/vim-8.2.4711
vim-patch:8.2.4711: when 'insermode' is set :edit from <Cmd> mapping misbehaves
2022-04-08 20:17:25 +08:00
b099bb1f2f test: add a test for #16823 2022-04-08 19:25:37 +08:00
38506553f7 vim-patch:8.2.4711: when 'insermode' is set :edit from <Cmd> mapping misbehaves
Problem:    When 'insermode' is set :edit from <Cmd> mapping misbehaves.
Solution:   Don't set "need_start_insertmode" when already in Insert mode.
            (closes vim/vim#10116)
3a56b6d405
2022-04-08 19:02:37 +08:00
2c7dc648ca vim-patch:8.2.3925: diff mode confused by NUL bytes (#18033)
Problem:    Diff mode confused by NUL bytes.
Solution:   Handle NUL bytes differently. (Christian Brabandt, closes vim/vim#9421,
            closes vim/vim#9418)
06f6095623
2022-04-08 10:45:42 +08:00
356baae80a vim-patch:8.2.4704: using "else" after return or break increases indent (#18032)
Problem:    Using "else" after return or break increases indent.
Solution:   Remove "else" and reduce indent. (Goc Dundar, closes vim/vim#10099)
f26c16144d
2022-04-08 10:25:22 +08:00
4c9a71c69e Merge pull request #18031 from zeertzjq/vim-8.2.0004
vim-patch:8.2.{0004,4700,4706}: buffer closing is interrupted
2022-04-08 10:23:55 +08:00
191f009ab7 vim-patch:8.2.4706: buffer remains active with WinClosed and tabpages
Problem:    Buffer remains active if a WinClosed event throws an exception
            when there are multiple tabpages.
Solution:   Ignore aborting() when closing the buffer. (closes vim/vim#10101)
6a06940f8a
2022-04-08 08:54:07 +08:00
b7bc931f63 vim-patch:8.2.4700: buffer remains active if WinClosed event throws an exception
Problem:    Buffer remains active if a WinClosed event throws an exception.
Solution:   Ignore aborting() when closing the buffer. (closes vim/vim#10097)
c947b9ae41
2022-04-08 08:54:07 +08:00
44b59d1a69 vim-patch:8.2.0004: get E685 and E931 if buffer reload is interrupted
Problem:    Get E685 and E931 if buffer reload is interrupted.
Solution:   Do not abort deleting a dummy buffer. (closes vim/vim#5361)
a6e8f888e7
2022-04-08 08:54:07 +08:00
8f3245dbfa refactor(window): cherry-pick win_close_buffer() from Vim patch 8.1.1391 2022-04-08 08:54:03 +08:00
65a5cea0d3 vim-patch:8.2.4710: smart indenting does not work after completion (#18030)
Problem:    Smart indenting does not work after completion.
Solution:   Set "can_si". (Christian Brabandt, closes vim/vim#10113, closes vim/vim#558)
ac72c21da6
2022-04-08 07:12:47 +08:00
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
0d2674a3c5 ci: add script to bump versions (#17884)
* ci: add script for bumping dependencies

* docs: add usage information for bump-deps.sh
2022-04-07 17:41:48 +02:00
1edca3872e vim-patch:8.2.4707: redrawing could be a bit more efficient (#18022)
Problem:    Redrawing could be a bit more efficient.
Solution:   Optimize redrawing. (closes vim/vim#10105)
8c97960850
2022-04-07 23:26:03 +08:00
abc157a6fd Merge pull request #18021 from zeertzjq/fix-clearing-reg-executing
Fix clearing of reg_executing
2022-04-07 22:40:01 +08:00
64802da6c4 fix(event-loop): check if executed register has ended 2022-04-07 21:42:11 +08:00
2a574f7aaa fix(input): fix clearing of reg_executing
vim-patch:8.2.4705
2022-04-07 21:42:07 +08:00
dc9e436986 Merge pull request #17979 from zeertzjq/autocmd-show-fix
fix(autocmd): restore autocmd showing behavior
2022-04-07 11:42:16 +02:00
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
233014f92b vim-patch:8.2.0836: not all :cdo output is visible (#18007)
Problem:    Not all :cdo output is visible.
Solution:   Reset 'shortmess' temporarily. (Yegappan Lakshmanan, closes vim/vim#6155)
14798ab9a5

Cherry pick relevant changes form patches 8.1.1826 and 8.2.0557.
2022-04-06 12:04:19 +08:00
74a27748e6 fix(autocmd): restore autocmd showing behavior 2022-04-06 05:44:30 +08:00
128bedc0d2 vim-patch:8.2.4696: delete() with "rf" argument does not report a failure (#18002)
Problem:    delete() with "rf" argument does not report a failure.
Solution:   Return -1 if the directory could not be removed. (closes vim/vim#10078)
478700336d
2022-04-06 05:12:49 +08:00
f86f74c12f Merge pull request #18003 from bfredl/incperf2
fix(ui): inccomand performance degradation
2022-04-05 21:23:27 +02:00
54cec455cc fix(ui): inccomand performance degradation
It was broken since the introduction of the macro.
2022-04-05 20:21:43 +02:00
402a71ff87 Merge pull request #17335 from famiu/fix/ui/win-resize
fix: Make window resize commands manage cmdheight
2022-04-05 19:34:06 +02:00
6dc31eea43 fix(tests): update legacy tab switch test to be sane 2022-04-05 16:50:11 +02:00
463174b5d7 fix(ui): make window resize commands manage cmdheight
Previously, the window resize commands did not resize the value of `cmdheight` when they caused a change in the topframe height, leaving a gap between the end of topframe and the start of the command line, this commit fixes that by making window resize commands automatically change the value of cmdheight if the resize affects the height of topframe.
2022-04-05 16:50:07 +02:00
969d600f2a vim-patch:8.2.{4692,4691,4690}: fix Insert mode <LeftDrag> mapping bug (#17999)
vim-patch:8.2.4692: no test for what 8.2.4691 fixes

Problem:    No test for what 8.2.4691 fixes.
Solution:   Add a test.  Use a more generic sotlution. (closes vim/vim#10090)
0f68e6c07a

Test cannot be used because it must use test_setmouse(). Use a Lua test.

Reverted patches:

vim-patch:8.2.4691: solution for <Cmd> in a mapping causes trouble

Problem:    Solution for <Cmd> in a mapping causes trouble.
Solution:   Use another solution: put back CTRL-O after reading the <Cmd>
            sequence.
ca9d8d2cb9

vim-patch:8.2.4689: using <Cmd> in a mapping does not work for mouse keys

Problem:    Using <Cmd> in a mapping does not work for mouse keys in Insert
            mode. (Sergey Vlasov)
Solution:   When reading the <Cmd> argument do not use the stuff buffer.
            (closes vim/vim#10080)
d0fb2d8041
2022-04-05 21:38:53 +08:00
e135adcb8c vim-patch:8.2.4687: "vimgrep /%v/ *" may cause a crash (#17995)
Problem:    "vimgrep /\%v/ *" may cause a crash.
Solution:   When compiling the pattern with the old engine fails, restore the
            regprog of the new engine instead of leaving it NULL.
            (closes vim/vim#10079)
e8a4c0d91f
2022-04-05 09:00:48 +08:00
b08cf73be9 refactor(pos.h): remove unused include; make formatting consistent (#17892)
- remove include of limit.h from pos.h, because it is no longer used
- make formatting more consistent in pos.h
2022-04-04 15:18:00 +08:00
c41e75039f test: move completion :stopinsert test to completion_spec.lua (#17992) 2022-04-04 14:53:47 +08:00
daa8ac051d Merge pull request #17991 from zeertzjq/vim-8.2.4253
vim-patch:8.2.4253: using freed memory when substitute with function call
2022-04-04 13:02:32 +08:00
bbfc44e255 refactor: pass "preview" to regtilde() 2022-04-04 12:11:38 +08:00
6486983117 vim-patch:8.2.4253: using freed memory when substitute with function call
Problem:    Using freed memory when substitute uses a recursive function call.
Solution:   Make a copy of the substitute text.
37f47958b8

'compatible' doesn't seem needed for the test.
2022-04-04 12:11:04 +08:00
db13f105d6 Merge pull request #17988 from zeertzjq/vim-8.2.4247
vim-patch:8.2.{4247,4258}: stack corruption when looking for spell suggestions
2022-04-04 11:11:37 +08:00
683648a396 vim-patch:8.2.4258: Coverity warns for array overrun
Problem:    Coverity warns for array overrun.
Solution:   Restrict depth to MAXWLEN - 1.
6970e1e36a
2022-04-04 09:37:40 +08:00
945caeeda2 vim-patch:8.2.4247: stack corruption when looking for spell suggestions
Problem:    Stack corruption when looking for spell suggestions.
Solution:   Prevent the depth increased too much.  Add a five second time
            limit to finding suggestions.
06f15416bb

Cherry-pick parentheses from patch 8.2.4402.
2022-04-04 09:37:40 +08:00
1f038bc592 test(old): fix test_spell.vim encoding 2022-04-04 09:37:40 +08:00
a973fa5b43 test(old): fix test_regexp_latin.vim encoding (#17989)
Cherry-pick a change from Vim patch 8.2.3982
2022-04-04 09:12:20 +08:00
4e0a825262 Merge pull request #17987 from leungbk/vim-patch-4402
vim-patch:8.2.{4639,4402}: missing parenthesis may cause unexpected problems
2022-04-04 07:54:34 +08:00
33909b6564 chore: update .git-blame-ignore-revs 2022-04-03 16:12:30 -07:00
69e11b58b4 vim-patch:8.2.4402: missing parenthesis may cause unexpected problems
Problem:    Missing parenthesis may cause unexpected problems.
Solution:   Add more parenthesis is macros.
ae6f1d8b14
2022-04-03 16:11:23 -07:00
271bb32855 vim-patch:8.2.4639: not sufficient parenthesis in preprocessor macros
Problem:    Not sufficient parenthesis in preprocessor macros.
Solution:   Add more parenthesis.
9dac9b1751
2022-04-03 15:57:07 -07:00
a93b55273f Merge pull request #17986 from zeertzjq/fix-ex-mode-regression
Fix regression with :normal and Ex mode from #14311
2022-04-04 06:13:42 +08:00
559dcf45a1 test: add some tests with :normal and Ex mode 2022-04-04 05:46:54 +08:00
9955209afb fix(substitute): properly check for empty command line 2022-04-04 05:46:45 +08:00
d73bf3138a vim-patch:8.2.4672: using :normal with Ex mode may make :substitute hang (#17983)
Problem:    Using :normal with Ex mode may make :substitute hang.
Solution:   When getting an empty line behave like 'q' was typed.
            (closes vim/vim#10070)
ce416b453a

Cherry-pick a comment from patch 8.2.0363.
2022-04-03 20:38:31 +08:00
e9e16655af [RFC] vim-patch:8.1.1378: delete() can not handle a file name that looks li… (#16268)
Problem:    Delete() can not handle a file name that looks like a pattern.
Solution:   Use readdir() instead of appending "/*" and expanding wildcards.
            (Ken Takata, closes vim/vim#4424, closes vim/vim#696)
701ff0a3e5

Cherry-pick a change to Test_delete_rf() from patch 8.1.1921.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-04-03 20:27:46 +08:00
6786b6afad vim-patch:8.1.1687: the evalfunc.c file is too big (#17949)
Problem:    The evalfunc.c file is too big.
Solution:   Move testing support to a separate file.
ecaa70ea29
2022-04-03 09:26:59 +08:00
a783cdd68d fix(ex_normal): spam \n in Ex mode only if in Cmdline mode (#17977)
When using :normal in Ex mode, the editor is no longer in Cmdline mode,
but the exmode_active flag is still set, causing the wrong character to
be spammed in Insert mode, leading to a hang.
2022-04-03 08:58:49 +08:00
ea71c26ec9 fix(extmarks): splice extmarks on accepting spell 2022-04-02 12:35:33 -04:00
2a46600140 docs(options): add more missing 'nofoo' tags (#17967) 2022-04-02 15:24:10 +02:00
e6bd9eee15 docs(options): add missing 'nofoo' tags (#17965) 2022-04-02 14:08:04 +02:00
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
af1b61f342 Merge pull request #17961 from zeertzjq/scroll-no-multiclick
fix(input): do not translate scroll keys into multiclicks
2022-04-02 12:47:40 +02:00
5499736380 fix(input): do not translate scroll keys into multiclicks 2022-04-02 16:18:18 +08:00
fce0d54eb2 Merge pull request #17953 from zeertzjq/vim-8.2.4660
vim-patch:8.2.4660: cursorcolumn is sometimes not correct
2022-04-01 20:37:45 +08:00
ef595e9b93 test: add a test for #13916 2022-04-01 20:14:01 +08:00
139828cc7e vim-patch:8.2.4660: cursorcolumn is sometimes not correct
Problem:    Cursorcolumn is sometimes not correct.
Solution:   Recompute the cursor column when entering Insert mode and the
            cursor is on a character wider than a screen cell.
782c6744b4
2022-04-01 19:53:40 +08:00
377e875211 Merge pull request #17948 from zeertzjq/vim-8.2.3471
vim-patch:8.2.{3471,3472,3489}: fix some crashes/errors with search
2022-04-01 17:43:31 +08:00
b9454d1676 vim-patch:8.2.3489: ml_get error after search with range
Problem:    ml_get error after search with range.
Solution:   Limit the line number to the buffer line count.
35a319b77f
2022-04-01 17:18:21 +08:00
b8fbd749a9 vim-patch:8.2.3472: other crashes with empty search pattern not tested
Problem:    Other crashes with empty search pattern not tested.
Solution:   Add a few more test lines. (Dominique Pellé)
9af9fd6ab6
2022-04-01 17:12:17 +08:00
649a11bc13 vim-patch:8.2.3471: crash when using CTRL-T after an empty search pattern
Problem:    Crash when using CTRL-T after an empty search pattern.
Solution:   Bail out when there is no previous search pattern. (closes vim/vim#8953)
d8d957de86
2022-04-01 17:11:56 +08:00
88a4ac22f0 Merge pull request #17946 from lewis6991/fixes
Quick review fixes for autocmds and keymaps
2022-04-01 10:44:58 +02:00
3cc29b7f0d fix(keymap): don't coerce false to '' 2022-04-01 09:09:30 +01:00
dc3bbd31a9 fix(api): delete all autocmds with the same ID 2022-04-01 08:38:58 +01:00
973e91007c refactor: remove redundant check for w_p_cole (#17944)
No longer needed after #17890.
2022-04-01 11:40:45 +08:00
8a6cf51a71 vim-patch:8.2.3122: with 'nowrap' cursor position is unexected in narrow window (#17935)
Problem:    With 'nowrap' cursor position is unexected in narrow window.
            (Leonid V.  Fedorenchik)
Solution:   Put cursor on the last non-empty line. (closes vim/vim#8525)
30441bb3d5
2022-04-01 07:11:38 +08:00
dc48330b9d Merge pull request #17842 from lewis6991/keymap
feat(keymap): return nil from an expr keymap
2022-04-01 00:48:46 +02:00
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
9d40b2fda9 refactor(api)!: use singular/plural consistently in the autocmd API 2022-03-31 23:58:47 +02:00
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
dbcb76bd7a Merge pull request #17888 from dundargoc/ci/remove-reviewers-when-drafting 2022-03-31 15:38:26 -04:00
68c0e90189 Merge pull request #17906 from dundargoc/test/skip-nvimlog-on-success 2022-03-31 15:36:18 -04:00
4a89812d85 Merge pull request #17929 from lewis6991/autocmd
fix(api): improve autocmd error handling
2022-03-31 19:28:06 +02:00
ebab51b192 docs(extmark): fix nvim_buf_get_extmarks example (#17934) 2022-03-31 18:05:17 +02:00
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
ea8ad79990 Merge pull request #17698 from tjdevries/nvim_clear_autocmd
api: nvim_clear_autocmd
2022-03-31 15:25:56 +02:00
929293815b fix(api): improve autocmd error handling
- nvim_del_augroup_* now works with pcall
- nvim_del_autocmd now errors for invalid ids
2022-03-31 14:23:53 +01:00
b80651eda9 feat(api): nvim_clear_autocmd
Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2022-03-31 14:30:42 +02:00
b2bd800416 Merge pull request #17890 from zeertzjq/conceal-virtcol-changed
perf: only redraw concealed line if cursor has moved horizontally
2022-03-31 10:56:15 +02:00
1184097261 Merge pull request #17925 from zeertzjq/vim-8.2.1844
vim-patch:8.2.{1844,2515,4156,4200,4577}: messages patches
2022-03-31 10:48:41 +08:00
86f81c471a vim-patch:8.2.4577: message test is flaky
Problem:    Message test is flaky. (Elimar Riesebieter)
Solution:   Trigger the autocommand event only after startup is finished.
9323ca51c2
2022-03-31 10:05:26 +08:00
5a3a1304e1 vim-patch:8.2.4200: some tests do not clean up properly
Problem:    Some tests do not clean up properly.
Solution:   Delete created files. (Yegappan Lakshmanan, closes vim/vim#9611)
7e765a39b7

Omit test_filetype.vim: already ported
Omit test_vim9_import.vim: N/A
2022-03-31 10:05:26 +08:00
d5dee83552 vim-patch:8.2.4156: fileinfo message overwrites echo'ed message
Problem:    Fileinfo message overwrites echo'ed message.
Solution:   Reset need_fileinfo when displaying a message. (Rob Pilling,
            closes vim/vim#9569)
726f7f91fd
2022-03-31 10:05:26 +08:00
e2247c0baa vim-patch:8.2.2515: memory access error when truncating an empty message
Problem:    Memory access error when truncating an empty message.
Solution:   Check for an empty string. (Dominique Pellé, closes vim/vim#7841)
6281815ecc
2022-03-31 10:05:26 +08:00
47630743fc vim-patch:8.2.1844: using "q" at the more prompt doesn't stop a long message
Problem:    Using "q" at the more prompt doesn't stop a long message.
Solution:   Check for "got_int". (closes vim/vim#7122)
3d30af8783

Cherry-pick file name change from patch 8.2.2112.
2022-03-31 10:05:26 +08:00
b6e3a2dbbb vim-patch:8.2.4645: 'shortmess' changed when session does not store options (#17908)
Problem:    'shortmess' changed when session does not store options.
Solution:   Save and restore 'shortmess' if needed. (James Charti,
            closes vim/vim#10037)
fd01280d01
2022-03-31 10:04:12 +08:00
0d4bd420c1 fix: correct vertical dragging room calculation with global statusline (#17928)
This fixes the bug that win_move_statusline() or mouse dragging cannot
reduce 'cmdheight' to 1 when global statusline is used.
2022-03-31 08:40:17 +08:00
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
a18c9ba2da docs(lsp): remove outdated offset_encoding default value for apply_text_edits 2022-03-30 21:04:17 +02:00
7fb2310edb fix: set nested before executing callback (#17801) 2022-03-30 17:59:36 +02:00
1217694f21 Merge pull request #17921 from zeertzjq/vim-8.2.4649
vim-patch:8.2.{4349,4649}
2022-03-30 20:46:11 +08:00
06cf205ace vim-patch:8.2.4649: various formatting problems
Problem:    Various formatting problems.
Solution:   Improve the code formatting.
b4ad3b0dea
2022-03-30 20:32:27 +08:00
4ca14b310c vim-patch:8.2.4349: FileChangedShell test fails on MS-Windows
Problem:    FileChangedShell test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
c9e3187d05
2022-03-30 20:32:27 +08:00
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
75ff156d9b Merge pull request #17773 from zeertzjq/vim-8.2.3110
vim-patch:8.2.{3110,4592}: a pattern that matches the cursor position is complicated
2022-03-30 09:03:57 +08:00
465f8ff8cb vim-patch:8.2.4592: search continues after giving E1204
Problem:    Search continues after giving E1204.
Solution:   Return failure after giving E1204. (closes vim/vim#9972)
b10ff5c1b3
2022-03-30 08:35:13 +08:00
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
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
e5428d10b5 vim-patch:8.1.0439: recursive use of getcmdline() still not protected (#17726)
Problem:    Recursive use of getcmdline() still not protected.
Solution:   Instead of saving the command buffer when making a call which may
            cause recursiveness, save the buffer when actually being called
            recursively.
438d176e35

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

Clear ccline earlier in save_cmdline() if ccline is in use so that
ccline.prev_ccline can be assigned.
2022-03-30 08:32:12 +08:00
2f37823703 vim-patch:8.2.4646: using buffer line after it has been freed (#17907)
Problem:    Using buffer line after it has been freed in old regexp engine.
Solution:   After getting mark get the line again.
b55986c52d
2022-03-30 07:44:12 +08:00
e7ac16425c vim-patch:8.2.4473: Coverity warns for not checking return value of ftell() (#17914)
Problem:    Coverity warns for not checking return value of ftell().
Solution:   Bail out if ftell() returns a negative value.
416b5f4894
2022-03-30 05:54:02 +08:00
a9665bb12c fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913) 2022-03-30 05:25:00 +08:00
f4693d99df test: don't print NVIMLOG on success 2022-03-29 22:50:39 +02:00
29aa08a09d vim-patch:8.2.3449: sort fails if the sort compare function returns 999 (#17909)
Problem:    Sort fails if the sort compare function returns 999.
Solution:   Adjust value to -1 / 0 / 1. (Yasuhiro Matsumoto, closes vim/vim#8884)
c04f62346b
2022-03-30 04:14:37 +08:00
7a6978ba29 vim-patch:8.2.3551: checking first character of url twice (#17910)
Problem:    Checking first character of url twice.
Solution:   Only check once. (closes vim/vim#9026)
94e7d345c1
2022-03-30 02:23:58 +08:00
f1d5a2e82d chore: add .mailmap (#17453)
Consolidate commit author details

- Prefer user/email with either most commits or most recent commit
- Generally less preference for @users.noreply.github.com emails
- Avoided consolidating common names
2022-03-29 19:44:35 +02:00
524f6294a3 build(clint): link to wiki when accessing list_T internals directly (#17876) 2022-03-29 22:27:57 +08:00
ba257d74b1 fix(decorations): do not put empty virt_text (#17872) 2022-03-29 19:56:45 +08:00
81d7628c3f vim-patch:8.2.4644: redrawing too often when 'relativenumber' is set (#17756)
Problem:  Redrawing too often when 'relativenumber' is set.
Solution: Only redraw when the cursor line changed. (Lewis Russell,
          closes vim/vim#10040)
1624639ec8
2022-03-29 19:37:42 +08:00
d89a80fafc docs: update hl-Whitespace documentation (#17901) 2022-03-29 07:38:29 +02:00
3cc6cfecf3 vim-patch:8.2.4640: some boolean options use "long" instead of "int" (#17896)
Problem:    Some boolean options use "long" instead of "int".
Solution:   Adjust the type. (James McCoy, closes vim/vim#10033)
8be423b7ac

N/A patches for version.c:

vim-patch:8.2.4641: may mark the wrong window for redrawing

Problem:    May mark the wrong window for redrawing.
Solution:   Use redraw_win_later(). (closes vim/vim#10032)
471b3aed3e
2022-03-29 11:57:04 +08:00
4d3acd6beb fix(lsp): use "text" filetype for plaintext (#17898) 2022-03-28 09:16:11 -07:00
e55ba16a0e Merge pull request #17891 from casswedson/label-as-build
ci: label changes to Makefiles as build
2022-03-28 06:14:26 -04:00
595c1a724a perf: only redraw concealed line if cursor has moved horizontally
Building upon #17889, this moves conceal redrawing logic into move.c, so
that concealed line is only redrawn if cursor has moved horizontally.
2022-03-28 10:23:32 +08:00
9ce2c73180 revert: "Fix redraw regression with w_p_cole in visual mode"
Revert the code change from b7d6caaa03.
The test is kept.
The glitch was fixed by #17864, so this workaround is no longer needed.
2022-03-28 10:23:17 +08:00
02bac30928 ci: label changes to Makefiles as build
Makefiles are used for builds, so why not label changes to these
files as build
2022-03-27 19:20:15 -05:00
79dcd045d3 Merge pull request #17889 from zeertzjq/vim-8.2.4638
vim-patch:8.2.{4638,4630}: cursorlineopt=screenline redrawing
2022-03-28 06:40:00 +08:00
ab02b28b4e vim-patch:8.2.4630: 'cursorline' not always updated with 'culopt' is "screenline"
Problem:    'cursorline' not always updated with 'cursorlineopt' is
            "screenline".
Solution:   Call check_redraw_cursorline() more often. (closes vim/vim#10013)
bf269ed0b0

Code was reverted in patch 8.2.4638, so this just ports the test.
2022-03-28 06:15:26 +08:00
4baeb96c1b vim-patch:8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Problem:    Superfluous check if a redraw is needed for 'cursorline'.
Solution:   Remove check_redraw_cursorline(). (closes vim/vim#10030, closes vim/vim#10029)
3e559cd884

redraw_after_callback() is N/A.
Omits changes that just revert code from patch 8.2.4630.
2022-03-28 06:15:26 +08:00
a201dd265f Merge pull request #17887 from dundargoc/ci/commitlint
ci(commitlint): use -u NONE instead of --clean
2022-03-27 17:11:11 -04:00
da3ef2a538 ci: remove reviewers when drafting or closing a PR 2022-03-27 22:35:26 +02:00
b66cc0f569 Merge pull request #17873 from muniter/jl-apidocs-improvementes
ci(doc): improve missing docs workflow
2022-03-27 16:21:02 -04:00
f61841b8cc docs: .git-blame-ignore-revs #16174 2022-03-27 20:00:39 +00:00
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
680970bfbc ci(commitlint): use -u NONE instead of --clean
I get a weird error about syntax.vim not being installed when using
--clean when running it locally.
2022-03-27 18:28:11 +02:00
05edab85d7 refactor: assume STATUS_HEIGHT to be 1 (#17804)
Since https://github.com/neovim/neovim/pull/17790 being merged means we can assume the value of `STATUS_HEIGHT` to always be 1, this commit removes code that's unnecessary if `STATUS_HEIGHT` is 1.
2022-03-27 08:33:54 -07:00
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
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
71b4c30ad6 Merge pull request #17877 from zeertzjq/vim-8.2.4631
vim-patch:8.2.4631: crash when switching window in BufWipeout autocommand
2022-03-27 10:33:05 +08:00
ae0a43ec23 fix(tabpage): correct check for failure to close window
Avoid closing window 999 times.
2022-03-27 10:01:35 +08:00
f4f18a9833 vim-patch:8.2.4631: crash when switching window in BufWipeout autocommand
Problem:    Crash when switching window in BufWipeout autocommand.
Solution:   Put any buffer in the window to avoid it being NULL.
            (closes vim/vim#10024)
347538fad0

win_init_empty() cannot be made static because it is used in autocmd.c
2022-03-27 10:01:07 +08:00
45dbb78747 ci(doc): improve missing docs workflow
1. Add new pattern `runtime/doc/**`. This is a common case were the
   contributor modifies only the help file but the doc gen would discard
   their changes.

2. Add to the output what the changes after running doc gen would be.

[skip ci]
2022-03-26 12:38:36 -05:00
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
111dd6c322 Merge pull request #17869 from dundargoc/vim-8.2.3943
vim-patch:8.2.3943: compiler warning from gcc for uninitialized variable
2022-03-26 22:27:03 +08:00
66fff788f2 Merge pull request #17857 from muniter/jl-breaking-change-label
ci: automatic breaking change label
2022-03-26 09:45:54 -04: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
ca7d633eaf ci: automatic breaking change label
When the PR title contains the breaking change format apply the
breaking-change label.
2022-03-26 07:18:00 -05:00
82304038a2 vim-patch:8.2.3943: compiler warning from gcc for uninitialized variable
Problem:    Compiler warning from gcc for uninitialized variable.
Solution:   Initialize variable. (closes vim/vim#9429)
491669701c
2022-03-26 12:12:03 +01:00
fb5587d2be Merge pull request #17839 from zeertzjq/vim-8.2.4281
vim-patch:8.2.{4281,4327}: fix two crashes with quickfix and wiping buffer
2022-03-26 12:59:34 +08:00
a70b39965b fix(tui): avoid using uninitialized memory in kitty (#17866) 2022-03-26 10:48:31 +08:00
d8b4f3e3b8 vim-patch:8.2.4327: may end up with no current buffer
Problem:    May end up with no current buffer.
Solution:   When deleting the current buffer to not pick a quickfix buffer as
            the new current buffer.
e3537aec2f

The test cannot be ported as-is because Nvim doesn't support "-Z"
command line argument. Just use only "--clean" instead.
2022-03-26 09:51:59 +08:00
19bbc43947 vim-patch:8.2.4281: using freed memory with :lopen and :bwipe
Problem:    Using freed memory with :lopen and :bwipe.
Solution:   Do not use a wiped out buffer.
9b4a80a665

Cherry-pick some indent changes from patch 8.2.1432.
2022-03-26 09:02:42 +08:00
9530c2d6d8 vim-patch:8.2.4626: Visual area not updated when removing sign in Visual mode (#17864)
Problem:    Visual area not fully updated when removing sign in Visual mode
            while scrolling.
Solution:   Adjust check for topline. (closes vim/vim#10017)
abb6fbd14d
2022-03-26 08:52:54 +08:00
c2378be3dd vim-patch:8.2.3453: autocmd not executed when editing a directory (#17846)
Problem:    Autocmd not executed when editing a directory ending in a path
            separator inside try block.
Solution:   Return NOTDONE instead of FAIL. (closes vim/vim#8885)
40fa12aea3
2022-03-26 08:27:29 +08:00
876d22fca9 fix(clang/'Dead store'): do not assign endcol (#17788) 2022-03-25 18:02:42 -06:00
61205c1def chore: fix typos (#17755)
Co-authored-by: Jordan Haine <jhaine@securitycompass.com>
2022-03-25 19:57:59 +01:00
174deafcef docs(api): improve autocommand docs (#17545)
[skip ci]
2022-03-25 19:24:53 +01:00
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
d72e82d3db build(deps): bump luajit to commit e2c312e (#17111)
bump bundled LuaJIT to e2c312e0de
2022-03-25 17:42:32 +01:00
b81c310d49 fix(tui): correct CSI sequence (#17844)
Follow up to #17771. The sequence `CSI > 4 ; 1 m` does not enable
distinguishing all available keys; notably, it excludes `<Tab>`. Using
`CSI > 4 ; 2 m` tells the terminal to disambiguate *all* keys, which is
much more useful.

The meaning of the final parameter is documented [here][1].

[1]: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys
2022-03-24 13:11:04 -06:00
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
39af40580a Merge pull request #17809 from dundargoc/PVS/V1019
fix(PVS/V1019): compound assignment expression is used inside condition
2022-03-24 18:37:23 +01:00
27fccb295c Merge pull request #17771 from gpanders/extendedkeys
feat(tui): enable CSI u keys
2022-03-24 18:13:32 +01:00
93e0d9b556 fix(PVS/V1019): compound assignment expression is used inside condition 2022-03-24 17:57:36 +01:00
02fd00c042 feat(runtime): include Lua in C++ ftplugin (#17843) 2022-03-24 08:05:13 -06:00
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
b438251a0e Merge pull request #17838 from zeertzjq/ci-docgen-no-src-lua
ci: remove src/nvim/**.lua from docgen pattern
2022-03-24 14:20:03 +01:00
a11ff55555 feat(tui): enable CSI u keys
On TUI startup write the CSI sequence that signals to the controlling
terminal that Neovim supports the CSI u scheme for encoding modifiers
documented in [1].

This is similar to, but distinct from, Vim's usage of the `t_TI` and
`t_TE` variables to handle Xterm's `modifyOtherKeys` setting. For a
longer explanation on those differences see [2]. Since Neovim uses
libtermkey for key input handling, we use the CSI u encoding rather than
Xterm's modifyOtherKeys encoding.

[1]: http://www.leonerd.org.uk/hacks/fixterms/
[2]: https://invisible-island.net/xterm/modified-keys.html
2022-03-24 07:13:49 -06:00
3b28bd57f9 Merge pull request #17821 from zeertzjq/vim-patch-cursorline
vim-patch:8.2.{4591,4614}: cursorline redrawing
2022-03-24 20:28:46 +08:00
1194856b31 Merge pull request #17740 from dundargoc/doxygen/memline
refactor(memline): convert function comments to doxygen format
2022-03-24 13:15:20 +01:00
4a11c7e56f chore(nvim_paste): assert the correct String (#17752) 2022-03-24 19:40:00 +08:00
534f5a419d refactor: convert function comments to doxygen format (#17710) 2022-03-24 12:17:21 +01:00
fcd57980f9 chore: add additional compiler flags (#17815)
Added:
  - -Wdouble-promotion
  - -Wmissing-noreturn
  - -Wmissing-format-attribute
  - -Wsuggest-attribute={pure,const,malloc,cold}

Resolves: #343
2022-03-24 12:14:04 +01:00
0c45753119 Merge pull request #17825 from bfredl/ctrl2
feat(input)!: distinguish ctrl input pairs (always)
2022-03-24 12:05:36 +01:00
8b7f818ee7 refactor(memline): convert function comments to doxygen format 2022-03-24 11:19:15 +01:00
ed88ca7503 feat(input): enable <tab>/<c-i>, <cr>/<c-m>, <esc>/<c-[> pairs unconditionally 2022-03-24 11:02:39 +01:00
d7488bf386 feat(input)!: delay some conversions to vgetc() 2022-03-24 11:02:39 +01:00
c29a14d1fa perf(screen): reduce cursorline redrawing when jumping around
vim-patch:8.2.4614: redrawing too much when 'cursorline' is set

Problem:    Redrawing too much when 'cursorline' is set and jumping around.
Solution:   Rely on win_update() to redraw the current and previous cursor
            line, do not mark lines as modified. (closes vim/vim#9996)
c20e46a4e3

This doesn't match the patch exactly, because I missed some lines when
porting patch 8.1.2029, and these lines were removed in this patch.

This also makes win_update() always update for 'concealcursor' like how
it always updates for 'cursorline', as 'cursorline' and 'concealcursor'
redrawing logic has been unified in Nvim.

As redrawing for 'cursorline' now always only requires VALID redraw
type, it is no longer necessary to call redraw_for_cursorline() in
nvim_win_set_cursor().
2022-03-24 16:08:59 +08:00
3e9b4e917d vim-patch:8.2.4591: cursor line not updated when a callback moves the cursor
Problem:    Cursor line not updated when a callback moves the cursor.
Solution:   Check if the cursor moved. (closes vim/vim#9970)
e7a74d5375

redraw_after_callback() is N/A. Nvim handles timers on the main loop.
2022-03-24 16:08:59 +08:00
a72f338d76 fix(float): do not switch window before deleting last listed buffer (#17840)
Just allow close_windows() to close the current window instead.
This fixes wrong working directory or autocommands not being triggered.
2022-03-24 14:53:20 +08:00
ff82b2785f fix(float): don't always switch window when deleting last listed buffer (#17836) 2022-03-24 11:56:22 +08:00
fc3bff6b7e ci: remove src/nvim/**.lua from docgen pattern
After #17623 this pattern is no longer necessary.
2022-03-24 11:35:24 +08:00
2e36117840 test: add test for deleting last listed buffer when there are floats (#17833) 2022-03-24 09:28:23 +08:00
d3af109d10 fix(PVS/V560): ignore false "conditional expression is always false" (#17830)
"'qi' points to the global variable 'ql_info' or the window local location list stack 'wp->w_llist'.  The contents of these structures can be changed out-of-band by an autocmd."

https://github.com/vim/vim/pull/9993#issuecomment-1076544168
2022-03-24 06:25:20 +08:00
06131370a4 refactor(memline.c): make swapfile_unchanged() return bool (#17827)
vim-patch:8.2.4613: return type of swapfile_unchanged() is wrong

Problem:    Return type of swapfile_unchanged() is wrong.
Solution:   Use "int". (closes vim/vim#10000  Yeah!)
3c5999e53d
2022-03-23 22:33:34 +08:00
52fe8eae07 fix(screen): do not update syntax_last_parsed when drawing folded line (#17826) 2022-03-23 20:23:41 +08:00
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
0621cd3112 Merge pull request #17806 from zeertzjq/win-close-float-fix
Fix some bugs with closing window or buffer when there are floating windows
2022-03-23 18:05:31 +08:00
a9359dca37 fix(float): make laststatus=1 behave consistently with floating windows 2022-03-23 09:07:21 +08:00
3fdb7b528d fix(float): handle buffer deletion with floating windows 2022-03-23 09:07:21 +08:00
3539456f49 fix(win_close): count the window the be closed instead of curwin 2022-03-23 09:07:21 +08:00
89712dcbf8 fix(aucmd_win): always make aucmd_win the last window 2022-03-23 09:07:21 +08:00
7735163652 fix(screen): do not do syntax highlighting at filler or folded lines (#17818) 2022-03-23 07:07:34 +08:00
159111f9a5 refactor(ui_refresh): only save/restore p_lz if calling screen_resize() (#17794) 2022-03-23 06:34:45 +08:00
7863e6b709 vim-patch:8.2.1078: highlight and match functionality together in one file (#17805)
Problem:  Highlight and match functionality together in one file.
Solution: Move match functionality to a separate file. (Yegappan Lakshmanan,
          closes vim/vim#6352)

06cf97e714
2022-03-23 06:31:50 +08:00
f63a52a0db vim-patch:8.1.1608: the evalfunc.c file is too big (#17807)
Problem:    The evalfunc.c file is too big.
Solution:   Move sign functionality to sign.c.

b60d8514b8
2022-03-23 06:31:06 +08:00
04d2476d3a Merge pull request #17813 from muniter/jl-ci-api-docs-permissions
fix(ci): provide necessary permissions for calling workflow
2022-03-22 06:52:09 -04:00
b55e65980a fix(ci): provide necessary permissions for calling workflow
Also error on the side of security adding an extra check on the
automatic PR step.
2022-03-21 22:40:24 -05:00
0c02e8a62b Merge pull request #17768 from muniter/jl-genvimdoc-ci 2022-03-21 11:41:19 -04:00
50f3bb7e57 Merge pull request #17491 from neovim/marvim/api-doc-update/master 2022-03-21 11:40:56 -04:00
e9b53f3fb5 fix(PVS/V583): the '?:' operator always returns one and the same value (#17790) 2022-03-20 17:25:03 -06:00
18900758c3 Merge pull request #17760 from lewis6991/vim-patch-8.1.1734
vim-patch:8.1.{1734,1742,1743}: highlight, match and screen.c refactoring
2022-03-21 07:21:04 +08:00
087a9603d0 vim-patch:8.1.1743: 'hlsearch' and match highlighting in the wrong place
Problem:  'hlsearch' and match highlighting in the wrong place.
Solution: Move highlighting from inside screen functions to highlight.c.

bbca7732e8
2022-03-20 22:01:56 +00:00
3c62a3f9dd vim-patch:8.1.1742: still some match functions in evalfunc.c
Problem:    Still some match functions in evalfunc.c.
Solution:   Move them to highlight.c.

7dfb016d25
2022-03-20 22:01:56 +00:00
6566a4bdbd vim-patch:8.1.1734: the evalfunc.c file is too big
Problem:    The evalfunc.c file is too big.
Solution:   Move some functions to other files.

29b7d7a9aa
2022-03-20 22:01:56 +00:00
809dd65396 docs: regenerate [skip ci] 2022-03-20 18:00:30 +00:00
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
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
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
463738938d Merge pull request #17785 from muniter/jl-fix-doxygen-destroyer
docs: properly escape to avoid doxygen weirdness
2022-03-20 10:35:27 -04:00
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
75157d2572 vim-patch:47c532e2bc55 (#17780)
Update runtime files
47c532e2bc
2022-03-20 10:48:10 +01:00
54f15a9e47 Merge pull request #17772 from zeertzjq/vim-8.2.2716
vim-patch:8.2.{2716,4546}: the equivalent class regexp is missing some characters
2022-03-20 12:31:11 +08:00
be35d3c5ad feat(api): remove Lua autocommand callbacks when they return true (#17784)
This copies the semantics of nvim_buf_attach callbacks, and is a
convenient way to create oneshot autocommands gated by some condition.
2022-03-19 18:57:58 -06:00
77eb6f9dc7 fix(api, lua): return NIL on failure to find converted function (#17779) 2022-03-20 08:08:50 +08:00
b1207e5080 docs: properly escape to avoid doxygen weirdness
If this is not properly escaped doxygen 1.9.3 will not work correctly,
and the documentation generated in local machines will differ with what
is generated in CI.
2022-03-19 15:32:18 -05:00
2ab52bd988 refactor(tinput_wait_enqueue): use rbuffer_read() when pasting (#17754)
When pasting, all of key buffer can be consumed, and in case of phase 3
the paste event must be put exactly once, so using rbuffer_read() should
be better here.
2022-03-19 21:56:47 +08:00
536dc391f6 vim-patch:8.2.4593: unnecessary call to redraw_later() (#17775)
Problem:    Unnecessary call to redraw_later().
Solution:   Remove the call to redraw_later() in op_yank(). (closes vim/vim#9971)
95d2e7634c
2022-03-19 20:18:45 +08:00
c4624b9543 vim-patch:8.2.4546: duplicate #undef
Problem:    Duplicate #undef.
Solution:   Remove one #undef. (closes vim/vim#9932)
0a4e098f32
2022-03-19 17:12:29 +08:00
81648fd277 vim-patch:8.2.2716: the equivalent class regexp is missing some characters
Problem:    The equivalent class regexp is missing some characters.
Solution:   Update the list of equivalent characters. (Dominique Pellé,
            closes vim/vim#8029)
0b94e297af

Match upstream's indent in s:equivalence_class().
2022-03-19 17:12:29 +08:00
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
e0fe91f6a3 fix(translation): po file for Russian (#17767) 2022-03-18 19:48:20 +01:00
9191401025 ci(docs): add a check for PR's to commit their doc changes
Repurpose the api-docs workflow to also run in all PR's but work only as
a check, if the changes in the PR introduce doc changes that are not
committed fail.

[skip ci]
2022-03-18 13:29:55 -05:00
c2fa3af41f Merge pull request #17719 from dundargoc/doxygen/ex_docmd
refactor(ex_docmd): convert function comments to doxygen format
2022-03-18 19:05:24 +01:00
9e66d27d37 fix(syntax.c): correct hunk from Vim patch 8.0.0647 (#17761) 2022-03-18 21:15:18 +08:00
0a81a33a9d Merge pull request #17694 from lewis6991/fix_signcol
fix(signcol): always trigger a redraw
2022-03-18 11:07:13 +01:00
00effff569 vim-patch:8.1.1693: syntax coloring and highlighting is in one big file (#17721)
Problem:    Syntax coloring and highlighting is in one big file.
Solution:   Move the highlighting to a separate file. (Yegappan Lakshmanan,
            closes vim/vim#4674)

f9cc9f209e

Name the new file highlight_group.c instead.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-18 12:47:08 +08:00
c1b98cfa5e Merge pull request #17459 from rktjmp/lua-error-tostring
feat: __tostring lua errors if possible before showing in messages
2022-03-18 00:57:48 +01:00
cac90d2de7 feat(api, lua): support converting nested Funcref back to LuaRef (#17749) 2022-03-17 20:21:47 +01:00
09a3b33d36 Merge pull request #17747 from bfredl/ui_input
feat(ui_client): input and resize
2022-03-17 20:17:38 +01:00
3c7e937a89 Merge pull request #17266 from famiu/feat/ui/global-statusline
feat(statusline): add global statusline
2022-03-17 20:16:39 +01:00
55b6ade7fe feat(ui_client): implement async paste handling 2022-03-17 19:39:06 +01:00
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
c6640d0d70 feat(ui_client): handle resize events 2022-03-17 19:20:20 +01:00
6636160338 feat(ui_client): pass user input to remote server 2022-03-17 19:20:13 +01:00
d238b8f600 chore: fix typos (#17670)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-03-17 13:21:24 +08:00
746a29c580 Merge pull request #17707 from tesaguri/refactor-gen_vimdoc 2022-03-16 16:13:59 -04:00
aeae88f32a Merge pull request #17739 from dundargoc/doxygen/ex_cmds
refactor(ex_cmds): convert function comments to doxygen format
2022-03-16 20:52:40 +01:00
4c7e2ab12e Merge pull request #17741 from dundargoc/doxygen/message
refactor(message): convert function comments to doxygen format
2022-03-16 20:11:43 +01:00
b9c3b617ba Merge pull request #17732 from dundargoc/doxygen/fold
refactor(fold): convert function comments to doxygen format
2022-03-16 19:31:48 +01:00
a41321a8a2 refactor(ex_cmds): convert function comments to doxygen format 2022-03-16 18:32:15 +01:00
4e5e0076cb Merge pull request #17708 from bfredl/ui_client
feat(ui): UI client episode II: event handlers
2022-03-16 16:05:40 +01:00
6435a94d62 refactor(message): convert function comments to doxygen format 2022-03-16 14:06:42 +01:00
1784842899 refactor(ex_docmd): convert function comments to doxygen format 2022-03-16 13:46:14 +01:00
fa79a016bc chore(checkhealth/provider): style fixes (#17738) 2022-03-16 09:46:14 +00:00
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
72ed4a547a refactor(fold): convert function comments to doxygen format 2022-03-16 09:22:19 +01:00
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
a1a8cbe9e4 Merge pull request #17731 from dundargoc/doxygen/ex_eval
refactor(ex_eval): convert function comments to doxygen format
2022-03-15 21:18:08 +01:00
f01d203b70 refactor(ui): make auto-generated ui client handlers typesafe 2022-03-15 19:55:34 +01:00
c0b4d931e1 refactor(ui): make ui_client_event_grid_line typesafe 2022-03-15 19:55:34 +01:00
ca23f2ed30 refactor(ui): use "ui_client" instead of "redraw" as general prefix 2022-03-15 19:55:34 +01:00
534edce3c4 feat(ui): invoke ui client handlers 2022-03-15 19:55:34 +01:00
794d2744f3 feat(ui): implement ui_client event handlers 2022-03-15 19:55:34 +01:00
2aa473593f refactor: convert function comments to doxygen format 2022-03-15 19:44:44 +01:00
aa35d15a0d Merge pull request #17709 from seandewar/vim-8.2.4559
vim-patch:8.2.{4555,4559,4568,4569}: make `getmousepos()` return the text column
2022-03-15 11:45:53 +00:00
716df377b4 vim-patch:8.2.4568: getmousepos() does not compute the column below the last line
Problem:    getmousepos() does not compute the column below the last line.
Solution:   Also compute the column when the mouse is below the last line.
            (Sean Dewar, closes vim/vim#9946)
10792feebd

test_setmouse is N/A.
2022-03-15 11:41:13 +00:00
4a8b6bde01 vim-patch:8.2.4559: getmousepos() returns the screen column
Problem:    getmousepos() returns the screen column. (Ernie Rael)
Solution:   Return the text column, as documented.
533870a985

Re-introduce vcol2col, which was removed in 71b1f4e for being unused.
Move it to mouse.c (like in v8.1.2062, which hasn't been ported yet).
2022-03-15 11:41:13 +00:00
6906c5759d vim-patch:8.2.4555: getmousepos() returns the wrong column
Problem:    getmousepos() returns the wrong column. (Ernie Rael)
Solution:   Limit to the text size, not the number of bytes.
986b0fd0c5

test_setmouse is N/A; adjust test for Nvim.

N/A patches for version.c:

vim-patch:8.2.4569: Coverity warning for not using a return value

Problem:    Coverity warning for not using a return value.
Solution:   Add "(void)".
977525fea6
2022-03-15 11:39:38 +00:00
9a9b93c485 Merge pull request #16585 from zeertzjq/lua-paste-eol
vim.paste() fixes
2022-03-15 18:41:03 +08:00
e263afc0e9 fix(paste): escape control characters in Cmdline mode 2022-03-15 18:15:18 +08:00
3470a9c3de test(paste): add tests with virtualedit=onemore 2022-03-15 18:15:18 +08:00
e4ec8d7d50 test(paste): reorganize tests and add tests for linewise Visual mode 2022-03-15 18:15:18 +08:00
a6eafc77ce fix(paste): deal with trailing new line in chunk 2022-03-15 18:15:18 +08:00
fcc6f66cf2 fix(paste): avoid edges cases caused by empty chunk 2022-03-15 18:15:18 +08:00
21ba2d81a8 refactor(paste): do not print dots in cmdline mode 2022-03-15 18:15:18 +08:00
bfb7754442 fix(paste): deal with eol and eof in Visual mode 2022-03-15 18:15:18 +08:00
2601e0873f fix(paste): don't move cursor past the end of pasted text in Normal mode 2022-03-15 18:15:18 +08:00
9b1e1fbc9f fix(paste): use getcmdtype() to determine whether in cmdline mode 2022-03-15 18:15:18 +08:00
bef7552f70 Merge pull request #17725 from zeertzjq/vim-8.2.4566
vim-patch:8.2.4566: check for existing buffer in session file may not work
2022-03-15 10:20:00 +08:00
2ea16f7354 vim-patch:8.2.4566: check for existing buffer in session file may not work
Problem:    Check for existing buffer in session file does not work for files
            in the home directory.
Solution:   Use fnamemodify(). (James Cherti, closes vim/vim#9945)  Add a test.
7d42840033
2022-03-15 08:25:39 +08:00
61126fcc69 Merge pull request #17718 from dundargoc/doxygen/eval_c
refactor(eval): convert function comments to doxygen format
2022-03-14 20:59:57 +01:00
2fbbd3258e Merge pull request #17488 from seandewar/vim-8.2.4428
vim-patch:8.2.{1401,1413,4428,4432,4434,4438,4442,4444,4445,4454}: tabpage patches
2022-03-14 13:55:12 +00:00
378db4f32a refactor(eval): convert function comments to doxygen format 2022-03-14 14:22:58 +01:00
365a9b074f vim-patch:8.2.1413: previous tab page not usable from an Ex command
Problem:    Previous tab page not usable from an Ex command.
Solution:   Add the "#" argument for :tabnext et al. (Yegappan Lakshmanan,
            closes vim/vim#6677)
94f4ffa770

Do not rename old_curtab to prev_tp in win_new_tabpage, this can be confused
with the previous tabpage (`:tabprevious`).

Cherry-pick ex_errmsg from v8.2.1280.
8930caaa1a
2022-03-14 13:10:57 +00:00
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
7e19c18a54 vim-patch:8.2.4454: resetting cmdwin_type only for one situation
Problem:    Resetting cmdwin_type only for one situation.
Solution:   Reset cmdwin_type before closing windows. (closes vim/vim#9822)
6a8b13614e

Move the check to win_free_all to match Vim.
2022-03-14 13:10:57 +00:00
70582bd925 vim-patch:8.2.4445: exit test fails on MS-Windows anyway
Problem:    Exit test fails on MS-Windows anyway.
Solution:   Skip the test on MS-Windows.
29a9e69718
2022-03-14 13:10:57 +00:00
0412dba456 vim-patch:8.2.4444: beep caused by test
Problem:    Beep caused by test.  ASAN reports leaks.
Solution:   Do not put a NL at the end of the script.  Make the text work on
            MS-Windows.  Do not run the test with ASAN.
68eab67119

The test is skipped, but cherry-pick CheckNotAsan from v8.2.2424 anyway.
97202d9516
2022-03-14 13:10:56 +00:00
fe53182934 vim-patch:8.2.4442: test for error reading input fails on MS-Windows
Problem:    Test for error reading input fails on MS-Windows.
Solution:   Don't run the test on MS-Windows.
70b9e4f4c3
2022-03-14 13:10:56 +00:00
7519af4f0f vim-patch:8.2.4438: crash on exit when using cmdline window
Problem:    Crash on exit when using cmdline window.
Solution:   Reset "cmdwin_type" before exiting. (closes vim/vim#9817)
ca0c1caa36

Bram also went with the cmdwin_type = 0 solution, but putting it in
read_error_exit isn't ideal and only fixes one specific variant of the bug, so
don't port that change.

Port the test only, but skip it as Nvim does not exit after stdin is exhausted.
Using -es instead does exit, but read_error_exit does not run preserve_exit in
that case, and does not have issues exiting even without resetting cmdwin_type.

Note that the test has problems and is fixed in later patches.
2022-03-14 13:10:56 +00:00
490874f3da vim-patch:8.2.4432: cannot use settabvar() while the cmdline window is open
Problem:    Cannot use settabvar() while the cmdline window is open.
Solution:   Only give an error when actually switching tabpage.
            (closes vim/vim#9813)
592f625001
2022-03-14 13:10:56 +00:00
880d3537d0 vim-patch:8.2.4428: crash when switching tabpage while in the cmdline window
Problem:    Crash when switching tabpage while in the cmdline window.
Solution:   Disallow switching tabpage when in the cmdline window.
0f6e28f686

Ensure cmdline window doesn't stop us from closing tabs with EXITFREE.
mem_free_all -> win_free_all -> tabpage_close -> ... -> goto_tabpage_tp
-> CHECK_CMDWIN can cause an infinite loop if Nvim is exited without using
standard methods such as :qa! and friends (e.g: killed via a signal).
This issue had caused the ASAN CI's functionaltests to timeout.

Cherry-pick Test_cmdwin_tabpage from v8.2.4463.
38b85cb4d7
This bug was already fixed in Nvim. Note that g<Tab> inside cmdwin is already
tested for in tabnewentered_spec.lua anyway.

E492 is thrown after E11 when using ":norm" in assert_fails for some reason
(except after v8.2.1919, which isn't ported yet).
As v8.2.1183 isn't ported yet, so we cannot assert E11 directly.
Modify the test to check for E11 and E492 seperately; when v8.2.1183 is ported,
the assertion for E492 will fail and the changes can be reverted to match
upstream.

Remove redundant CHECK_CMDWIN from goto_tabpage; it's handled with text_locked()
and text_locked_msg() above:

vim-patch:8.2.4434: duplicate check for cmdline window

Problem:    Duplicate check for cmdline window.
Solution:   Remove the second check. (Sean Dewar, closes vim/vim#9816)
16b51d26fe
2022-03-14 13:10:20 +00:00
895ca52e4c Merge pull request #17717 from dundargoc/doxygen/eval/funcs
refactor(eval/funcs): convert function comments to doxygen format
2022-03-14 13:38:38 +01:00
4d6863554b refactor(eval/funcs): convert function comments to doxygen format 2022-03-14 13:08:52 +01:00
ecc36c3d1c docs: remove extra whitespaces 2022-03-14 08:16:01 +09:00
be2def4100 chore(gen_vimdoc): fall back to brief_desc_node when desc_node is empty 2022-03-14 07:53:42 +09:00
334a16c791 refactor(gen_vimdoc): simplify files in CONFIG 2022-03-14 07:53:42 +09:00
cf4786ddfa chore(gen_vimdoc): call delete_lines_below only if the file exists
Previously, `delete_lines_below` would raise `FileNotFoundError` when
adding a new file to `CONFIG` and you had to manually write a file with
help tag of the first section as placeholder. This change relieves you
of that need.
2022-03-14 07:53:41 +09:00
2d28c40ef9 refactor(gen_vimdoc): detect section_start_token automatically 2022-03-14 07:53:41 +09:00
6dc2c82931 Merge pull request #17696 from dundargoc/refactor/minimize-scope
refactor: minimize variable scope and eliminate empty declarations
2022-03-13 23:17:57 +01:00
f9f843e02e refactor: use Lua autocommands in filetype.lua (#17711) 2022-03-13 15:52:41 -06:00
198bf3a8f2 refactor: minimize variable scope and eliminate empty declarations 2022-03-13 20:44:53 +01:00
ce537bb232 Merge pull request #17697 from lewis6991/screenrefactor
refactor: column drawing
2022-03-13 23:07:50 +08:00
f3f67da340 refactor: column drawing
- move some logic out of win_line into specific easy to read
  sub-functions.

- remove drawing logic from get_sign_display_info.
2022-03-13 22:41:31 +08:00
6e1caeaf3a vim-patch:8.2.4557: confusing comment about 'cursorlineopt'
Problem:    Confusing comment about 'cursorlineopt'.
Solution:   Adjust comment.  (closes vim/vim#9939)  Add parenthesis around logical
            OR.
754d2b4036
2022-03-13 22:28:37 +08:00
4ba12b3dda refactor: fix clint warnings (#17682) 2022-03-13 22:11:17 +08:00
4ede2ea4b2 test: fix runnvim.sh (#17690) 2022-03-13 22:07:22 +08:00
c45644f994 test(python3_spec): use a pattern to match SyntaxError message (#17705) 2022-03-13 22:05:56 +08:00
9e6bc228ec docs(api): improve section on nvim_set_hl (#17692) 2022-03-13 06:42:12 -06:00
c9b94188d5 Merge pull request #17702 from zeertzjq/vim-8.1.0877
vim-patch:8.1.{0877,0892,1015},8.2.{3759,3762}: quickfix patches
2022-03-13 14:21:37 +08:00
ff48e61ec9 vim-patch:8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Problem:    If the quickfix buffer is wiped out getqflist() still returns its
            number.
Solution:   Use zero if the buffer is no longer present. (Yegappan Lakshmanan,
            closes vim/vim#9306)
56150da687
2022-03-13 13:17:28 +08:00
c5e47e44aa vim-patch:8.2.3759: quickfix buffer becomes hidden while still in a window
Problem:    Quickfix buffer becomes hidden while still in a window.
Solution:   Check if the closed window is the last window showing the quickfix
            buffer. (Yegappan Lakshmanan, closes vim/vim#9303, closes vim/vim#9300)
78a61068cf
2022-03-13 13:17:28 +08:00
dc32a20503 test(old): add some missing tests from Vim patches 8.1.2320 and 8.1.2360 2022-03-13 13:17:28 +08:00
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
6c26ab71ce vim-patch:8.1.0892: failure when closing a window when location list is in use
Problem:    Failure when closing a window when location list is in use.
Solution:   Handle the situation gracefully. Make sure memory for 'switchbuf'
            is not freed at the wrong time. (Yegappan Lakshmanan,
            closes vim/vim#3928)
eeb1b9c7ed
2022-03-13 13:17:28 +08:00
91ac0088e1 vim-patch:8.1.0877: new buffer used every time the quickfix window is opened
Problem:    New buffer used every time the quickfix window is opened.
Solution:   Reuse the buffer. (Yegappan Lakshmanan, closes vim/vim#3902)
ee8188fc74
2022-03-13 13:17:28 +08:00
0cf2dc63bf fix(win_split_ins): do not fail when oldwin is not valid
Ref #14240
2022-03-13 13:17:22 +08:00
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
f291a0339c fix: use normal! <C-L> in default <C-L> mapping (#17695) 2022-03-12 17:56:53 -07:00
356631cba0 Merge pull request #17687 from zeertzjq/fix-channel-consistency
fix(channel): fix channel consistency
2022-03-13 05:44:50 +08:00
36ca585d2f Merge pull request #17691 from bfredl/serverconnect
feat(ui): connect to remote ui (beginning of ui client)
2022-03-12 21:11:37 +01:00
a4400bf8cd feat(ui): connect to remote ui (only debug messages for now)
co-authored-by: hlpr98 <hlpr98@gmail.com>
2022-03-12 19:24:46 +01:00
8ba8f1a018 fix(signcol): always trigger a redraw
Whenever we change the size of the buffer signcol value, always trigger
a redraw.

Fixes: #17693
2022-03-12 16:27:11 +00:00
3a12737e6c refactor(main): separate connection code from --remote execution code 2022-03-12 15:06:53 +01:00
f1c9065b0e test: improve terminal channel tests 2022-03-12 19:23:45 +08:00
5051510ade fix(channel): fix channel consistency
- Fix the problem that chanclose() does not work for channel created by
  nvim_open_term().
- Fix the problem that the loopback channel is not released.
- Fix the error message when sending raw data to the loopback channel.
2022-03-12 19:23:45 +08:00
ab456bc304 vim-patch:8.2.3779: using freed memory when defining a user command recursively (#17688)
Problem:    Using freed memory when defining a user command from a user
            command.
Solution:   Do not use the command pointer after executing the command.
            (closes vim/vim#9318)
205f29c3e9
2022-03-12 08:25:28 +00:00
08d9d74fd9 Merge pull request #17680 from zeertzjq/vim-8.2.4440
vim-patch:8.2.{4440,4443}: crash with specific regexp pattern and string
2022-03-12 08:08:31 +08:00
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
84af45f59f docs: remove "not in vi" notes (#17678)
[skip ci]
2022-03-11 22:25:59 +00:00
965f1fd6fd Merge pull request #17439 from groves/1750
feat: restore --remote
2022-03-11 19:47:24 +01:00
1201145b68 fix(remote): use STATIC_CSTR_AS_STRING 2022-03-11 13:05:40 -05:00
1dbf8675c7 fix(remote): respect silent in error reporting 2022-03-11 11:16:46 -05:00
2be938a251 fix(remote): report connection error, missing return values 2022-03-11 11:16:46 -05:00
29c3632285 fix(remote): report on missing wait commands, typecheck lua results
Clean up lint errors, too
2022-03-11 11:16:46 -05:00
e095a868cb docs(remote): update remote.txt for current nvim implementation 2022-03-11 11:16:46 -05:00
fcdb1f372b docs(remote): restore remote.txt from removal in f2205b83c5 2022-03-11 11:16:46 -05:00
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
70d2ab1583 fix(remote): make compile again 2022-03-11 11:16:46 -05:00
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
a6e72aa295 vim-patch:8.2.4443: regexp pattern test fails on Mac
Problem:    Regexp pattern test fails on Mac.
Solution:   Do not use a swapfile for the buffer.
2457b2bbc2
2022-03-11 23:01:33 +08:00
d0b5c1f696 vim-patch:8.2.4440: crash with specific regexp pattern and string
Problem:    Crash with specific regexp pattern and string.
Solution:   Stop at the start of the string.
6456fae9ba
2022-03-11 23:01:02 +08:00
76769b8a1f Merge pull request #17673 from dundargoc/refactor/clint
refactor: fix all clint warnings from buffer
2022-03-11 15:23:51 +01:00
c2ab922f0a Merge pull request #17663 from dundargoc/refactor/uncrustify
refactor: apply uncrustify
2022-03-11 15:07:49 +01:00
c3a6ff6aa3 fix(coverity): dead code and operands don't affect result #17662
* fix(coverity/349942): structurally dead code

* fix(coverity/331396): operands don't affect result

* fix(coverity/331393): operands don't affect result

* fix(coverity/331392): operands don't affect result

* fix(coverity/331384): operands don't affect result

* fix(coverity/331374): operands don't affect result

* fix(coverity/331372): operands don't affect result

* fix(coverity/331371): operands don't affect result

* fix(coverity/331364): operands don't affect result

* fix(coverity/105585): operands don't affect result
2022-03-11 15:04:48 +01:00
9ff4acbb36 refactor: fix all clint warnings from buffer.c 2022-03-11 14:47:18 +01:00
19858288b4 Merge pull request #17672 from lewis6991/refactorprovider
refactor(decorations): move provider code
2022-03-11 13:01:33 +01:00
abbc9148db Merge pull request #17665 from clason/bump-libuv
build(deps): bump libuv to 1.44.1
2022-03-10 18:45:12 -05:00
8a5f0559cc Merge pull request #17604 from dundargoc/ci/better-error-output
Better CI error output
2022-03-10 18:42:02 -05:00
4be92ba90d refactor(decorations): unglobal decor_providers
Now all the decoration provider code is in one place, decor_providers no
longer need to be global.
2022-03-10 22:41:21 +00:00
1b054119ec refactor(decorations): move provider code
Move decoration provider code to a separate file.
2022-03-10 22:41:20 +00:00
1e7ba7ea6b build(deps): bump libuv to 1.44.1 2022-03-10 16:48:49 +01:00
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
3a32aa9615 Merge pull request #17671 from zeertzjq/vim-8.2.3949
vim-patch:8.2.{3949,3950}: fix two crashes with /\%V
2022-03-10 20:32:13 +08:00
a80ec88906 test: add a test for #17489 2022-03-10 17:22:39 +08:00
c3208feb72 vim-patch:8.2.3950: going beyond the end of the line with /\%V
Problem:    Going beyond the end of the line with /\%V.
Solution:   Check for valid column in getvcol().
94f3192b03
2022-03-10 17:22:39 +08:00
d2d3be0a4a vim-patch:8.2.3949: using freed memory with /\%V
Problem:    Using freed memory with /\%V.
Solution:   Get the line again after getvvcol().
4c13e5e676
2022-03-10 16:43:27 +08:00
815ba835a3 ci: refactor and simplify CI process 2022-03-10 09:21:41 +01:00
d47714d87c ci: remove function run_suite 2022-03-10 09:21:41 +01:00
7a0fd7a288 ci: remove variable FAIL_SUMMARY
On GitHub Actions it just repeats the summary that is shown just after.
When run outside of GitHub Actions it erroneously shows the summary of
the previous suites.
2022-03-10 09:21:41 +01:00
fbcbd1d05e ci: remove variable NVIM_TEST_CURRENT_SUITE
We always know where in the test we are anyway, it's just needless
repetition.
2022-03-10 09:21:41 +01:00
17ecb60c58 ci: remove fail character from fail function 2022-03-10 09:21:40 +01:00
7e3bdc75e4 refactor(uncrustify): format all c files 2022-03-10 09:14:12 +01:00
d0cb8744d8 refactor(uncrustify): disable uncrustify for misformatted code sections
Uncrustify version 0.74 has a bug that deindents and misformats the
entire fileio.c.
2022-03-10 09:14:12 +01:00
9e9322b222 Merge pull request #17653 from dundargoc/chore/lgtm
fix lgtm warnings
2022-03-10 15:01:02 +08:00
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
487f52c9d2 chore(regexp.c): correctly align META_flags (#17668) 2022-03-10 13:53:57 +08:00
0115b3f023 Merge pull request #16336 from kylo252/vim-8.1.2005
vim-patch:8.1.{2005,2010}: the regexp.c file is too big
2022-03-10 12:49:31 +08:00
d6fe06b0a6 Merge pull request #17666 from zeertzjq/api-statusline-fillchar-relax
feat(api): relax statusline fillchar width check
2022-03-10 10:39:14 +08:00
4fed1bf7e5 vim-patch:8.1.2005: the regexp.c file is too big
Problem:    The regexp.c file is too big.
Solution:   Move the backtracking engine to a separate file. (Yegappan
            Lakshmanan, closes vim/vim#4905)
6d7d7cf750

vim-patch:8.1.2010: new file uses old style comments

Problem:    New file uses old style comments.
Solution:   Change to new style comments. (Yegappan Lakshmanan, closes vim/vim#4910)
9490b9a61c
2022-03-10 10:09:28 +08:00
3011794c86 feat(api): relax statusline fillchar width check
Treat fillchar as single-width even if it isn't.
2022-03-10 07:40:52 +08:00
5ed60804fe feat(lua): handle lazy submodules in :lua vim. wildmenu completion 2022-03-09 15:25:06 +01:00
a978d7689d Merge pull request #17640 from lewis6991/virttextfix
fix(extmarks): fix signs
2022-03-09 13:41:13 +01:00
14859f49ae Merge pull request #17600 from kylo252/clang-format-update
chore: align clang-format configuration with clint
2022-03-09 19:54:30 +08:00
ac91c56085 chore: align clang-format configuration with clint
Some additional tweaks to make clang-format more compatible with
`clint.py` rules.
This is especially useful for range-formatting with `clangd`.
2022-03-09 19:44:03 +08:00
d2d64b1f72 Merge pull request #17643 from dundargoc/chore/remove-stripdecls
chore(stripdecls): remove unused and no longer functional script
2022-03-09 11:41:45 +01:00
c7512611bf Merge pull request #17502 from zeertzjq/vim-8.1.0999
vim-patch:8.1.0999: use register one too often and not properly tested
2022-03-09 16:55:07 +08:00
46a0cec3a6 chore(stripdecls): remove unused and no longer functional script 2022-03-09 09:30:26 +01:00
05f643f9d2 chore(lgtm): fix "empty block without comment" warnings 2022-03-09 09:29:57 +01:00
f27068caad chore(lgtm): ignore "__eq__ not overridden" warning 2022-03-09 09:29:57 +01:00
5ad63c3d98 Merge pull request #16730 from VVKot/vim-8.1.0136
vim-patch:8.1.{136, 139, 164, 300, 672, 748}
2022-03-09 16:13:20 +08:00
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
a681b5eaca vim-patch:partial 1588bc8ebee2 (#17656)
Update runtime files
1588bc8ebe

omit: doc updates
2022-03-09 08:40:16 +01:00
5ac30eacf4 vim-patch:8.1.0999: use register one too often and not properly tested
Problem:    Use register one too often and not properly tested.
Solution:   Do not always use register one when specifying a register.
            (closes vim/vim#4085)  Add more tests.
9d7fdd403a
2022-03-09 13:32:50 +08:00
f6d507f5ba refactor(ops): use op_yank_reg() instead of op_yank() when deleting
Needed for Vim patch 8.1.0999.
2022-03-09 10:02:16 +08:00
ee903e86fd vim-patch:8.1.0748: using sprintf() instead of semsg()
Problem:    Using sprintf() instead of semsg().
Solution:   Use semsg().  Fix bug with E888. (Ozaki Kiichi, closes vim/vim#3801)
1be45b2ea7

vim-patch:8.1.0136: Lua tests don't cover new features

Problem:    Lua tests don't cover new features.
Solution:   Add more tests. (Dominique Pelle, closes vim/vim#3130)
2f362bf7f9

vim-patch:8.1.0139: Lua tests fail on some platforms

Problem:    Lua tests fail on some platforms.
Solution:   Accept a hex number with and without "0x". (Ken Takata,
            closes vim/vim#3137)
a8a60d0c6b

vim-patch:8.1.0164: luaeval('vim.buffer().name') returns an error

Problem:    luaeval('vim.buffer().name') returns an error.
Solution:   Return an empty string. (Dominique Pelle, closes vim/vim#3167)
fe08df452a

vim-patch:8.1.0300: the old window title might be freed twice

Problem:    The old window title might be freed twice. (Dominique Pelle)
Solution:   Do not free "oldtitle" in a signal handler but set a flag to have
            it freed later.
d8f0cef2bd

vim-patch:8.1.0672: the Lua interface doesn't know about v:null

Problem:    The Lua interface doesn't know about v:null.
Solution:   Add Lua support for v:null. (Uji, closes vim/vim#3744)
9067cd6cdf
2022-03-09 09:22:26 +08:00
205b3765f2 Merge pull request #17622 from dundargoc/refactor/clang-tidy/remove-redundant-casts
refactor/clang tidy/remove redundant casts
2022-03-09 08:15:18 +08:00
f33cea4682 Merge pull request #17505 from zeertzjq/vim-8.2.0997
vim-patch:8.2.0997: cannot execute a register containing line continuation
2022-03-09 06:54:35 +08:00
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
2ab2af598e fix(extmarks): fix signs
Don't add sign extmarks to state->active. Instead when drawing signs,
perform a full line scan for sign marks. This allows decor_redraw_line
to be moved back inside the `!number_only` block in screen.c, which
prevents decor scans when redrawing the number column when
'relativenumber' is set.

Fixes: #17638
2022-03-08 22:08:57 +00:00
f24121ad96 fix(line continuation): set growsize to correct value (#17655)
Using MAX always sets growsize to 8000, unless ga_len is larger...
2022-03-08 21:38:10 +00:00
4632729459 Merge pull request #17585 from zeertzjq/ci-freebsd-oldtests 2022-03-08 14:42:56 -05:00
4f007a7f65 fix: do not pass aucmd to the callback (#17650) 2022-03-08 16:27:11 +00:00
bce1fd2218 chore(aucmd): remove left-over debug log (#17649) 2022-03-08 12:56:45 +01:00
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
3cc48e6273 Merge pull request #17631 from zeertzjq/vim-8.2.4520
vim-patch:8.2.4520: using wrong highlight for cursor line number
2022-03-08 10:54:01 +08:00
2adc24b18b test: add a Lua screen test for CursorLineNr in diff mode
Remove a useless test added in #14190
2022-03-08 10:11:20 +08:00
ec3f93ff88 vim-patch:8.2.4520: using wrong highlight for cursor line number
Problem:    Using wrong highlight for cursor line number.
Solution:   Take filler lines into account when using CursorLineNr.
            (closes vim/vim#9897)
127969cf98
2022-03-08 10:09:22 +08:00
bcda54b30e Merge pull request #17642 from dundargoc/ci/macos/reduce-brew-output
ci(macos): minimize log output from brew update
2022-03-07 18:59:50 -05:00
917dfa510a ci(freebsd): enable oldtests 2022-03-08 07:00:40 +08:00
d15558bfa3 ci(macos): minimize log output from brew update
Also remove perl from brew install to prevent a warning that states it's
already installed.
2022-03-07 23:49:52 +01:00
8bae974da3 build(deps): bump tree-sitter to 0.20.6 (#17587) 2022-03-07 23:48:33 +01:00
c400688752 build(deps): bump libuv to 1.44.0 (#17613) 2022-03-07 22:49:35 +01:00
26e713797b Merge pull request #17635 from dundargoc/ci/freebsd/bump-to-latest 2022-03-07 16:47:14 -05:00
caffee0b67 Merge pull request #17641 from dundargoc/ci/document-jobs 2022-03-07 14:21:36 -05:00
57fee60c76 Merge pull request #17636 from bfredl/luacrash 2022-03-07 14:05:20 -05:00
242183585c ci: document the purpose of some non-obvious jobs 2022-03-07 14:18:11 +01:00
824f24a6b0 ci(freebsd): use image freebsd/latest 2022-03-07 12:21:43 +01:00
147908336e fix(lua): don't use nlua_error when exiting early
Screen state is not initialized yet. Print directly to stderr instead.
2022-03-07 11:04:36 +01:00
c3cc17f0e6 Merge pull request #17621 from bfredl/luaindex
refactor(lua): make vim submodule lazy loading declarative
2022-03-07 11:01:50 +01:00
5f3fff62a8 chore(flake): bump flake (#17632)
it was 6 months old
2022-03-07 10:57:08 +01:00
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
5760cf87b6 Merge pull request #17626 from dundargoc/ci/openbsd/bump-to-latest
ci(openbsd): use latest image
2022-03-06 20:06:36 -05:00
a7c999523d Merge pull request #17630 from kchibisov/fix-underline-regression
fix(api): highlight attribute for underline
2022-03-06 18:43:02 -05:00
40e3668e54 Merge pull request #17616 from zeertzjq/vim-8.2.3739
vim-patch:8.2.{3739,3745,3920,4060,4513}
2022-03-07 07:10:48 +08:00
194411d18a test: add a test for #17609 2022-03-07 06:43:03 +08:00
0442635a50 test(autochdir_spec): use better patterns 2022-03-07 06:43:03 +08:00
eb70540ff0 vim-patch:8.2.4513: window-local directory is not applied if 'acd' fails
Problem:    Window-local directory is not applied if 'acd' fails.
Solution:   Don't call do_autochdir(). (closes vim/vim#9891)
b29ae15977
2022-03-07 06:43:03 +08:00
8e06377bc6 vim-patch:8.2.4060: win_execute() slow on systems where getcwd()/chdir() is slow
Problem:    win_execute() is slow on systems where getcwd() or chdir() is
            slow. (Rick Howe)
Solution:   Avoid using getcwd() and chdir() if no local directory is used and
            'acd' is not set. (closes vim/vim#9504)
d6f27c66cc
2022-03-07 06:43:03 +08:00
da9bc96152 vim-patch:8.2.3920: restoring directory after using another window is inefficient
Problem:    Restoring directory after using another window is inefficient.
Solution:   Only restore the directory for win_execute().  Apply 'autochdir'
            only when needed.
90c317f224
2022-03-07 06:43:03 +08:00
1a5409db0d vim-patch:8.2.3745: autochdir test fails without the +channel feature
Problem:    Autochdir test fails without the +channel feature.
Solution:   Remove the ch_logfile() call. (Dominique Pellé, closes vim/vim#9281)
f661cee847
2022-03-07 06:43:03 +08:00
8262de0b48 vim-patch:8.2.3739: in wrong directory when using win_execute() with 'acd' set
Problem:    In wrong directory when using win_execute() with 'acd' set.
Solution:   Restore the directory when returning to the window. (closes vim/vim#9276)
dea4a61637
2022-03-07 06:43:03 +08:00
04ae502691 ci(openbsd): use latest image 2022-03-06 23:02:28 +01:00
ff032f2710 refactor: remove redundant casts 2022-03-06 23:02:10 +01:00
918ab6bf00 ci(clint): remove "Unknown NOLINT error category" warning
Clang-tidy also uses "NOLINT" to suppress warnings which causes a
conflict.
2022-03-06 23:02:10 +01:00
8e7446b3cb refactor(signcol): smarter invalidation (#17533)
Previously b_signcols was invalidated whenever a sign was added/removed
or when a buffer line was added/removed.

This change introduces a sentinel linenr_T into the buffer state which
is a line number used to determine the signcolumn. With this
information, we can invalidate the signcolumn less often. Now the
signcolumn is only invalidated when a sign or line at the sentinel line
number is removed.
2022-03-06 22:45:26 +01:00
5400017020 Merge pull request #17628 from jamessan/bsd-gdb
ci(bsd): install gdb to get backtraces from cores
2022-03-06 16:09:39 -05:00
96bb1784a6 fix(api): highlight attribute for underline
This commit fixes regression introduced in c365de1 when checking for
highlight attribute for underline was returning '0' when it was present

Fixes #17624.
2022-03-06 23:51:25 +03:00
0b53645596 test(sr.ht): skip luamod-dev test which crashes nvim 2022-03-06 15:44:54 -05:00
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
ee1112f1b7 ci(bsd): install gdb to get backtraces from cores 2022-03-06 13:58:21 -05:00
3800615da9 fix(lsp): handle insertion of previous line (#17618) 2022-03-06 07:52:11 -08:00
24d56116f7 Merge pull request #17623 from zeertzjq/lua-editor-mentions
docs(lua): reference runtime/lua/vim/_editor.lua
2022-03-06 23:05:44 +08:00
80e6f81862 docs(lua): reference runtime/lua/vim/_editor.lua 2022-03-06 22:32:22 +08:00
72a04bda90 Merge pull request #16897 from lewis6991/signs
feat(decorations): support signs
2022-03-06 14:09:01 +01:00
8ed9c84481 Merge pull request #17597 from dundargoc/build/cmake/fix-warnings
fix cmake warnings
2022-03-05 15:02:01 -05:00
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
d557a45571 Merge pull request #17538 from dundargoc/refactor/bugprone-signed-char-misuse
refactor: fix clang-tidy bugprone-signed-char-misuse warnings
2022-03-05 19:39:36 +01:00
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
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
30e4cc3b3f feat(decorations): support signs
Add the following options to extmarks:
  - sign_text
  - sign_hl_group
  - number_hl_group
  - line_hl_group
  - cursorline_hl_group

Note: ranges are unsupported and decorations are only applied to
start_row
2022-03-05 16:51:59 +00:00
7fd1182c62 fix: bounds check for underdot 2022-03-05 19:16:14 +03:00
228ea78622 Merge pull request #17611 from zeertzjq/vim-patch-pr-args
feat(vim-patch.sh): support additional args for -s
2022-03-05 11:04:30 -05:00
fff527b88d test(strcase_save): test overlong UTF8-encoding 2022-03-05 16:40:03 +01:00
0ec92bb463 feat(vim-patch.sh): support additional args for -s
This allows creating a draft vim-patch PR.
2022-03-05 10:12:17 +08:00
4d2744ffe3 refactor: fix clang-tidy bugprone-signed-char-misuse warnings
Prefer to declare variables with correct type instead of explicit casts
wherever possible.
2022-03-04 19:52:41 +01:00
eb4ae060bc build(cmake): remove unused variable CMAKE_CXX_COMPILER to fix warning 2022-03-04 19:21:35 +01:00
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
6379389cbb build(cmake): fix policy warning 2022-03-04 17:16:40 +01:00
83fc914337 Merge pull request #17601 from dundargoc/revert/libuv 2022-03-04 11:04:17 -05:00
f9a8a811c7 revert: "build(deps): bump libuv to 1.43.0+7ae0c95"
This reverts commit 2da9450de5.
2022-03-04 16:24:17 +01:00
6795c9772b fix(syntax): remove trailing spaces in vim.vim 2022-03-04 15:35:44 +03:00
6b6e64dfeb Merge pull request #17598 from dundargoc/ci/reviewer/update-reviewers
ci(reviews): update reviewers
2022-03-04 06:18:14 -05:00
b842f5491f ci(reviews): update reviewers 2022-03-04 11:28:32 +01:00
ead0a5a464 Merge pull request #17596 from zeertzjq/autocmd-comment
chore(autocmd): move comment to the right place
2022-03-04 17:14:52 +08:00
08cf3fb099 chore(autocmd): move comment to the right place 2022-03-04 16:39:55 +08:00
d5bd7ffe51 fix(autocmd): clean up autocmds only when needed (#17593) 2022-03-04 09:25:09 +01:00
4472820182 fix(docs): spelling in new underlines docs 2022-03-04 00:35:51 +03:00
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
e23af71d35 Merge pull request #17567 from bfredl/preload
refactor(lua): regularize builtin modules, phase 1
2022-03-03 21:00:00 +01:00
f9faba88fd refactor(lua): reorganize builtin modules, phase 1 2022-03-03 20:03:30 +01:00
13cabfedb2 Merge pull request #17568 from groves/respect_os_proc_children_rv 2022-03-03 12:27:37 -05:00
0733f72616 Merge pull request #17564 from dundargoc/ci/freebsd/remove-deprecated-port
ci(freebsd): remove deprecated package sha to fix warning
2022-03-03 10:32:52 -05:00
e8d047df81 Merge pull request #17591 from zeertzjq/vim-8.2.4498
vim-patch:8.2.4498: using <Plug> with "noremap" does not work
2022-03-03 23:18:46 +08:00
ff20d9b106 Merge pull request #17590 from bfredl/cbfree
refactor(autocmd): simplify check for freed callback
2022-03-03 15:41:38 +01:00
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
dcd03f5d9d refactor(autocmd): simplify check for freed callback
When a callback is freed the type is always set to kCallbackNone.
2022-03-03 14:29:26 +01:00
7211d8ef21 Merge pull request #17584 from zeertzjq/test-pending-win32
test: use helpers.pending_win32(pending) in buffer_updates_spec
2022-03-03 16:39:24 +08:00
f8b3a1691f test: use helpers.pending_win32(pending) in buffer_updates_spec 2022-03-03 16:07:39 +08:00
f9db491a64 Merge pull request #17583 from zeertzjq/test-old-missing
test(old): add more missing test files and run more tests alone
2022-03-03 13:52:49 +08:00
78bb8c4ee7 test(old): add more missing test files and run more tests alone
Copy four files from Vim v8.2.1432.
Try to match Vim's test_alot.vim.
This marks Vim patch 8.2.0164 as ported:

vim-patch:8.2.0164: test_alot takes too long

Problem:    Test_alot takes too long.
Solution:   Run several tests individually.
842931cd7a
2022-03-03 13:23:08 +08:00
5d6006f9bf feat(diagnostic): add "code" to the diagnostic structure (#17510) 2022-03-02 18:42:27 -07:00
051a0514dc Merge pull request #17579 from zeertzjq/ci-win-fail
ci: show failed message on Windows
2022-03-02 20:21:13 -05:00
f015994a42 Merge pull request #17571 from zeertzjq/pvs-autocmd
Some clang and PVS fixes
2022-03-03 08:25:28 +08:00
1495c4d166 ci: show failed message on Windows 2022-03-03 08:16:31 +08:00
85de9b06ed Merge pull request #17578 from zeertzjq/test-warning-poke
test: mention poke_eventloop() instead of wait()
2022-03-03 06:23:10 +08:00
d477788cd5 fix(lsp): respect all of 'fixeol', 'eol', and 'binary' applying edits (#17574) 2022-03-02 11:33:02 -08:00
482ea0cc17 Merge pull request #17575 from zeertzjq/pty-did-eof
fix(pty_process_win/wait_eof_timer_cb): also check for proc->out.did_eof
2022-03-02 11:57:19 -05:00
ede4eac61f test: mention poke_eventloop() instead of wait() 2022-03-02 22:31:20 +08:00
bc04c3d1ba revert: "ci(windows): skip oldtest on windows until failing tests are fixed"
This reverts commit 07d3fb6e3b.
2022-03-02 21:28:41 +08:00
4154bf9b59 fix(pty_process_win/wait_eof_timer_cb): also check for proc->out.did_eof 2022-03-02 21:28:36 +08:00
0e02a5f109 Merge pull request #17572 from bfredl/testfix
fix(test): only use buffer completion in popupmenu timer test
2022-03-02 10:38:37 +01:00
5ecb2cb539 fix(test): only use buffer completion in popupmenu timer test 2022-03-02 09:15:49 +01:00
3763d7d2d5 refactor(clang): dead assignment buflocal_nr = 0 2022-03-02 15:17:50 +08:00
8ba47a6457 refactor(PVS/V547): aucmd.type == CALLABLE_NONE is always false 2022-03-02 15:14:52 +08:00
22d1b2423f refactor(PVS/V560): ap == NULL is always false 2022-03-02 15:14:11 +08:00
4b3f920477 Merge pull request #16804 from zeertzjq/ui-aucmd-docs
docs: clarify UIEnter and UILeave docs
2022-03-02 15:05:19 +08:00
4c24fcb91f Merge pull request #17570 from zeertzjq/pvs-autocmd-header
chore(PVS): add PVS header to api/autocmd.c
2022-03-02 09:02:28 +08:00
55a189583e chore(PVS): add PVS header to api/autocmd.c 2022-03-02 08:50:15 +08:00
1fdf903911 Merge pull request #17569 from zeertzjq/test-mapping
test: move two mapping tests to ex_cmds/map_spec.lua
2022-03-02 08:45:41 +08:00
9a5a3c699e test: move two mapping tests to ex_cmds/map_spec.lua 2022-03-02 08:15:29 +08:00
045422e4a0 fix: respect os_proc_children rv of pid not found
os_proc_children returns 2 if there's a failure in the underlying
syscall. Only shell out to pgrep in that case.

It returns 1 if the pid isn't found. In that case, we can roll forward
with returning an empty list.
2022-03-01 16:13:23 -05:00
ed1a9c310d fix: enable filetype detection and syntax highlighting with --clean (#17566)
--clean is supposed to emulate a "fresh install" and since Neovim
enables filetype detection and syntax highlighting by default, these
should be enabled when using --clean as well.
2022-03-01 10:47:20 -07:00
770b9f3c3b Merge pull request #17542 from dundargoc/ci/skip-oldtest-on-windows 2022-03-01 11:37:50 -05:00
07d3fb6e3b ci(windows): skip oldtest on windows until failing tests are fixed
The oltests hang on windows, making all CI runs fail.
2022-03-01 17:03:13 +01:00
7737a273b2 ci(freebsd): remove deprecated package sha to fix warning
It's already included by default, no need to replace it.
2022-03-01 15:20:36 +01:00
a7bc3e0f7b Merge pull request #17556 from zeertzjq/remove-unused-k-aucmd-special
refactor: remove unused K_AUCMD_SPECIAL
2022-03-01 13:16:45 +01:00
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
37a86a2f96 fix(api): include event in get_autocmds (#17553) 2022-03-01 09:07:41 +01:00
01139ec82c Merge pull request #17557 from zeertzjq/clarify-plug
docs: clarify actual behavior of <Plug>
2022-03-01 09:44:40 +08:00
0cb9a577ed docs: clarify actual behavior of <Plug> 2022-03-01 09:28:27 +08:00
fed515d9e7 refactor: remove unused K_AUCMD_SPECIAL 2022-03-01 07:32:04 +08:00
cf0266fae1 Merge pull request #17551 from bfredl/lua_autocmd_rebase
feat(lua_autocmd): episode III (the autocmds strike back)
2022-02-28 20:57:24 +01:00
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
6732cd9e57 Merge pull request #17529 from seandewar/api-string-oopsie
fix(api): convert blob to NUL-terminated API string
2022-02-28 14:59:52 +01:00
cca08d0f3b Merge pull request #17476 from dundargoc/test/emmylua
test: correct emmylua annotations
2022-02-28 21:21:41 +08:00
7b6ee3ef0a fix: anonymous sid not working 2022-02-28 19:18:49 +06:00
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
e383543342 Merge pull request #17544 from r0x0d/update-readme-for-fedora-link
Fix fedora broken link
2022-02-28 09:38:00 +08:00
43c495b183 docs: fix fedora broken link in readme
The link to the neovim fedorapackage.org in the README.md was broken.

Signed-off-by: Rodolfo Olivieri <rodolfo.olivieri3@gmail.com>
2022-02-27 22:19:16 -03:00
fad33b095f Merge pull request #14661 from tjdevries/tjdevries/lua_autocmd_v2
lua: autocmds take 2: electric autoroo
2022-02-28 00:07:31 +01:00
991e472881 feat(lua): add api and lua autocmds 2022-02-27 22:04:55 +01:00
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
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
243869658e Merge pull request #17540 from jamessan/luv-bump-fix
ci(lint): use bundled luv until system packages are updated
2022-02-27 09:16:50 -05:00
97ed3effff ci(lint): re-add building of third-party 2022-02-27 09:07:11 -05:00
8d8288461a ci(lint): use bundled luv until system packages are updated 2022-02-27 09:07:11 -05:00
55ab76a1c0 build: bump minimum version of luv to 1.43.0
This is required for the recent addition of lua loop threading
(luv_set_thread).
2022-02-27 09:06:55 -05:00
9d3370a144 vim-patch:c51cf0329809 (#17530)
Update runtime files.
c51cf03298
2022-02-27 11:56:30 +01:00
7dd2b0b79a Merge pull request #17386 from bfredl/neothread
support threads in lua
2022-02-27 09:41:02 +01:00
8bf3a3e303 Merge pull request #17432 from zeertzjq/vim-8.1.2336
vim-patch:8.1.2336,8.2.{4338,4401}: mapping cursor and redrawing patches
2022-02-27 10:51:11 +08:00
c031e038df chore: remove <Plug> detection from vim.keymap 2022-02-27 08:21:21 +06:00
0347875a5c feat: ignore nore on <Plug> maps 2022-02-27 08:21:21 +06:00
84812bcc2c Merge pull request #17531 from dundargoc/refactor/coverity/big-parameter-passed-by-value 2022-02-26 19:41:22 -05:00
e47cdb4268 Merge pull request #17535 from dundargoc/test/ci-fold 2022-02-26 19:39:51 -05:00
24557a7f63 test(ci): remove non-existent ci-fold from tests 2022-02-27 01:02:58 +01:00
525a3a90bc Merge pull request #17525 from lf-/hardcopy-truecolor
feat(hardcopy): check gui colours for highlights first
2022-02-26 23:57:27 +01:00
da89725f34 fix(coverity/175977): big parameter passed by value 2022-02-26 21:46:05 +01:00
c26ef6bcd4 Merge pull request #17532 from dundargoc/ci/add-timeout
ci: add timeout to all jobs
2022-02-26 12:32:37 -05:00
80c3d042ed ci: add timeout to all jobs 2022-02-26 16:57:47 +01:00
f6cc604af2 fix(api): convert blob to NUL-terminated API string
Looks like I did an oopsie; although API strings carry a size field, they should
still be usable as C-strings! (even though they may contain embedded NULs)
2022-02-26 14:18:34 +00:00
850b3e19c9 refactor(lua): cleanup and docs for threads 2022-02-26 15:00:13 +01:00
639ec044b7 Merge pull request #16845 from seandewar/floaty-aucmd-win
fix(aucmd_win): ensure aucmd_win stays floating
2022-02-26 14:53:50 +01:00
4b834a9f7c Merge pull request #17414 from zeertzjq/api-set-cursor-redraw
fix(api): nvim_win_set_cursor() redraw for cursorline and statusline
2022-02-26 14:52:24 +01:00
634c3addd2 Merge pull request #17337 from dundargoc/refactor/pvs/v560
refactor(PVS/V560): part of conditional expression is always true/false
2022-02-26 14:48:12 +01:00
41f309adeb Merge pull request #17527 from zeertzjq/test-pending-win32
test: use helpers.pending_win32(pending) instead of iswin()
2022-02-26 21:17:38 +08:00
acf38245d8 refactor(lua): use references directly on main thread 2022-02-26 14:01:38 +01:00
b87867e69e feat(lua): add proper support of luv threads 2022-02-26 14:01:38 +01:00
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
2703cf95dd Merge pull request #17219 from clason/bump-luvit
build(deps): bump libuv and luv
2022-02-26 14:00:46 +01:00
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
8dd3d40f5c Merge pull request #17472 from lewis6991/signcol_improvements
signcol improvements
2022-02-26 13:37:01 +01:00
0545bd2180 test: use helpers.pending_win32(pending) instead of iswin() 2022-02-26 19:40:11 +08:00
2da9450de5 build(deps): bump libuv to 1.43.0+7ae0c95 2022-02-26 12:06:02 +01:00
b857bc770b build(deps): bump luv to 1.43.0-0 2022-02-26 12:00:45 +01:00
e5b5cbd19c feat(hardcopy): check gui colours for highlights first
Previously, :hardcopy would only use terminal highlight colours, with a
fixed mapping table, despite internally supporting true colour. This
patch looks at the guifg colour first while coming up with the printing
highlight colours, then falls back to the terminal ones.

I have passed through the modec argument in this change because it was
there before, but it could be deleted and hardcoded to 'c' since nobody
sets it to anything else anywhere.
2022-02-25 18:51:16 -08:00
005a7aa167 Merge pull request #17467 from dundargoc/ci/remove-failing-windows
ci: remove failing windows CI tests
2022-02-25 07:10:29 -05:00
81bffbd147 feat: call __tostring on lua errors if possible before reporting to user 2022-02-25 11:17:58 +11:00
9d53791cf8 fix(signcol): update cursor when signcol changes
Fixes #14195
2022-02-24 22:36:00 +00:00
eb6e5d0991 refactor(signcol): store signcol in win_T 2022-02-24 22:36:00 +00:00
e67cd22c38 fix(signcol): handle edge case with maximum value
50250542 failed to consider that the maximum passed to buf_signcols
is window scoped whereas the signcols value is buffer scoped. This can
lead to a bug where the signcolumn becomes incorrect if:
- global signcolumn is set to auto:N
- signcolumn in a window is changed locally to auto:M where M > N
- the buffer has a line with M or greater signs.
2022-02-24 22:35:59 +00:00
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
b5bf4877c0 feat(highlight): support for blend in nvim_set_hl (#17516) 2022-02-24 09:50:05 -07:00
73da7cef7b Merge pull request #17390 from RenFraser/feature/packaging
ci: improve cpack packaging
2022-02-24 06:46:07 -05:00
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
087aad3dcd ci: improved cpack packaging
Addresses: #12571

- Added the following installers through CMake files:
    - Windows NSIS.
    - Windows MSI.
    - Windows zip.
    - MacOs tarball.
    - Linux tarball.
    - Linux Deb package.
- Tweaked pipeline CPack commands to build using new CMakeLists.txt configuration file.
- Added icons and relevant packaging files.
- Updated notes.md to reflect new installation instructions.

This isn't meant to be the perfect solution, it's simply a first pass at using a
simple packaging system to build Windows installers. A Debian package has also
been added since it's very easy but other packages have been left out due to
limiting the scope. Hopefully we can build further upon this and improve it
over time with code signing, better icons and more user-friendly installation
graphics and so on.
2022-02-24 19:54:44 +10:00
15004473b5 fix(api)!: correctly handle negative line numbers for nvim_buf_set_text (#17498)
nvim_buf_set_text does not handle negative row numbers correctly: for
example,

    nvim_buf_set_text(0, -2, 0, -1, 20, {"Hello", "world"})

should replace the 2nd to last line in the buffer with "Hello" and the
first 20 characters of the last line with "world". Instead, it reports
"start_row out of bounds". This happens because when negative line
numbers are used, they are incremented by one additional number to make
the non-negative line numbers end-exclusive. However, the line numbers
for nvim_buf_set_text should be end-inclusive.

In #15181 we handled this for nvim_buf_get_text by adding a new
parameter to `normalize_index`. We can solve the problem with
nvim_buf_set_text by simply availing ourselves of this new argument.

This is a breaking change, but makes the semantics of negative line
numbers much clearer and more obvious (as well as matching
nvim_buf_get_text).

BREAKING CHANGE: Existing usages of nvim_buf_set_text that use negative
line numbers will be off-by-one.
2022-02-23 22:19:47 +00:00
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
430371da5b refactor(aucmd_win): remove need to restore window layout
There are some places that mess with the window layout in preparation for moving
a window to a different split (win_split_ins called with new_wp != NULL).

This means the window layout can change slightly even if win_split_ins fails.

This is why it was still needed to restore the window layout in
aucmd_{prep,rest}buf even if we disallow win_split_ins from making aucmd_win
non-floating by moving it into a split.

We can just skip messing with the layout in such places if we're dealing with
the aucmd_win.
2022-02-23 00:13:17 +00:00
2deffb5ea8 fix(aucmd_win): ensure aucmd_win stays floating
Nvim uses a floating window for the autocmd window, but in certain situations,
it can be made non-floating (`:wincmd J`), which can cause issues due to the
previous setup and cleanup logic for a non-floating aucmd_win being removed from
aucmd_prepbuf and aucmd_restbuf.

This can cause glitchiness and crashes due to the aucmd_win's frame being
invalid after closing its tabpage, for example.

Ensure aucmd_win cannot be made non-floating. The only place this happens is in
win_split_ins if new_wp != NULL.
2022-02-23 00:09:27 +00:00
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
30c9c8815b vim-patch:partial 944697ae1968 (#17490)
Update runtime files
944697ae19

skip: docs
skip: translations
2022-02-21 23:01:22 +01:00
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
1e7cb2dcd9 fix(highlight): accept NONE as a color name (#17487)
... for when `ns=0`.

Also update the documentation of nvim_set_hl to clarify the set
behaviour.

Fixes #17478
2022-02-21 13:17:36 -07:00
fc7fc14bd2 Merge pull request #17484 from dundargoc/ci/skip-ci-on-doc-changes
ci: skip ci workflow on only documentation changes
2022-02-21 06:39:59 -05:00
07a5a85323 ci: skip ci workflow on only documentation changes 2022-02-21 10:12:07 +01:00
726ec7fb17 Merge pull request #17403 from zeertzjq/vim-8.1.1955
vim-patch:8.1.{1846,1955},8.2.0156
2022-02-21 08:02:45 +08:00
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
9fa46d3fd4 Merge pull request #17480 from zeertzjq/vim-8.2.4427
vim-patch:8.2.4427: getchar() may return modifiers if no character is available
2022-02-21 06:46:59 +08:00
3828fb7ea4 vim-patch:8.2.4427: getchar() may return modifiers if no character is available
Problem:    getchar() may return modifiers if no character is available.
Solution:   Do not process modifiers when there is no character. (closes vim/vim#9806)
ad6c45f625
2022-02-21 06:06:01 +08:00
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
864e51a1dd test: correct emmylua annotations
This will fix the warnings sumneko language server outputs.
2022-02-20 21:14:27 +01:00
6a3acccd8b fix(lsp): use botright copen for all handlers (#17471) 2022-02-20 11:09:01 -08:00
4b3fb4b177 Merge pull request #17469 from jamessan/use-sysdeps-for-lint-ci
Use system dependencies for lint CI
2022-02-20 07:35:35 -05:00
13b13dcaa0 Merge pull request #17470 from dundargoc/ci/remove-success
ci: remove success check since it's the default
2022-02-20 07:34:50 -05:00
4ea8201356 ci: remove success check since it's the default 2022-02-20 13:17:55 +01:00
82c5a02050 ci: skip tests that fail on windows 2022-02-20 10:22:39 +01:00
2550212b25 ci(win): use vswhere to automatically setup required vsdev env vars 2022-02-20 10:18:45 +01:00
921162a4b1 ci: bump Windows image to windows-2019
The VS 2019 CMake generator no longer has different generator types for
different architectures.  Now, the architecture is specified via CMake's
`-A` switch.  However, this requires we also propagate
`${CMAKE_GENERATOR_PLATFORM}` to the bundled deps, so they build for the
same architecture as Nvim.
2022-02-20 10:18:45 +01:00
2446b25c6b ci: only cache third-party deps if they exist 2022-02-19 20:36:29 -05:00
0adbe58bb2 ci: ensure ~/.cache exists 2022-02-19 20:36:29 -05:00
0c4c384ed1 ci(lint): explicity build nvim
“make clint-full” bypasses the normal mechanisms used to communicate
build flags in the CI jobs, so explicitly build nvim before running the
lint jobs.
2022-02-19 20:35:05 -05:00
34cb26011e ci(lint): build against system deps 2022-02-19 20:35:04 -05:00
8cd4c11494 ci(lint): install deps via apt instead of building from third-party 2022-02-19 20:35:04 -05:00
8b3799e2c3 Merge pull request #17460 from seandewar/vim-8.2.4419
vim-patch:8.2.{4403,4418,4419,4422}
2022-02-19 22:59:15 +00:00
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
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
9c04285057 vim-patch:8.2.4422: autochdir test fails on MS-Windows
Problem:    Autochdir test fails on MS-Windows.
Solution:   Expecta nother error on MS-Windows.
adbb383e0f
2022-02-19 15:55:17 +00:00
73cc729dbc vim-patch:8.2.4419: illegal memory access when using 20 highlights
Problem:    Illegal memory access when using exactly 20 highlights.
Solution:   Add one more item in the array. (Brandon Richardson,
            closes vim/vim#9800)
a493b6506b
2022-02-19 15:29:17 +00:00
9f4401897a vim-patch:8.2.4418: crash when using special multi-byte character
Problem:    Crash when using special multi-byte character.
Solution:   Don't use isalpha() for an arbitrary character.
5921aeb574

Rename vim_isalpha to mb_isalpha.
2022-02-19 15:29:17 +00:00
30bf40ec4b vim-patch:8.2.4403: ml_get error with nested folds and deleting lines
Problem:    ml_get error with nested folds and deleting lines.
Solution:   Correct the last line number before calling hasFoldingWin().
9437737833
2022-02-19 15:29:17 +00:00
5cb45dffba Merge pull request #17454 from dundargoc/ci/labeler/test
ci(labeler): change "tests" to "test"
2022-02-18 16:55:41 -05:00
f7803c82d4 ci(labeler): change "tests" to "test" 2022-02-18 20:23:22 +01:00
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
5064ff126d Merge pull request #17200 from lewis6991/_loadfile
refactor(lua): call `loadfile` internally instead of `luaL_loadfile`
2022-02-18 15:05:50 +01:00
720bb5844d Merge pull request #17445 from dundargoc/ci/review/use-checkout 2022-02-18 08:36:45 -05:00
ac480ef6b4 Merge pull request #17404 from dundargoc/ci/put-each-test-in-separate-step
ci: run each test suite in a separate github step
2022-02-18 06:42:32 -05:00
3fb9987eef Merge pull request #17450 from dundargoc/ci/lint/fix-key
ci(lint): simplify cache key
2022-02-18 06:14:53 -05:00
40473e55a2 ci(lint): simplify cache key 2022-02-18 11:50:51 +01:00
adad10284d refactor(lua): call loadfile internally
.. instead of luaL_loadfile

allows files to be cached
2022-02-18 10:39:45 +00:00
8b92d71b30 ci: run each test suite in a separate github step
This should help combat some of the lagginess when looking at the CI
logs in the browser.
2022-02-18 11:36:30 +01:00
faeff49cbf Merge pull request #17449 from zeertzjq/vim-8.2.3659
vim-patch:8.2.{3659,3660,3661}: integer overflow with large line number
2022-02-18 10:15:08 +08:00
62a1290758 vim-patch:8.2.3661: test for put with large count fails
Problem:    Test for put with large count fails.
Solution:   Adjust the counts in the test.
8bc07e800c
2022-02-18 09:48:35 +08:00
330b3da51e vim-patch:8.2.3660: overflow check uses wrong number
Problem:    Overflow check uses wrong number.
Solution:   Divide by ten.
9b0e82f35e
2022-02-18 09:48:32 +08:00
3ed800e998 vim-patch:8.2.3659: integer overflow with large line number
Problem:    Integer overflow with large line number.
Solution:   Check for overflow. (closes vim/vim#9202)
03725c5795

Put E1247 in globals.h as E1240 is also there.
Do not make getdigits() abort.
2022-02-18 09:48:00 +08:00
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
1d0e38e42c ci: download reviews.js through checkout instead of wget
This makes testing the workflows much smoother.
2022-02-17 23:30:22 +01:00
df0fae2ff7 Merge pull request #17430 from dundargoc/test/remove-travis 2022-02-17 17:25:58 -05:00
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
d1e3d8abd6 Merge pull request #17427 from dundargoc/ci/lint/remove-unnecessary-steps 2022-02-17 16:54:11 -05:00
f3e6cc1a23 test: remove checks to see if current CI job is travis or appveyor 2022-02-17 22:43:48 +01:00
58a55e3889 ci(lint): remove unnecessary steps 2022-02-17 22:38:54 +01:00
387f6a9824 Merge pull request #17442 from dundargoc/ci/refactor/move-reviews 2022-02-17 15:56:47 -05:00
3b5d456d3c Merge pull request #17444 from clason/hl-empty-cterm
fix(api): allow empty list for cterm in nvim_set_hl
2022-02-17 19:37:45 +01:00
e35a2d86fc fix(api): allow empty list for cterm in nvim_set_hl
Problem: when accessing `nvim_set_hl` from Lua, empty tables are converted
to empty lists, not dictionaries, resulting in an error for

    :lua vim.api.nvim_set_hl(0, "Comment", { cterm = {} })

Workaround: add an empty array as a special case when checking
`dict->cterm.type` and just set `cterm_mask_provided`.

(Proper solution: handle this in `gen_api_dispatch.lua`.)
2022-02-17 18:07:11 +01:00
41d0e7af20 vim-patch:8.2.3601: check for overflow in put count does not work well
Problem:    Check for overflow in put count does not work well.
Solution:   Improve the overflow check. (Ozaki Kiichi, closes vim/vim#9102)
fa53722367

Add some casts as Nvim uses size_t variables in some places.

We could technically adjust the logic to check for overflow outside of size_t's
range, but it's much easier to just port the patch exactly (also means we can
use the same tests).

v:sizeoflong is N/A, so convert the 64-bit tests to Lua and use the FFI to check
long's size.
2022-02-17 17:06:16 +00:00
8170260bb3 fix(ops): str_to_reg passing NULL to memcpy
Required for the tests introduced in v8.2.3601 to pass ASAN when running
test_alot.vim.

Co-authored-by: erw7 <erw7.github@gmail.com>
2022-02-17 15:00:32 +00:00
308c1952aa vim-patch:8.2.3577: overflow check fails with 32 ints
Problem:    Overflow check fails with 32 ints.
Solution:   Only test with 64 bit ints.
0f0044125c
2022-02-17 14:45:23 +00:00
6890f8774b vim-patch:8.2.3575: overflow check still fails when sizeof(int) == sizeof(long)
Problem:    Overflow check still fails when sizeof(int) == sizeof(long).
Solution:   Use a float to check the result.
e551ccfb93

This approach is... interesting...

Tests fail.
2022-02-17 14:45:23 +00:00
de8e2c61c1 vim-patch:8.2.3574: divide by zero
Problem:    Divide by zero.
Solution:   Don't check for overflow if multiplicand is zero.
8a1962d135
2022-02-17 14:45:22 +00:00
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
a256b710a2 vim-patch:8.2.3570: Test_very_large_count fails on 32bit systems
Problem:    Test_very_large_count fails on 32bit systems.
Solution:   Bail out when using 32 bit numbers. (closes vim/vim#9072)
ec6e63079d
2022-02-17 14:45:22 +00:00
3fba994de8 vim-patch:8.2.3493: large count test fails on MS-Windows
Problem:    Large count test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
cddd5ac911
2022-02-17 14:45:21 +00:00
ac5856b3f5 vim-patch:8.2.3492: crash when pasting too many times
Problem:    Crash when pasting too many times.
Solution:   Limit the size to what fits in an int. (closes vim/vim#8962)
eeed1c7ae0

Note that this overflow check pretty bad.
It also doesn't work well on Windows (where sizeof(int) == sizeof(long)).
This is all temporary; everything here is rewritten in future patches anyway.

e_resulting_text_too_long was already cherry-picked.

totlen is size_t in Nvim, but is int in Vim. This means we'll need some casts.

We could technically adjust the logic in do_put to use the entire range of
size_t in stuff like totlen, but there's not much gain, and it's much easier to
just port the patch like Vim as was done before (also allows us to use the same
tests).
2022-02-17 14:45:21 +00:00
b877237612 ci(reviews): move reviews.js to .github/scripts 2022-02-17 14:48:14 +01:00
f4e24f1eab Merge pull request #17421 from lewis6991/hl0_clear
fix(highlight): global ns improvements
2022-02-17 14:07:42 +01:00
9938961fd8 test: add more tests for :*map cursor and redrawing 2022-02-17 10:07:42 +08:00
a92046e43f vim-patch:8.2.4401: map listing does not clear the rest of the command line
Problem:    Map listing does not clear the rest of the command line.
Solution:   Call msg_clear_eos(). (closes vim/vim#5623, closes vim/vim#5962)
d288eaad84
2022-02-17 08:45:15 +08:00
80a3018a09 test: add some tests for :*map <expr>
Add tests for:
 - Cursor position restored after :map expr
 - Cursor position restored after :imap expr
 - Error in :cmap expr handled correctly

Cherry-picked from #12837
2022-02-17 08:45:15 +08:00
2ffe66a5a4 vim-patch:8.2.4338: an error from an expression mapping messes up the display
Problem:    An error from an expression mapping messes up the display.
Solution:   When the expression results in an empty string return K_IGNORE.
            In cmdline mode redraw the command line. (closes vim/vim#9726)
74a0a5b26d
2022-02-17 08:45:14 +08:00
c90cf8c77b vim-patch:8.1.2336: when an expr mapping moves the cursor it is not restored
Problem:    When an expr mapping moves the cursor it is not restored.
Solution:   Position the cursor after an expr mapping. (closes vim/vim#5256)
4ebe0e62d0
2022-02-17 08:44:58 +08:00
3230b31486 Merge pull request #17431 from zeertzjq/vim-8.2.4345
vim-patch:8.2.4345
2022-02-17 06:53:15 +08:00
dc24eeb9fe feat(highlight): support color names for cterm 2022-02-16 22:48:34 +00:00
b94b116236 Merge pull request #17429 from zeertzjq/vim-8.2.4400
vim-patch:8.2.{4392,4394,4400}
2022-02-17 06:33:45 +08:00
7b048df4dc vim-patch:8.2.4345: <amatch> is expanded like a file name for DirChangedPre
Problem:    <amatch> is expanded like a file name for DirChangedPre.
Solution:   Do not expand <amatch>. (closes vim/vim#9742)  Also for the User event.
f6246f51e3
2022-02-17 06:19:10 +08:00
4646ea1079 Merge pull request #17363 from zeertzjq/dirchangedpre
feat(events): add DirChangedPre
2022-02-17 06:07:19 +08:00
9c5228f3e7 vim-patch:8.2.4400: MS-Windows: cannot use the mouse in the console with VIMDLL
Problem:    MS-Windows: cannot use the mouse in the console with VIMDLL.
Solution:   use add_char2buf() instead of fix_input_buffer(). (closes vim/vim#9784,
            closes vim/vim#9769)
646bb7247a

N/A patches for version.c:

vim-patch:8.2.4392: MS-Windows with VIMDLL: Escaping CSI is wrong

Problem:    MS-Windows with VIMDLL: Escaping CSI is wrong.
Solution:   Put back #ifdef. (Ken Takata, closes vim/vim#9769)
64d95cfc56

vim-patch:8.2.4394: UTF8 select mode test fails on MS-Windows

Problem:    UTF8 select mode test fails on MS-Windows.
Solution:   Revert the #ifdef change.
9fdde7992a
2022-02-17 06:02:55 +08:00
876aaf2003 fix(highlight): allow globals to be cleared
- and reduce heap allocations

Fixes #17420
2022-02-16 20:22:09 +00:00
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
9fe8d2c9df Merge pull request #16678 from lewis6991/runtime_file_err
fix(api): re-route nvim_get_runtime_file errors
2022-02-16 10:52:38 +01:00
0852644bee Merge pull request #17424 from zeertzjq/map-followup
follow-up PR to #17423
2022-02-16 17:32:37 +08:00
758f1e5999 refactor: remove NULL check that is always true 2022-02-16 17:01:35 +08:00
cc81a8253b docs: minor changes related to mapping description 2022-02-16 16:58:32 +08:00
9a74c2b04a feat(mappings): considering map description when filtering (#17423) 2022-02-16 16:39:50 +08:00
deb33a9775 Merge pull request #17422 from shadmansaleh/enhance/maps
fix: <Nop> not shown in :map commands
2022-02-16 16:01:17 +08:00
07a98b1a75 fix: <Nop> not shown in :map commands 2022-02-16 13:12:46 +06:00
f5518b78c8 chore: improve lua keymaps internal representation scheme 2022-02-16 11:20:10 +06:00
9ef5696132 Merge pull request #17418 from dundargoc/revert/ci/run-functionaltest-on-draft
revert: "ci: run functionaltest-lua on drafts as well"
2022-02-15 19:02:54 -05:00
d512be55a2 fix(api): re-route nvim_get_runtime_file errors
This allows nvim_get_runtime_file to be properly used via pcall
2022-02-15 23:00:28 +00:00
238b944e58 fix(api): validate command names in nvim_add_user_command (#17406)
This uses the same validation used when defining commands with
`:command`.
2022-02-15 13:08:40 -07:00
3449405f38 Merge pull request #17417 from zeertzjq/vim-8.2.4388
vim-patch:8.2.4388: dead code in op_insert()
2022-02-15 21:12:36 +08:00
a2c3d431d6 vim-patch:8.2.4388: dead code in op_insert()
Problem:    Dead code in op_insert().
Solution:   Remove condition and else block. (closes vim/vim#9782)
7745f14ef3
2022-02-15 21:07:01 +08:00
48108975c9 revert: "ci: run functionaltest-lua on drafts as well"
This reverts commit a91a5c1880.
2022-02-15 14:01:06 +01:00
0072a97b2e Merge pull request #17411 from zeertzjq/vim-8.2.3820
vim-patch:8.2.{3820,3823}: "vrc" does not replace composing characters
2022-02-15 20:36:01 +08:00
8cc881e4f4 Merge pull request #17412 from zeertzjq/vim-8.2.4154
vim-patch:8.2.4154: ml_get error when exchanging windows in Visual mode
2022-02-15 20:35:48 +08:00
e29ba986f5 Merge pull request #17409 from dundargoc/ci/disable-sync
ci(labeler): disable sync that interferes with other jobs
2022-02-15 06:15:15 -05:00
89bff49570 Merge pull request #17405 from dundargoc/ci/add-more-reviewers
ci: add more reviewers
2022-02-15 06:10:41 -05:00
f92e74900f fix(api): nvim_win_set_cursor() redraw for cursorline and statusline 2022-02-15 11:53:12 +08:00
6eec30ccfc vim-patch:8.2.4154: ml_get error when exchanging windows in Visual mode
Problem:    ml_get error when exchanging windows in Visual mode.
Solution:   Correct end of Visual area when entering another buffer.
05b2761548
2022-02-15 10:26:39 +08:00
8f3e56ed3a vim-patch:8.2.3820: "vrc" does not replace composing characters
Problem:    "vrc" does not replace composing characters, while "rc" does.
Solution:   Check the byte length including composing characters.
            (closes vim/vim#9351)
8ee6028de3

vim-patch:8.2.3823: test for visual replace is in wrong function

Problem:    Test for visual replace is in wrong function.
Solution:   Move it to another function.
6ecf58b0d7
2022-02-15 09:35:43 +08:00
1bd6c0a05c Merge pull request #17410 from zeertzjq/test-old-reorder
test(old): reorder test_functions.vim and test_visual.vim to match Vim
2022-02-15 09:25:57 +08:00
9f9ef3e21d test(old): reorder test_functions.vim and test_visual.vim to match Vim 2022-02-15 08:59:46 +08:00
edc5554fc4 Merge pull request #17402 from seandewar/vim-8.2.4120
vim-patch:8.2.{3073,4120,4151,4152}
2022-02-15 00:30:05 +00:00
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
5aed2e9f27 ci(labeler): disable sync that interferes with other jobs 2022-02-14 21:16:36 +01:00
51cc5c5654 ci: add more reviewers 2022-02-14 18:58:10 +01:00
2b75ac7aa9 vim-patch:8.2.4152: block insert with double wide character fails
Problem:    Block insert with double wide character fails.
Solution:   Adjust the expected output.
fc6ccebea6
2022-02-14 17:29:49 +00:00
afbed8cb75 vim-patch:8.2.4151: reading beyond the end of a line
Problem:    Reading beyond the end of a line.
Solution:   For block insert only use the offset for correcting the length.
57df9e8a9f
2022-02-14 17:29:49 +00:00
e662d86e8d vim-patch:8.2.4120: block insert goes over the end of the line
Problem:    Block insert goes over the end of the line.
Solution:   Handle invalid byte better.  Fix inserting the wrong text.
9f8c304c8a
2022-02-14 17:29:49 +00:00
f8b75e5822 vim-patch:8.2.3073: when cursor is move for block append wrong text is inserted
Problem:    When cursor is move for block append wrong text is inserted.
Solution:   Calculate an offset. (Christian Brabandt, closes vim/vim#8433,
            closes vim/vim#8288)
4067bd3604
2022-02-14 17:29:48 +00:00
d5d51308c0 test(old): cherry-pick test_visual changes from v8.2.2945
59b262362f
2022-02-14 17:29:45 +00:00
b7e6c1b525 test(old): cherry-pick test_visual changes from v8.2.2901
3e72dcad8b
2022-02-14 17:29:41 +00:00
abf42b7ec6 test(old): cherry-pick test_visual changes from v8.2.0369
1671f44881

Omit Test_AAA_start_visual_mode_with_count comment change as it hasn't been
ported yet.
2022-02-14 17:29:35 +00:00
758d7726df Merge pull request #17399 from zeertzjq/ci-review-script 2022-02-14 11:30:39 -05:00
dcefd48c1b vim-patch:8.2.0156: various typos in source files and tests
Problem:    Various typos in source files and tests.
Solution:   Fix the typos. (Emir Sari, closes vim/vim#5532)
4b96df5a01
2022-02-14 18:56:30 +08:00
c9b46f154b vim-patch:8.1.1955: tests contain typos
Problem:    Tests contain typos.
Solution:   Correct the typos. (Dominique Pelle)
1bc353b6f1

Other changes are either N/A or already applied.
2022-02-14 18:56:30 +08:00
8a80ab27bd vim-patch:8.1.1846: inconsistently using GetVimCommand() and v:progpath
Problem:    Inconsistently using GetVimCommand() and v:progpath. (Daniel
            Hahler)
Solution:   Use GetVimCommand(). (closes vim/vim#4806)
93344c2d70

Cherry-pick a change to test_profile.vim from patch 8.1.1544.
Cherry-pick a change to test_vimscript.vim from patch 8.1.1826.

Some of the args are no-op in Nvim, and `-i NONE` and `--headless` are
already added by `GetVimCommand()`. I'll try to match the order of args
in upstream, substituting `--not-a-term` with `--headless`.
2022-02-14 18:56:30 +08:00
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
29eabbcd07 ci: use a separate script for request review workflow 2022-02-14 07:47:10 +08:00
2ed6b99a42 refactor(PVS/V560): part of conditional expression is always true/false 2022-02-13 17:51:48 +01:00
046950f630 Merge pull request #17154 from neovim/marvim/api-doc-update/master
docs: regenerate [skip ci]
2022-02-13 09:25:05 -05:00
5d6bef0f6e Merge pull request #17374 from zeertzjq/vim-8.2.3510
vim-patch:8.2.{3510,3512,3514,3515,3534}: nanosecond timestamp change detection
2022-02-13 21:58:36 +08:00
45e666fb92 docs: regenerate [skip ci] 2022-02-13 13:44:51 +00:00
e481901748 docs: treesitter.txt - fix overflowing lines, document minimum_language_version (#17286) 2022-02-13 14:43:25 +01:00
c5f5c0d4da Merge pull request #17392 from zeertzjq/ci-review-open-only
ci: only request review on open non-draft PRs
2022-02-13 08:42:47 -05:00
b2606673cc vim-patch:8.2.3534: autoread test is a bit flaky
Problem:    Autoread test is a bit flaky.
Solution:   Wait a brief moment before overwriting the file.
944eeb44fb
2022-02-13 21:33:28 +08:00
0f1c705936 vim-patch:8.2.3515: nano time test fails on Mac and FreeBSD
Problem:    Nano time test fails on Mac and FreeBSD.
Solution:   Also check nano time when not on Linux. (Ozaki Kiichi,
            closes vim/vim#9000)
def69dffb3
2022-02-13 21:33:28 +08:00
21283aa445 vim-patch:8.2.3514: autoread test with nano second time sometimes fails
Problem:    Autoread test with nano second time sometimes fails.
Solution:   Mark the test as being flaky.
eaa006dae3
2022-02-13 21:33:28 +08:00
bad22bd656 vim-patch:8.2.3512: timestamp test fails on some systems
Problem:    Timestamp test fails on some systems.
Solution:   Sleep for a short while.
accf4ed352
2022-02-13 21:33:28 +08:00
03348e5b9d vim-patch:8.2.3510: changes are only detected with one second accuracy
Problem:    Changes are only detected with one second accuracy.
Solution:   Use the nanosecond time if possible.  (Leah Neukirchen,
            closes vim/vim#8873, closes vim/vim#8875)
0a7984af56

In Nvim Test_checktime_fast() is also flaky. Add a delay to avoid that.
2022-02-13 21:33:28 +08:00
1be9549e6b ci: only request review on open non-draft PRs 2022-02-13 19:17:18 +08:00
1b73ae653f Merge pull request #16914 from godlygeek/fix_14587
fix(screen): don't put empty sign text in line number column
2022-02-13 11:41:17 +01:00
2c4efc0347 Merge pull request #17380 from dundargoc/ci/labeler/add-filetype-label
ci(labeler): add filetype label if filetype.lua has changed
2022-02-13 11:11:43 +01:00
f378df846c Merge pull request #17375 from shadmansaleh/fix/vim.g/autoload
fix: autoload variables not loaded with vim.g & nvim_get_var
2022-02-13 10:32:32 +01:00
6f5fae08a3 Merge pull request #17389 from zeertzjq/restore-oldtests
test(old): add test_cdo.vim and test_packadd.vim
2022-02-13 11:37:49 +08:00
b16fae0f26 test(old): add test_cdo.vim and test_packadd.vim
test_cdo.vim is copied from Vim v8.1.1483.
test_packadd.vim is copied from Vim v8.2.0174.
2022-02-13 10:26:11 +08:00
a87eb896a5 Merge pull request #17388 from zeertzjq/test-assert
test(old): move some tests from assert_spec.lua to test_assert.vim
2022-02-13 10:07:09 +08:00
2a6a93b665 test(old): move some tests from assert_spec.lua to test_assert.vim 2022-02-13 09:23:20 +08:00
7a7ac004f0 Merge pull request #17385 from seandewar/vim-8.2.4359
vim-patch:8.2.{4359,4362,4363,4364}: crash when repeatedly using :retab
2022-02-12 22:51:13 +00:00
5c62bce7c1 vim-patch:8.2.4364: MS-Windows: still running out of memory for a very long line
Problem:    MS-Windows: still running out of memory for a very long line.
Solution:   Check for negative length.
4549166078
2022-02-12 22:25:39 +00:00
05f744cfc7 Merge pull request #16643 from zeertzjq/vim-8.1.2184
vim-patch:8.1.2184,8.2.3804: option context is not copied when splitting a window
2022-02-13 06:13:18 +08:00
dc415ce298 vim-patch:8.1.2184: option context is not copied when splitting a window
Problem:    Option context is not copied when splitting a window. (Daniel
            Hahler)
Solution:   Copy the option context, so that ":verbose set" works.
            (closes vim/vim#5066)
cfb381421f

vim-patch:8.2.3804: script context not set when copying 'swf' and 'ts'

Problem:    Script context not set when copying 'swf' and 'ts'.
Solution:   Use COPY_OPT_SCTX with the right argument. (closes vim/vim#9347)
6206877c51
2022-02-13 05:40:13 +08:00
72e3d2c9ba vim-patch:8.2.4363: MS-Windows: running out of memory for a very long line
Problem:    MS-Windows: running out of memory for a very long line.
Solution:   Use a 32 bit value for MAXCOL also when ints are 64 bits.
8e38555ece

This still fails Vim's Windows CI, so let's see what happens...
2022-02-12 21:38:00 +00:00
90a43e846d Merge pull request #17382 from zeertzjq/vim-8.2.2342
vim-patch:8.2.2342: "char" functions may return wrong column in Insert mode
2022-02-13 05:26:15 +08:00
700af0ab1d vim-patch:8.2.4362: :retab may allocate too much memory
Problem:    :retab may allocate too much memory.
Solution:   Bail out when allocating more than MAXCOL bytes.
33f3c59854
2022-02-12 21:23:06 +00:00
f292dd2126 fix: autoload variables not loaded with vim.g & nvim_get_var 2022-02-13 01:23:23 +06:00
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
1b0d6bcd53 vim-patch:8.2.4359: crash when repeatedly using :retab
Problem:    crash when repeatedly using :retab.
Solution:   Bail out when the line is getting too long.
6e28703a8e

Cherry-pick e_resulting_text_too_long from v8.2.3492; put it in globals.h as
it will eventually be used in other files.

Add a modeline to test_retab.vim
2022-02-12 18:52:34 +00:00
05c3d02380 Merge pull request #17383 from lewis6991/sign_eff
refactor(signs): more efficient signcol calc
2022-02-12 19:40:44 +01:00
50250542c3 refactor(signs): more efficient signcol calc
When iterating signs to calculate the sign column, stop iterating when
we reach the maximum configured from 'signcolumn'.
2022-02-12 17:56:39 +00:00
7db0aa027c Merge pull request #17381 from zeertzjq/vim-8.2.0580
vim-patch:8.2.0580: window size wrong if 'ea' is off and 'splitright' is on
2022-02-12 21:48:20 +08:00
12eca76e2c ci(labeler): add filetype label if any filetype files have changed 2022-02-12 14:32:42 +01:00
ed169d8997 vim-patch:8.2.2342: "char" functions may return wrong column in Insert mode
Problem:    "char" functions return the wront column in Insert mode when the
            cursor is beyond the end of the line.
Solution:   Compute the column correctly. (Yegappan Lakshmanan, closes vim/vim#7669)
9145846b6a
2022-02-12 21:30:28 +08:00
c23ec9d86e vim-patch:8.2.0580: window size wrong if 'ea' is off and 'splitright' is on
Problem:    Window size wrong if 'ea' is off and 'splitright' is on and
            splitting then closing a window.
Solution:   Put abandoned window space in the right place. (Mark Waggoner)
edd327cc07
2022-02-12 21:19:39 +08:00
a1f34b2481 Merge pull request #17377 from clason/keyset-more
feat(highlight): add strikethrough, nocombine to `nvim_set_hl`
2022-02-12 14:05:12 +01:00
cc9d08069a Merge pull request #17269 from seandewar/vim-8.2.0915
vim-patch:8.2.{0915,0918,0922,4355}
2022-02-12 12:28:28 +00:00
e126fbc971 Merge pull request #17376 from dundargoc/ci/reviews/upgrade-to-v6
ci(reviews): upgrade github-script version to v6
2022-02-12 07:09:43 -05:00
dd2c0a7d33 Merge pull request #17371 from dundargoc/revert/continue-on-error
revert: "ci: use continue-on-error instead of "|| true""
2022-02-12 07:08:57 -05:00
db06fb47b9 vim-patch:8.2.0922: search test fails
Problem:    Search test fails.
Solution:   Remove failure tests for calls that no longer fail.
48af321a33
2022-02-12 12:01:30 +00:00
0511a31ca2 vim-patch:8.2.0918: duplicate code for evaluating expression argument
Problem:    Duplicate code for evaluating expression argument.
Solution:   Merge the code and make the use more flexible.
a9c0104947
2022-02-12 12:01:29 +00:00
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
cb18545253 feat(api): add strikethrough, nocombine to set_hl 2022-02-12 12:05:41 +01:00
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
f052e0bd11 ci(reviews): upgrade github-script version to v6 2022-02-12 11:20:00 +01:00
0c901baee1 revert: "ci: use continue-on-error instead of "|| true""
This reverts commit 559aa4179c.

I mistakenly believed both ways of writing were equivalent; this is
untrue. Setting continue-on-error to true will make the job pass, but
an error annotation will still be created which is misleading since it's
not actually an error.
2022-02-12 11:03:32 +01:00
a7321e37a7 Merge pull request #17370 from dundargoc/ci/fix-reviews-workflow
ci: fix reviews workflow by sending an artifact with PR number
2022-02-11 20:35:54 -05:00
f6485e9446 Merge pull request #16841 from zeertzjq/vim-8.1.2073
vim-patch:8.1.2073: when editing a buffer 'colorcolumn' may not work
2022-02-12 07:49:09 +08:00
4ca522fd02 test: convert some colorcolumn tests to Lua screen tests 2022-02-12 06:36:17 +08:00
612696bedc vim-patch:8.1.2073: when editing a buffer 'colorcolumn' may not work
Problem:    When editing a buffer 'colorcolumn' may not work.
Solution:   Set the buffer before copying option values. Call
            check_colorcolumn() after copying window options.
010ee9657a
2022-02-12 06:36:17 +08:00
906182065b Merge pull request #17325 from glacambre/stdioopen_doc 2022-02-11 16:21:16 -05:00
46e0f635da Merge pull request #17372 from dundargoc/ci/commitlint/fix-revert-bug 2022-02-11 16:16:37 -05:00
f50a9a4288 ci(commitlint): allow first non-space character to be a quote 2022-02-11 20:02:50 +01:00
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
e3c09cb9ed Merge pull request #17284 from dundargoc/ci/reduce-noise 2022-02-11 11:12:49 -05:00
c373226ee7 ci: disable tracing (set -x) from the shell scripts 2022-02-11 16:53:34 +01:00
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
e957697334 ci: fix reviews workflow by sending an artifact with PR number 2022-02-11 15:12:41 +01:00
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
b981c231e2 Merge pull request #17368 from zeertzjq/test-filechanged-dialog
test: convert Test_file_changed_dialog() to Lua functional test
2022-02-11 21:02:27 +08:00
58d81efcb2 fix: append test for checking zero width node range 2022-02-11 20:59:47 +08:00
5546492c44 test: convert Test_file_changed_dialog() to Lua functional test 2022-02-11 20:37:20 +08:00
2db0a52074 Merge pull request #17360 from lewis6991/fix-window-close
fix: close floating windows when calling win_close()
2022-02-11 10:37:13 +01:00
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
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
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
38bf52821a Merge pull request #17353 from zeertzjq/api-changedir-func
fix(api): use changedir_func() in nvim_set_current_dir()
2022-02-11 03:55:32 +08:00
4d59318ecb Merge pull request #17359 from dundargoc/ci/update-reviewers-on-manual-labeling 2022-02-10 12:31:24 -05:00
b0bcbb08a9 ci: add reviewers if labels are manually added after PR creation 2022-02-10 18:06:36 +01:00
c2ec3664e0 Merge pull request #17322 from dundargoc/ci/simplify-ci-process 2022-02-10 10:54:34 -05:00
85ae04dbfd fix: close floating windows when calling win_close() 2022-02-10 15:26:40 +00:00
a73360a09a Merge pull request #16868 from zeertzjq/vim-8.1.2221
vim-patch:8.1.2221,8.2.4336: filtering for :disp and :scriptnames
2022-02-10 21:04:41 +08:00
2c5382aafa ci: remove function run_test 2022-02-10 09:43:51 +01:00
2f3fb53dbd ci: remove meta-suite "tests" 2022-02-10 09:43:51 +01:00
357234865b ci: remove continue flag from exit_suite since it's always needed 2022-02-10 09:43:51 +01:00
b8529ea9b8 ci: run all tests with run_suite function 2022-02-10 09:43:51 +01:00
3b4bf88710 Merge pull request #17355 from zeertzjq/test-screenpos
test(old): comment out WinBar instead of skipping Test_screenpos()
2022-02-10 14:46:45 +08:00
de328de35b test(old): comment out WinBar instead of skipping Test_screenpos() 2022-02-10 14:06:48 +08:00
23c3f7f572 fix(api): use changedir_func() in nvim_set_current_dir()
Co-Authored-By: smolck <46855713+smolck@users.noreply.github.com>
2022-02-10 09:45:20 +08:00
dba1df6359 Merge pull request #17349 from dundargoc/ci/add-more-reviewers-from-label
ci: add more reviewers based on label
2022-02-09 18:44:01 -05:00
c415e764d4 vim-patch:8.2.4336: using :filter for :scriptnames does not work
Problem:    Using :filter for :scriptnames does not work. (Ben Jackson)
Solution:   Call message_filtered(). (closes vim/vim#9720)
769f5895eb

Cherry-pick a modeline from Vim patch 8.2.1432.
2022-02-10 07:28:54 +08:00
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
90f2a851c7 Merge pull request #17342 from zeertzjq/mbyte-const
refactor(mbyte.c): add const qualifiers
2022-02-10 05:10:05 +08:00
aff0ddd784 vim-patch:8.2.4337: part of condition is always true (#17352)
Problem:    Part of condition is always true.
Solution:   Remove that part of the condition. (closes vim/vim#9729)
78a8404f8b
2022-02-09 17:55:01 +00:00
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
60e3940b4a Merge pull request #17346 from zeertzjq/vim-8.2.4242
vim-patch:8.2.{4242,4315}: put in Visual mode cannot be repeated
2022-02-09 20:46:30 +08:00
3959f3a9c8 Merge pull request #17350 from zeertzjq/vim-8.2.1316
vim-patch:8.2.{1316,2199,2201,2202}
2022-02-09 20:11:12 +08:00
0675c7de75 vim-patch:8.2.2202: write file test still fails on MS-Windows
Problem:    Write file test still fails on MS-Windows.
Solution:   Set fileformat with the :edit command
16204962c7
2022-02-09 19:24:41 +08:00
2863fac61f vim-patch:8.2.2201: write file test fails on MS-Windows
Problem:    Write file test fails on MS-Windows.
Solution:   Force edit after setting 'fileformat'.
bd318559cf
2022-02-09 19:24:41 +08:00
47a98ab394 vim-patch:8.2.2199: first write after setting 'eol' does not have NL added
Problem:    First write after setting 'eol' does not have NL added. (Tomáš
            Janoušek)
Solution:   Only use b_no_eol_lnum when doing a binary write. (closes vim/vim#7535)
b3c8b1d254
2022-02-09 19:24:41 +08:00
92e4394562 vim-patch:8.2.1316: test 42 is still old style
Problem:    Test 42 is still old style.
Solution:   Turn it into a new style test. (Yegappan Lakshmanan, closes vim/vim#6561)
b61ef01cce

Including the Xtest2 -> Xfile2 change from Vim patch 8.2.1498.
2022-02-09 19:24:41 +08:00
afac1b5d87 ci: add more reviewers based on label 2022-02-09 10:47:14 +01:00
01b748f28f Merge pull request #17347 from zeertzjq/screen-pvs
refactor(PVS/V547): p == NULL is always false
2022-02-09 15:52:00 +08:00
a2a37effc2 refactor(PVS/V547): p == NULL is always false 2022-02-09 15:23:45 +08:00
3fe47647c7 vim-patch:8.2.4315: put in Visual mode not fully tested
Problem:    Put in Visual mode not fully tested.
Solution:   Add a few more test cases. (closes vim/vim#9708)
6bf821e8ab
2022-02-09 14:21:04 +08:00
196160b183 vim-patch:partial:f10911e5db16
Update runtime files
f10911e5db
2022-02-09 14:21:04 +08:00
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
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
300b009f47 fix(healthcheck): handle empty reports 2022-02-09 10:18:22 +08:00
07c97fa02d Merge pull request #17321 from dundargoc/refactor/pvs/v547
refactor(PVS/V547): expression is always true/false
2022-02-09 10:08:16 +08:00
ff81725ff0 refactor(mbyte.c): add const qualifiers
This only touches functions that do not return a pointer.
Also add a note about the differences between mb_head_off() and utf_head_off().
2022-02-09 09:52:57 +08:00
e16ec0be22 Merge pull request #17341 from zeertzjq/clang-suppress
chore(clang): suppress "result of operation is garbage"
2022-02-09 09:25:18 +08:00
4ce5d27f46 chore(clang): suppress "result of operation is garbage" 2022-02-09 08:54:54 +08:00
19b2ad0518 Merge pull request #17332 from cryptomilk/asn-vterm-output-callback
feat(term): Use vterm_output_set_callback()
2022-02-08 19:26:38 -05:00
0290889fa9 Merge pull request #17330 from dundargoc/ci/add-reviewer-from-label
ci: add write permissions to add-reviewer job
2022-02-08 18:43:03 -05:00
4d5cd3abe0 Merge pull request #17326 from zeertzjq/vim-8.1.2297
vim-patch:8.1.2297: the ex_vimgrep() function is too long
2022-02-09 07:07:25 +08:00
ef819fc052 vim-patch:8.1.2297: the ex_vimgrep() function is too long
Problem:    The ex_vimgrep() function is too long.
Solution:   Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#5211)
d6a98a3a97

Including a missing change to ex_vimgrep() from patch 8.0.1831.
2022-02-09 06:34:21 +08:00
bcea732997 Merge pull request #17328 from zeertzjq/vim-8.2.0197
vim-patch:8.2.0197: some Ex commands not sufficiently tested
2022-02-09 04:40:15 +08:00
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
79bacb0973 ci: add write permissions to add-reviewer job 2022-02-08 14:56:46 +01:00
cfed5baa38 refactor(PVS/V547): expression is always true/false 2022-02-08 14:52:31 +01:00
1a5e893cee Merge pull request #17334 from zeertzjq/vim-8.2.4326
vim-patch:8.2.4326: "o" and "O" copying comment not sufficiently tested
2022-02-08 21:45:39 +08:00
3c75e63bf6 vim-patch:8.2.4326: "o" and "O" copying comment not sufficiently tested
Problem:    "o" and "O" copying comment not sufficiently tested.
Solution:   Add a test case. (closes vim/vim#9718)
51ab7c7d0d

Fix a mistake when porting Vim patch 8.2.3934
2022-02-08 21:10:32 +08:00
7813b48645 feat(term): use vterm_output_set_callback() 2022-02-08 11:18:49 +01:00
40c36efdee chore(deps): use https for downloading libvterm and libtermkey 2022-02-08 11:18:49 +01:00
51b432a7d1 Merge pull request #17327 from zeertzjq/test-ex-mode
test: add Lua functional tests for Ex mode
2022-02-08 15:21:18 +08:00
f8b40694b1 vim-patch:8.2.0197: some Ex commands not sufficiently tested
Problem:    Some Ex commands not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5565)
ea3db914c0
2022-02-08 15:09:54 +08:00
68603998b9 test: add Lua functional tests for Ex mode 2022-02-08 14:47:23 +08:00
01e58fb14d Merge pull request #17324 from zeertzjq/vim-patch-sh-read
chore(vim-patch.sh): use piping instead of here string for `while read`
2022-02-07 21:30:54 -05:00
8ec4410cfb Merge pull request #17323 from dundargoc/ci/add-reviewer-from-label
ci: add reviewers based on label
2022-02-07 21:30:26 -05:00
4d349330a7 chore(vim-patch.sh): use piping instead of here string for while read
Using a here string can cause an error if there are no missing patches:
`./scripts/vim-patch.sh: line 580: runtime_commits: bad array subscript`

Using piping doesn't cause the error.
2022-02-08 10:08:17 +08:00
0a8bfc0214 Merge pull request #17311 from zeertzjq/vim-8.2.4303
vim-patch:8.2.{4303,4307}: a few messages should not be translated
2022-02-08 08:20:10 +08:00
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
9259bc6215 Merge pull request #16873 from seandewar/vim-8.2.1665
vim-patch:8.2.{1665,1726,1872,1893,1921,2280,2813}: `matchfuzzy` and friends
2022-02-07 22:57:25 +00:00
fde169f328 ci: add reviewers based on label 2022-02-07 21:25:45 +01:00
02e7431445 docs(fuzzy-match): cherry-pick latest changes
53f7fccc94
1b884a0053
4c295027a4
3ec3217f04
2022-02-07 17:39:50 +00:00
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
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
712c7e5d5f vim-patch:8.2.1921: fuzzy matching does not recognize path separators
Problem:    Fuzzy matching does not recognize path separators.
Solution:   Add a bonus for slash and backslash. (Yegappan Lakshmanan,
            closes vim/vim#7225)
dcdd42a8cc
2022-02-07 17:20:50 +00:00
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
8313d31e4a vim-patch:8.2.1872: matchfuzzy() does not prefer sequential matches
Problem:    Matchfuzzy() does not prefer sequential matches.
Solution:   Give sequential matches a higher bonus. (Christian Brabandt,
            closes vim/vim#7140)
e9f9f16387
2022-02-07 17:20:50 +00:00
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
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
f30ce7d273 ci: run all suites with run_suite function 2022-02-07 09:57:21 +01:00
f02a5a7bda chore(typval): return NULL over false for pointer return type (#17316)
While we're at it, abort() for an unhandled v_type.
2022-02-07 01:51:09 +00:00
cf86adba61 Merge pull request #17263 from zeertzjq/vim-8.2.0208
vim-patch:8.2.{0208,0215,0942,3824,3939}: fnamemodify() patches
2022-02-07 07:13:13 +08:00
72816136a5 vim-patch:8.2.3939: MS-Windows: fnamemodify('', ':p') does not work
Problem:    MS-Windows: fnamemodify('', ':p') does not work.
Solution:   Do not consider an empty string a full path. (Yegappan Lakshmanan,
            closes vim/vim#9428, closes vim/vim#9427)
5a664fe57f
2022-02-07 06:48:10 +08:00
bfc11e9c64 vim-patch:8.2.3824: no ASAN support for MSVC
Problem:    No ASAN support for MSVC.
Solution:   Add ASAN support and fix a coupld of uncovered problems. (Yegappan
            Lakshmanan, closes vim/vim#9357)
6df0f2759d
2022-02-07 06:48:10 +08:00
53e4434c72 vim-patch:8.2.0942: expanding to local dir after homedir keeps "~/"
Problem:    Expanding to local dir after homedir keeps "~/".
Solution:   Adjust modify_fname(). (Christian Brabandt, closes vim/vim#6205,
            closes vim/vim#5979)
0e390f40e9
2022-02-07 06:48:10 +08:00
f47ba10636 vim-patch:8.2.0215: wrong file name shortening
Problem:    Wrong file name shortening. (Ingo Karkat)
Solution:   Better check for path separator. (Yasuhiro Matsumoto,
            closes vim/vim#5583, closes vim/vim#5584)
a78e9c61a0
2022-02-07 06:48:10 +08:00
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
380bc4fe22 Merge pull request #17299 from zeertzjq/vim-8.1.0711
vim-patch:7.4.{1163,1164,1167,1173,1178,1181,1228},8.1.0711
2022-02-07 06:04:40 +08:00
fe621b4ac0 vim-patch:8.1.0711: test files still use function!
Problem:    Test files still use function!.
Solution:   Remove the exclamation mark.  Fix overwriting a function.
1e1153600c

Some of the changes were already applied previously.
2022-02-07 05:34:20 +08:00
e6e9ffb345 vim-patch:7.4.1228
Problem:    copy() and deepcopy() fail with special variables. (Nikolai
            Pavlov)
Solution:   Make it work.  Add a test.  Closes vim/vim#614.
155500077c

Code is N/A. This only ports the tests.
Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
a937fc53ef vim-patch:7.4.1181
Problem:    free_tv() can't handle special variables. (Damien)
Solution:   Add the variable type.
6650a69454

Code is N/A. This only ports the tests.
2022-02-07 05:34:20 +08:00
3fa5d50183 vim-patch:7.4.1178
Problem:    empty() doesn't work for the new special variables.
Solution:   Make empty() work. (Damien)
767d8c1a1a

Code is N/A. This only ports the tests.
Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
bf8f2ebb79 vim-patch:7.4.1173
Problem:    No test for new behavior of v:true et al.
Solution:   Add a test.
65591001e4

Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
b3a14a71b0 vim-patch:7.4.1167
Problem:    No tests for "is" and "isnot" with the new variables.
Solution:   Add tests.
0436922965

Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
6a00b16896 vim-patch:7.4.1164
Problem:    No tests for comparing special variables.  Error in jsondecode()
            not reported.  test_json does not work Japanse system.
Solution:   Set scriptencoding. (Ken Takata) Add a few more tests. Add error.
6039c7f053

Code is N/A. This only ports the tests.
Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
7b8fcf0234 vim-patch:7.4.1163
Problem:    Expressions "0 + v:true" and "'' . v:true" cause an error.
Solution:   Return something sensible when using a special variable as a
            number or as a string. (suggested by Damien)
17a13437c9

Code is N/A. This only ports the tests.
Comment out tests involving v:none as Nvim has removed it.
2022-02-07 05:34:20 +08:00
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
f0699f4356 Merge pull request #17279 from zeertzjq/state-enter-vpeekc
fix(event-loop): call vpeekc() directly first to check for character
2022-02-06 19:22:02 +01:00
c7df847c07 Merge pull request #17302 from lewis6991/pkg_ldr
fix(lua): restore priority of the preloader
2022-02-06 15:40:45 +01:00
51444bef24 Merge pull request #17306 from clason/vim-8.2.4305
* Vim 8.2.4305: tex filetype detection fails
* Vim 8.2.4306: no test for fixed perl filetype check
2022-02-06 15:33:39 +01:00
4903949033 Merge pull request #17277 from laomaiweng/windows-debug-symbols
build(win): package the debug symbols (PDB file) along with nvim.exe
2022-02-06 09:32:18 -05:00
2ff4726fae Merge pull request #17310 from jamessan/commitlint
ci(commitlint): use lintcommit.lua from main repo
2022-02-06 09:28:24 -05:00
707cc1a167 ci(commitlint): use lintcommit.lua from main repo
[skip ci]
2022-02-06 08:31:23 -05:00
8f0b3cadbe vim-patch:8.2.4307: a few more messages should not be translated
Problem:    A few more messages should not be translated.
Solution:   Remove _().
0c1550d9e9
2022-02-06 21:13:03 +08:00
daf7c17cdb vim-patch:8.2.4303: a few messages should not be translated
Problem:    A few messages should not be translated.
Solution:   Remove _(). (Dominique Pellé, closes vim/vim#9702)
cd53eed2c5
2022-02-06 21:13:03 +08:00
06d2d271d7 vim-patch:8.2.4306: no test for fixed perl filetype check
Problem:    No test for fixed perl filetype check.
Solution:   Add a test. Sort test functions.
500761b1cf
2022-02-06 12:19:55 +01:00
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
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
8215c05945 Merge pull request #17194 from zeertzjq/inccommand-prev-sub
fix(inccommand): do not change reg_prev_sub when previewing
2022-02-06 10:18:59 +08:00
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
b518b577ea fix(lua): restore priority of the preloader
Neovim currently places its own loader for searching runtime files at
the front of `package.loaders`. This prevents any preloaders in
`package.preload` from being used. This change fixes that by moving the
default package preloader to run before Neovim's loader. For example,
LuaJIT provides preloaders for the built-in modules `ffi` and `bit`, so
this optimisation will improve the loading of those.
2022-02-05 21:46:04 +00:00
b17f1e6fe8 Merge pull request #17077 from zeertzjq/vim-8.2.2324
vim-patch:8.2.{1727,2324,2363}: charcol(), getcharpos(), getcursorcharpos(), setcharpos(), setcursorcharpos()
2022-02-06 05:18:02 +08:00
be9dbc925c vim-patch:partial:6aa57295cfbe
Update runtime files
6aa57295cf
2022-02-06 04:46:16 +08:00
46d1b8ed1f vim-patch:partial:2346a6378483
Update runtime files
2346a63784
2022-02-06 04:46:16 +08:00
8c3244c9a1 vim-patch:8.2.2363: curpos() does not accept a string argument as before
Problem:    curpos() does not accept a string argument as before.
solution:   Make a string argument work again. (Yegappan Lakshmanan,
            closes vim/vim#7690
9ebcf231bd
2022-02-06 04:46:16 +08:00
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
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
8adbba7ac3 feat(eval): port emsg from v8.2.3284
80d7395dcf
2022-02-05 19:55:17 +00:00
83a48d7a44 vim-patch:8.2.2661: leaking memory when looping over a string
Problem:    Leaking memory when looping over a string.
Solution:   Free the memory.
bb5d87c850
2022-02-05 19:55:16 +00:00
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
92e92f02e7 fix(diff): make algorithm work for vim.diff (#17300)
Fixes #17207
2022-02-05 09:49:48 -08:00
cee944e3ee Merge pull request #17199 from glacambre/fix_9358
fix(--headless): do not block on press-enter prompts when no UI
2022-02-05 16:47:51 +01:00
f68d25737f Merge pull request #17020 from seandewar/vim-8.1.2342
vim-patch:8.1.{2342,2343,2356,2357},8.2.0233: `rand` and `srand`
2022-02-05 15:30:09 +00:00
ef6cedf820 Merge pull request #17290 from dundargoc/ci/simplify-ci-process
ci: simplify CI process
2022-02-05 09:16:41 -05:00
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
cc7ccf6d31 vim-patch:8.1.2357: no test with wrong argument for rand()
Problem:    No test with wrong argument for rand().
Solution:   Add a test case.
68e9e5f7fc
2022-02-05 14:00:59 +00:00
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
061b06a8ae docs(rand): cherry-pick changes from rt update 0c0734d
0c0734d527
2022-02-05 14:00:59 +00:00
f6a0d5498b vim-patch:8.1.2343: using time() for srand() is not very random
Problem:    Using time() for srand() is not very random.
Solution:   use /dev/urandom if available
07e4a19795

Use os_open and os_close.

time_settime is N/A, so some parts of the test are disabled.

There's maybe a very, very, very, very small chance the /dev/urandom test fails,
but it shouldn't matter. :P
2022-02-05 14:00:35 +00:00
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
7c8ef809e6 Merge pull request #17274 from dundargoc/chore/correct-minimum-python-version
chore(gen_vimdoc): correct minimum python version
2022-02-05 08:06:58 -05:00
03e189d1a1 chore(gen_vimdoc): correct minimum python version 2022-02-05 13:36:27 +01:00
9d1deed6c8 Merge pull request #17298 from zeertzjq/vim-8.2.4298
vim-patch:8.2.4298: divide by zero with huge tabstop value
2022-02-05 20:33:11 +08:00
e6cfd20b7f vim-patch:8.2.4298: divide by zero with huge tabstop value
Problem:    Divide by zero with huge tabstop value.
Solution:   Reject tabstop value that overflows to zero.
fc88df42f1
2022-02-05 20:05:04 +08:00
5b34c2ab73 fix(--headless): do not block on press-enter prompts when no UI
This commit fixes #9358, where emitting multiple messages with 'echo' or
a single one with 'echom' or 'echoerr' would result in a press-enter
prompt that couldn't be dismissed by pressing enter.

This requires adapting a few tests to spawn a UI before testing whether
press-enter prompts are blocking.

It also fixes #11718, as when combined with #15910 it enables making
sure that neovim never blocks and emits messages on startup.
2022-02-05 13:02:33 +01:00
806a7c976d Merge pull request #17275 from bfredl/keysethl
refactor(api): use a keyset for highlight dicts
2022-02-05 10:18:47 +01:00
741b4d6262 Merge pull request #17297 from zeertzjq/test-expand
test(old): add test_expand.vim
2022-02-05 17:15:42 +08:00
a4078fa57e test(old): add test_expand.vim
This removes expand_spec.lua and copies test_expand.vim from Vim at
version v8.1.2278.

The rest of patch 8.1.2278 were already applied in #15952, so this marks
that patch as fully ported.

vim-patch:8.1.2278: using "cd" with "exe" may fail

Problem:    Using "cd" with "exe" may fail.
Solution:   Use chdir() instead.
3503d7c94a
2022-02-05 16:41:23 +08:00
fa192e97d5 ci: simplify CI process 2022-02-04 23:51:51 +01:00
dcbf9f93e9 Merge pull request #17288 from zeertzjq/vim-8.2.1128
vim-patch:8.2.1128: the write message mentions characters, but it's bytes
2022-02-04 23:07:21 +08:00
c50cea3de4 Merge pull request #17287 from zeertzjq/vim-8.1.2133
vim-patch:8.1.2133: some tests fail when run as root
2022-02-04 22:24:38 +08:00
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
041b2d6f1e vim-patch:8.1.2133: some tests fail when run as root
Problem:    Some tests fail when run as root.
Solution:   Add CheckNotRoot and use it. (James McCoy, closes vim/vim#5020)
07282f01da

Skip test_terminal.vim and test_viminfo.vim: N/A
2022-02-04 21:52:44 +08:00
cb863d4e1f Merge pull request #17152 from zeertzjq/vim-8.2.3583
vim-patch:8.2.3583: the "gd" and "gD" commands do not update search stats
2022-02-04 19:10:50 +08:00
2fd0720de2 test: convert some search stat screendump tests to Lua screen tests 2022-02-04 18:47:20 +08:00
ab7ae8806e vim-patch:8.2.3583: the "gd" and "gD" commands do not update search stats
Problem:    The "gd" and "gD" commands do not update search stats. (Gary
            Johnson)
Solution:   Clear search stats.
0c71114aed
2022-02-04 18:47:20 +08:00
b9def4ae10 test(old): fix test order in test_search_stat.vim
Also avoid unnecessary divergences from upstream and add a modeline.
2022-02-04 18:47:20 +08:00
6bee2bf790 Merge pull request #17272 from zeertzjq/vim-8.1.0846
vim-patch:8.1.{0846,0878,0884,2358},8.2.{0305,0352,0687,3797}
2022-02-04 09:48:48 +08:00
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
7c3064d46e vim-patch:8.2.0687: some tests do not work on FreeBSD
Problem:    Some tests do not work on FreeBSD.
Solution:   Enable modeline.  Use WaitFor() in more cases. (Ozaki Kiichi,
            closes vim/vim#6036)
41d4299f26
2022-02-04 09:23:54 +08:00
a998b24c56 vim-patch:8.2.0352: FreeBSD: test for sourcing utf-8 is skipped
Problem:    FreeBSD: test for sourcing utf-8 is skipped.
Solution:   Run the matchadd_conceal test separately to avoid that setting
            'term' to "ansi" causes problems for other tests. (Ozaki Kiichi,
            closes vim/vim#5721)
36ddf93831
2022-02-04 09:23:54 +08:00
94eaf3cb2f vim-patch:8.2.0305: relativenumber test fails on some systems
Problem:    Relativenumber test fails on some systems. (James McCoy)
Solution:   Clear the command line.
8040a7147f
2022-02-04 09:23:54 +08:00
1e0613f58c vim-patch:8.1.2358: tests fail on Cirrus CI for FreeBSD
Problem:    Tests fail on Cirrus CI for FreeBSD.
Solution:   Fix a test and skip some. (Christian Brabandt, closes vim/vim#5281)
9134f1ecd4

Skip test_normal.vim: already applied in #11483.
2022-02-04 09:23:54 +08:00
5a9e5b6c38 vim-patch:8.1.0884: double check for bsd systems
Problem:    Double check for bsd systems.
Solution:   Delete the old line.
af630d4f7f
2022-02-04 09:23:54 +08:00
22a7693915 vim-patch:8.1.0878: test for has('bsd') fails on some BSD systems
Problem:    Test for has('bsd') fails on some BSD systems.
Solution:   Adjust the uname match. (James McCoy, closes vim/vim#3909)
a02e3f65c5
2022-02-04 09:23:54 +08:00
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
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
b667bb355d Merge pull request #17283 from dundargoc/ci/reduce-log-output
ci: only show last 100 lines of log on error
2022-02-03 17:11:18 -05:00
4fa8c66bc6 ci: only show last 100 lines of log on error 2022-02-03 22:30:51 +01:00
59fa5f4ecf Merge pull request #17282 from dundargoc/chore/remove-duplicate-entry
chore(gen_vimdoc): remove duplicate extmark.c entry
2022-02-03 14:11:26 -05:00
de672b6d7a chore(gen_vimdoc): remove duplicate extmark.c entry 2022-02-03 18:56:32 +01:00
9efdd927ff Merge pull request #16976 from seandewar/vim-8.2.4018
vim-patch:8.2.{4018,4026,4028} & `nvim_win_call` fixes
2022-02-03 16:44:42 +00:00
452b46fcf7 fix(api/nvim_win_call): share common win_execute logic
We have to be sure that the bugs fixed in the previous patches also apply to
nvim_win_call.

Checking v8.1.2124 and v8.2.4026 is especially important as these patches were
only applied to win_execute, but nvim_win_call is also affected by the same
bugs. A lot of win_execute's logic can be shared with nvim_win_call, so factor
it out into a common macro to reduce the possibility of this happening again.
2022-02-03 15:03:08 +00:00
6820420d3e vim-patch:8.2.4028: ml_get error with :doautoall and Visual area
Problem:    ml_get error with :doautoall and Visual area. (Sean Dewar)
Solution:   Disable Visual mode while executing autocommands.
cb1956d6f2

This should also fix #16937 for nvim_buf_call, so test for it.
2022-02-03 15:03:08 +00:00
d984a8d130 vim-patch:8.2.4026: ml_get error with specific win_execute() command
Problem:    ml_get error with specific win_execute() command. (Sean Dewar)
Solution:   Check cursor and Visual area are OK.
e664a32701
2022-02-03 15:03:08 +00:00
f326c9a77d vim-patch:8.2.4018: ml_get error when win_execute redraws with Visual selection
Problem:    ml_get error when win_execute redraws with Visual selection.
Solution:   Disable Visual area temporarily. (closes vim/vim#9479)
18f4740f04

{switch_to/restore}_win_for_buf is N/A (marked as such in v8.0.0860; currently
only used in Vim's if_py).

Add a modeline to test_execute_func.vim.
2022-02-03 15:02:57 +00:00
f5c4c1d768 Merge pull request #16818 from zeertzjq/vim-8.2.3454
vim-patch:8.2.{3454,3455,3497,3540,3581,3678}: some "p" and "gp" patches
2022-02-03 22:22:00 +08:00
89e308d7da Merge pull request #17226 from dundargoc/refactor/remove-redundant-code
vim-patch:8.2.4241: some type casts are redundant
2022-02-03 20:47:29 +08:00
02d4c91588 Merge pull request #17268 from zeertzjq/health-noshell
fix(health): do not run external processes in a shell
2022-02-03 19:29:24 +08:00
a87ecf5d08 fix(health): do not run external processes in a shell 2022-02-03 18:38:37 +08:00
5fe6bbae2d build(win): don't try to package a PDB if not building with MSVC…
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-02-03 07:52:27 +01:00
74998b0449 fix(event-loop): call vpeekc() directly first to check for character
Expand mappings first by calling `vpeekc()` directly.
2022-02-03 13:43:48 +08:00
f70d1442be build(win): package the debug symbols (PDB file) along with nvim.exe 2022-02-03 01:40:40 +01:00
0bafa44f8b refactor(api): use a keyset for highlight dicts 2022-02-02 23:18:25 +01:00
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
0c66c7dafd Merge pull request #17271 from zeertzjq/vim-8.2.3947
vim-patch:8.2.{3947,4283}: changedir_func() refactoring
2022-02-02 22:01:59 +08:00
cd44f0a401 vim-patch:8.2.4283: using a variable for the return value is not needed
Problem:    Using a variable for the return value is not needed.
Solution:   Return the value directly. (closes vim/vim#9687)
73257149d7

Also move down variable declarations in changedir_func().
vim_chdirfile() doesn't need change.
2022-02-02 21:33:46 +08:00
1bce6d6e16 vim-patch:8.2.3947: unnecessary check for NULL pointer
Problem:    Unnecessary check for NULL pointer.
Solution:   Remove the check. (closes vim/vim#9434)
f38aad85cf

Reorder the two if branches to match upstream.
2022-02-02 21:33:46 +08:00
2559359035 Merge pull request #16879 from zeertzjq/vim-8.2.3966
vim-patch:8.2.3966: when using feedkeys() abbreviations may be blocked
2022-02-02 10:11:09 +08:00
3e68973755 vim-patch:8.2.3966: when using feedkeys() abbreviations may be blocked
Problem:    When using feedkeys() abbreviations may be blocked.
Solution:   Reset tb_no_abbr_cnt when running out of characters.
            (closes vim/vim#9448)
b37a65e4bf
2022-02-02 09:46:25 +08:00
5be2cdd913 Merge pull request #17187 from lewis6991/master
feat(highlight): ns=0 to set :highlight namespace
2022-02-01 17:16:14 +01:00
4aa0cdd3aa feat(highlight): ns=0 to set :highlight namespace
Passing ns=0 to nvim_set_hl will alter the `:highlight` namespace.
2022-02-01 11:54:12 +00:00
f4300985d3 Merge pull request #17113 from zeertzjq/vim-8.2.2569
feat(statusline): support multibyte fillchar
2022-02-01 17:57:01 +08:00
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
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
547497b042 Merge pull request #17261 from zeertzjq/vim-8.2.4273
vim-patch:8.2.4273: the EBCDIC support is outdated
2022-02-01 10:43:14 +08:00
bba5003bdb vim-patch:8.2.4273: the EBCDIC support is outdated
Problem:    The EBCDIC support is outdated.
Solution:   Remove the EBCDIC support.
424bcae1fb

Also remove a comment in buf_init_chartab() as it is for enc_dbcs only.

Skip test_expr.vim: the check was already removed when patch 7.4.2265
was first ported.
2022-02-01 10:15:19 +08:00
5205bcc904 Merge pull request #17254 from zeertzjq/vim-8.2.3787
vim-patch:8.2.{3787,3932,3934,3935,3938}: text formatting patches
2022-02-01 04:23:59 +08:00
c00b844988 Merge pull request #17231 from seandewar/vim-8.2.4245
vim-patch:8.2.4245: ":retab 0" may cause illegal memory access
2022-01-31 18:28:56 +00:00
bddce4b0ff vim-patch:c4573eb12dba (#17258)
Update runtime files
c4573eb12d
2022-01-31 18:09:51 +01:00
79b92da0d2 vim-patch:partial:f10911e5db16 (#17248)
Update runtime files
f10911e5db
2022-01-31 15:27:01 +01:00
f195345c93 [RFC] fix: has('python') error (#17252)
* fix: has('python') error

* fix: functional tests
2022-01-31 15:06:46 +01:00
2a58e62145 vim-patch:8.2.4267: unused entry in keymap enum (#17255)
Problem:    Unused entry in keymap enum.
Solution:   Remove the entry.
4c93aff20f
2022-01-31 21:01:04 +08:00
8d99f53f3d vim-patch:8.2.1083: crash when using reduce() on a NULL list
Problem:    Crash when using reduce() on a NULL list.
Solution:   Only access the list when not NULL.
fda20c4cc5

CHECK_LIST_MATERIALIZE hasn't been ported yet, but presumably if it is ported
it'll use tv_list_first to check for range_list_item, which already checks for
NULL, so this should need no extra changes and can be a full port.

We didn't actually crash here due to the use of Nvim's tv_list functions
checking for NULL, but apply these changes to match Vim better anyway.
2022-01-31 17:38:57 +08:00
44a5875b24 vim-patch:8.2.1051: crash when changing a list while using reduce() on it
Problem:    Crash when changing a list while using reduce() on it.
Solution:   Lock the list. (closes vim/vim#6330)
ca275a05d8
2022-01-31 17:38:57 +08:00
af0bae38e2 vim-patch:8.2.0882: leaking memory when using reduce()
Problem:    Leaking memory when using reduce().
Solution:   Free the intermediate value.
48b1c21809
2022-01-31 17:38:57 +08:00
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
ba2bb6a81b refactor(indent_c.c): add const qualifiers 2022-01-31 15:44:54 +08:00
ae649650de vim-patch:8.2.3938: line comment start is also found in a string
Problem:    Line comment start is also found in a string.
Solution:   Skip line comments in a string.
ba26367fea
2022-01-31 15:44:54 +08:00
f7801fe138 vim-patch:8.2.3935: CTRL-U in Insert mode does not fix the indent
Problem:    CTRL-U in Insert mode does not fix the indent.
Solution:   Fix the indent when 'cindent' is set.
5d20fbf2e7
2022-01-31 15:44:54 +08:00
da3b04a9e0 vim-patch:8.2.3934: repeating line comment is undesired for "O" command
Problem:    Repeating line comment is undesired for "O" command.
Solution:   Do not copy line comment leader for "O". (closes vim/vim#9426)
5ea5f37372
2022-01-31 15:44:54 +08:00
88ba0774e2 vim-patch:8.2.3932: C line comment not formatted properly
Problem:    C line comment not formatted properly.
Solution:   If a line comment follows after "#if" the next line is not the end
            of a paragraph.
264d3ddac0
2022-01-31 15:44:54 +08:00
eda957db10 vim-patch:8.2.3787: no proper formatting of a C line comment after a statement
Problem:    No proper formatting of a C line comment after a statement.
Solution:   Find the start of the line comment, insert the comment leader and
            indent the comment properly.
6e371ecb27
2022-01-31 15:44:54 +08:00
ef5cd99df0 test: remove 003_cindent_spec.lua
This no longer needed as Vim patch 8.1.1434 has been ported.
2022-01-31 15:44:54 +08:00
2870311a37 Merge pull request #17239 from seandewar/vim-8.2.3629
vim-patch:8.2.{3433,3629}
2022-01-31 01:04:10 +00:00
d38f81849b Merge pull request #17068 from VVKot/vim-8.2.3933
vim-patch:8.2.{3933,3973,3978,4013,4032,4048}
2022-01-31 00:42:11 +00:00
62c8715ee9 vim-patch:8.1.2412: crash when evaluating expression with error (#17109) 2022-01-31 08:12:44 +08:00
4dcc7bcbed vim-patch:8.2.3532: the previous '' mark is restored after moving the cursor (#17246) 2022-01-31 08:12:29 +08:00
58d01d3403 vim-patch:8.2.3475: expression register set by not executed put command (#17211) 2022-01-31 08:11:26 +08:00
f19921be0c vim-patch:8.2.3933: after ":cd" fails ":cd -" is incorrect
Problem:    After ":cd" fails ":cd -" is incorrect.
Solution:   Set the previous directory only after successfully changing
            directory. (Richard Doty, closes vim/vim#9419, closes vim/vim#8983)
3d0abad5bf

Adjust the test's error message check due to missing patch

vim-patch:8.2.3973: tiny build fails

Problem:    Tiny build fails.
Solution:   Adjust #ifdefs
0f7a5e758c

vim-patch:8.2.3978: build error when using dynamycally loaded Python 3

Problem:    Build error when using dynamycally loaded Python 3.
Solution:   Adjust #ifdef.
6b1a99dfe3

vim-patch:8.2.4013: build failure without the spell feature

Problem:    Build failure without the spell feature.
Solution:   Adjust #ifdefs.
e60b3c47d7

vim-patch:8.2.4032: ATTRIBUTE_NORETURN is not needed

Problem:    ATTRIBUTE_NORETURN is not needed.
Solution:   Use NORETURN(). (Ozaki Kiichi, closes vim/vim#9487)
e12406526a

vim-patch:8.2.4048: gcc complains about use of "%p" in printf

Problem:    gcc complains about use of "%p" in printf.
Solution:   Add (void *) typecast. (Dominique Pellé, closes vim/vim#9494)
c14f667626
2022-01-31 00:07:32 +00:00
c91fbc1b9e test(oldtest): unskip Test_addr_all
v8.1.0341 has since been ported
2022-01-30 22:25:15 +00:00
796224028b vim-patch:8.2.3629: command completion in cmdline window uses global commands
Problem:    Command completion in cmdline window uses global user commands,
            not local commands for the window where it was opened from.
Solution:   Use local commands. (closes vim/vim#9168)
a119812437
2022-01-30 22:25:15 +00:00
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
a28a9aec63 Merge pull request #16748 from zeertzjq/vim-8.1.1434
vim-patch:8.1.{1434,1585},8.2.{3482,3625,3876}: some cindent patches
2022-01-31 04:49:54 +08:00
2793fcae0a vim-patch:8.2.4241: some type casts are redundant
Problem:    Some type casts are redundant.
Solution:   Remove the type casts. (closes vim/vim#9643)
420fabcd4f

This is not a literal port but an equivalent one.
2022-01-30 19:16:51 +01:00
46bd48f7e9 docs(tutor): modify for Neovim rather than Vim (#17092) 2022-01-30 13:53:01 +01:00
abde91ecaf docs: add example to vim.ui.select (#17241)
Closes https://github.com/neovim/neovim/issues/17137
2022-01-30 13:32:55 +01:00
9aaf7a2b4d Merge pull request #17244 from zeertzjq/vim-8.2.0092 2022-01-30 13:52:16 +08:00
8a9230db26 vim-patch:8.2.0950: tagjump test fails
Problem:    Tagjump test fails.
Solution:   Adjust expected text of the prompt.
13b8205b44
2022-01-30 13:25:29 +08:00
63173f23c4 vim-patch:8.2.0092: tags functionality insufficiently tested
Problem:    Tags functionality insufficiently tested.
Solution:   Add more tags tests. (Yegappan Lakshmanan, closes vim/vim#5446)
a1353b5352
2022-01-30 13:25:29 +08:00
4a96e7809f chore: typo fixes (#16921)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-29 23:15:22 +00:00
d7d015ffff Merge pull request #16975 from dstein64/vim-8.2.3917
vim-patch:8.2.3917: the eval.txt help file is way too big
2022-01-29 23:27:12 +01:00
7b3cfee982 vim-patch:partial:04fb916
Update runtime files
04fb916684
2022-01-29 15:19:30 -05:00
a94632d212 vim-patch:8.2.3917: the eval.txt help file is way too big
Problem:    The eval.txt help file is way too big.
Solution:   Move the builtin function details to a separate file.
1cae5a0a03

Note: Neovim-specific references to |functions| were changed to
|builtin-functions|. This included updates to:
  1. test/functional/vimscript/functions_spec.lua
  2. test/functional/vimscript/eval_spec.lua
  3. runtime/doc/lua.txt
2022-01-29 15:19:29 -05:00
4458413bc0 feat(filetype): convert patterns for mail buffers (#17238) 2022-01-29 12:43:06 -07:00
e0242c4a93 Merge pull request #17222 from bfredl/babajpy2
feat(provider)!: remove support for python2 and python3.[3-6]
2022-01-29 20:22:25 +01:00
baec0d3152 feat(provider)!: remove support for python2 and python3.[3-5]
These versions of python has reached End-of-life. getting rid
of python2 support removes a lot of logic to support two
incompatible python versions in the same version.
2022-01-29 19:49:37 +01:00
4b719e4a16 Merge pull request #17192 from zeertzjq/aucmd-redrawingdisabled
fix: set RedrawingDisabled before entering aucmd_win
2022-01-29 19:16:48 +01:00
49837dc805 Merge pull request #17202 from zeertzjq/unused-orig-rhs
refactor: allocate an empty string as unused orig_rhs for Lua mappings
2022-01-29 19:14:19 +01:00
b2f77c354a vim-patch:8.2.4251: vala files are not recognized (#17235)
Problem:    Vala files are not recognized.
Solution:   Add the *.vala pattern. (closes vim/vim#9654)
97c554d514
2022-01-29 15:40:29 +01:00
5e1c487d99 vim-patch:8.2.4090: after restoring a session buffer order can be quite different (#17112)
Problem:    After restoring a session buffer order can be quite different.
Solution:   Create buffers first. (Evgeni Chasnovski, closes vim/vim#9520)
26ebf1f036

---------------
As in Vim, this basically reverts 8.1.0829 providing different solution
(see vim/vim#9520).

Regarding Neovim, this basically reverts changes from #15062. Test about
restoring same terminals was a bit too restrictive with using actual
buffer ids, which changed with this patch (now they should be in the
same order as at `mksession` call), so I tweaked it.
2022-01-29 14:08:44 +00:00
ed0808412c Merge pull request #17234 from zeertzjq/vim-8.2.4248 2022-01-29 21:32:44 +08:00
950a88d4c2 vim-patch:8.2.4248: no proper test for moving the window separator
Problem:    No proper test for moving the window separator.
Solution:   Add a test.  Add comment in code. (closes vim/vim#9656)
a0c4e2f2d7

Remove the assertion as it is now possible for `fr` to be `NULL`.

The test fails without clearing messages. Not sure if this is a bug.
2022-01-29 20:37:48 +08:00
6dcdec8042 vim-patch:8.2.4052: not easy to resize a window from a plugin (#17028) 2022-01-29 20:37:07 +08:00
cf4d025c5a Merge pull request #17209 from bb010g/patch-1
fix(eval): v:lua support for `-` in module names
2022-01-29 11:45:15 +01:00
8fc9a58256 vim-patch:8.2.0028: searchpairpos() is not tested (#17232) 2022-01-29 16:34:11 +08:00
15c9d88bb7 vim-patch:8.2.4245: ":retab 0" may cause illegal memory access
Problem:    ":retab 0" may cause illegal memory access.
Solution:   Limit the value of 'tabstop' to 10000.
652dee4486

ex_retab change is N/A (+vartabs always available).

Nvim's set_num_option validation logic was refactored, hence why it looks
different from Vim's.

Also use XFREE_CLEAR in other places.
2022-01-29 06:31:51 +00:00
082ff2190c refactor: add static to some functions in funcs.c (#17030) 2022-01-29 08:22:42 +08:00
1ebac3cf4e Merge pull request #17220 from zeertzjq/unget-alt-chord 2022-01-29 06:37:44 +08:00
3adc3fc540 vim-patch:8.2.3678: illegal memory access
Problem:    Illegal memory access.
Solution:   Ignore changed indent when computing byte offset.
85be8563fe
2022-01-29 06:05:39 +08:00
6f04d3f3ef vim-patch:8.2.3581: reading character past end of line
Problem:    Reading character past end of line.
Solution:   Correct the cursor column.
0b5b06cb47
2022-01-29 06:05:39 +08:00
436a470ef5 vim-patch:8.2.3540: the mark '] is wrong after put with a count
Problem:    The mark '] is wrong after put with a count. (Naohiro Ono)
Solution:   Use the right line number. (closes vim/vim#8956)
f47ebf1e1a
2022-01-29 06:05:39 +08:00
5228850749 vim-patch:8.2.3497: put test fails when run by itself
Problem:    Put test fails when run by itself.
Solution:   Source check.vim. (Dominique Pellé, closes vim/vim#8990)
a9173d06f7
2022-01-29 06:05:39 +08:00
7812c6830c vim-patch:8.2.3455: using a count with "gp" leaves '] in wrong position
Problem:    Using a count with "gp" leaves '] in wrong position. (Naohiro Ono)
Solution:   Correct the mark position. (closes vim/vim#8899)
56858e4ed4
2022-01-29 06:05:39 +08:00
fee7d6fba4 vim-patch:8.2.3454: using a count with "gp" leave cursor in wrong position
Problem:    Using a count with "gp" leave cursor in wrong position. (Naohiro
            Ono)
Solution:   Count the inserted lines. (closes vim/vim#8899)
23003e51e1
2022-01-29 06:05:39 +08:00
75f4741db9 fix(input): remove reinterpreted ALT/META chords from recorded macro 2022-01-29 06:05:14 +08:00
af9a2a201d Merge pull request #16951 from zeertzjq/vim-8.2.4007 2022-01-29 06:03:22 +08:00
98fddc1d4c Merge pull request #17213 from zeertzjq/ci-lsan-failure 2022-01-28 13:47:29 -05:00
6fd1b12de1 Merge pull request #17206 from dundargoc/ci/remove-python2 2022-01-28 13:45:32 -05:00
b396387ec8 Merge pull request #16829 from zeertzjq/vim-8.2.2887
vim-patch:8.2.{2887,3414,3999}: fullcommand() follow-up patches
2022-01-29 02:42:14 +08:00
65529dd7a1 Merge pull request #17223 from clason/vim-8.2.4238
vim-patch:8.2.4238: *.tf file could be fileytpe "tf" or "terraform"
2022-01-28 18:44:03 +01:00
fb8cd340dc fix(eval): v:lua support for - in module names 2022-01-28 18:20:26 +01:00
5b9980f01e vim-patch:8.2.4238: *.tf file could be fileytpe "tf" or "terraform"
Problem:    *.tf file could be fileytpe "tf" or "terraform".
Solution:   Detect the type from the file contents. (closes vim/vim#9642)
bd8168c770
2022-01-28 17:01:13 +01:00
6cb670cb2c Merge pull request #17216 from clason/vim-8.2.4233
vim-patch:8.2.{4233,4235,4236,4237}: follow-up patches for recording in Select mode
2022-01-28 14:23:48 +01:00
bea439fe99 vim-patch:8.2.4237: record buffer wrong if character in Select mode was not typed
Problem:    Record buffer wrong if character in Select mode was not typed.
Solution:   Only delete the tail from the record buffer if the character was
            typed. (closes vim/vim#9650)
fbf4f1ca15
2022-01-28 20:53:56 +08:00
ca3e382a4f Merge pull request #17183 from notomo/expose-extmark-right-gravity
feat(api): expose extmark right_gravity and end_right_gravity
2022-01-28 12:38:56 +01:00
175692325b vim-patch:8.2.4236: accessing freed memory
Problem:    Accessing freed memory.
Solution:   Set the bh_curr pointer to NULL.
166788c657
2022-01-28 19:03:39 +08:00
7114764ffb vim-patch:8.2.4235: invalid check for NULL pointer
Problem:    Invalid check for NULL pointer.
Solution:   Remove the check.
37cf413e3e
2022-01-28 19:03:39 +08:00
e691ef338c vim-patch:8.2.4233: crash when recording and using Select mode
Problem:    Crash when recording and using Select mode.
Solution:   When deleting the last recorded character check there is something
            to delete.
a4bc2dd7cc
2022-01-28 19:03:37 +08:00
530c65b17a Merge pull request #16830 from kuuote/vim-8.2.3571 2022-01-28 12:21:15 +08:00
d0493d1104 test(old): reorder test_register.vim according to upstream (#17215) 2022-01-28 09:34:03 +08:00
69f37197c0 fix(completion): update submode message when selecting from API (#17022) 2022-01-28 07:55:10 +08:00
815aa9f642 Merge pull request #16820 from seandewar/vim-8.1.2302
vim-patch:8.1.2302,8.2.{3936,4112}
2022-01-27 23:23:26 +00:00
14751eaf70 Merge pull request #16954 from f380cedric/vim-8.2.3402
vim-patch:8.2.{3402,3403}
2022-01-27 23:05:43 +00:00
503e6f7832 vim-patch:8.2.3403: memory leak for :retab with invalid argument
Problem:    Memory leak for :retab with invalid argument.
Solution:   Free the memory.  Make error messages consistent.
2ddb89f8a9

Changes in ex_retab are N/A (behind a non-FEAT_) and have been dropped.
2022-01-27 23:37:01 +01:00
9779f5c84c vim-patch:8.2.3903: "gM" does not count tabs as expected (#16796) 2022-01-28 06:26:24 +08:00
6eb8c0c0c8 ci: add intercept_tls_get_addr=0 to ASAN_OPTIONS 2022-01-27 23:16:33 +08:00
c5ac04331b vim-patch:8.2.3612: using freed memory with regexp using a mark (#16973)
Problem:    Using freed memory with regexp using a mark.
Solution:   Get the line again after getting the mark position.
64066b9acd
2022-01-27 14:59:30 +01:00
5182627ce9 vim-patch:8.2.3669: buffer overflow with long help argument (#16971)
Problem:    Buffer overflow with long help argument.
Solution:   Use snprintf().
bd228fd097
2022-01-27 14:58:53 +01:00
39d6db3899 docs(helphelp): remove extra backtick interference (#17201)
An extra backtick was explicitly written to show what a backtick looked
like, but it interferes with the syntax highlighting which thinks that
it's a part of a concealed group and couples it with the wrong backtick.
2022-01-27 14:56:18 +01:00
d95bb85024 Merge pull request #17185 from zeertzjq/vim-8.2.3993
vim-patch:8.2.{3993,4002}: when recording a change in Select mode char appears twice
2022-01-27 13:45:34 +01:00
a47fdf8421 Merge pull request #17175 from zeertzjq/vim-8.2.3095
vim-patch:8.2.3095: with 'virtualedit' set to "block" block selection is wrong
2022-01-27 13:44:30 +01:00
7ea09dde5f Merge pull request #17136 from zeertzjq/vim-8.2.4133
vim-patch:8.2.4133: output of ":scriptnames" goes into the message history
2022-01-27 13:43:27 +01:00
8c140be31f feat(ts): expose minimum language version to lua (#17186) 2022-01-27 12:46:56 +01:00
f2d84df4a8 vim-patch:8.2.3095: with 'virtualedit' set to "block" block selection is wrong
Problem:    With 'virtualedit' set to "block" block selection is wrong after
            using "$".  (Marco Trosi)
Solution:   Compute the longest selected line. (closes vim/vim#8495)
b17ab86e7b
2022-01-27 18:55:21 +08:00
d8adb3a721 vim-patch:8.2.4112: function not deleted at end of test
Problem:    Function not deleted at end of test.
Solution:   Delete the function.
d9b74a2a41

oops -- my fault :P
2022-01-27 18:47:55 +08:00
c0ff0cac87 vim-patch:8.2.3936: no proper test for maintaining change mark in diff mode
Problem:    No proper test for maintaining change mark in diff mode.
Solution:   Run the test with internal and external diff. (Sean Dewar,
            closes vim/vim#9424)
ccc1644f95
2022-01-27 18:47:55 +08:00
e8af051f1b test(oldtest): partially port v8.1.2381
Problem:    Not all register related code is covered by tests.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5301)
54c8d229f5

Can't be fully ported until "set clipboard=autoselect,autoselectplus" is
re-implemented for Test_clipboard_regs (and last visual selection to PRIMARY
selection works).
2022-01-27 18:47:55 +08:00
5864edac7b vim-patch:8.1.2302: :lockmarks does not work for '[ and ']
Problem:    :lockmarks does not work for '[ and '].
Solution:   save and restore '[ and '] marks. (James McCoy, closes vim/vim#5222)
f4a1d1c054

Test_diff_maintains_change_mark doesn't actually fail without these changes.
This is fixed in v8.2.3936.
2022-01-27 18:47:52 +08:00
f9080b24c4 fix(ts): escape lang when loading parsers (#16668)
When trying to load a language parser, escape the value of
the language.

With language injection, the language might be picked up from the
buffer. If this value is erroneous it can cause `nvim_get_runtime_file`
to hard error.

E.g., the markdown expression `~~~{` will extract '{' as a language and
then try to get the parser using `parser/{*` as the pattern.
2022-01-27 10:42:59 +01:00
2320f705c4 Merge pull request #17195 from dundargoc/refactor/assert-include
refactor: include missing assert header
2022-01-27 10:23:36 +01:00
3d0149f984 Merge pull request #17191 from zeertzjq/vim-8.2.4203
vim-patch:8.2.4203: entering a character with CTRL-V may include modifiers
2022-01-27 09:00:01 +01:00
a9f112ce3a vim-patch:8.2.4133: output of ":scriptnames" goes into the message history
Problem:    output of ":scriptnames" goes into the message history, while this
            des not happen for other commands, such as ":ls".
Solution:   Use msg_outtrans() instead of smsg(). (closes vim/vim#9551)
840f16202e
2022-01-27 15:55:06 +08:00
9c4e617064 Merge pull request #17166 from Shougo/vim-8.2.4160
vim-patch:8.2.4160: cannot change the register used for Select mode d…
2022-01-27 08:52:08 +01:00
c4b906f341 Merge pull request #17110 from zeertzjq/vim-8.2.3630
vim-patch:8.2.{3630,3663}: printf() with %S does not handle multi-byte correctly
2022-01-27 08:50:38 +01:00
1270949c11 Merge pull request #17150 from zeertzjq/vim-8.2.4166
vim-patch:8.2.4166: undo synced when switching buffer in another window
2022-01-27 08:48:31 +01:00
618f7079e5 Merge pull request #17135 from seandewar/vim-8.2.0175
vim-patch:8.2.0175: crash when removing list element in map()
2022-01-27 08:47:01 +01:00
95b8a8f6ae Merge pull request #17131 from zeertzjq/vim-8.2.3580
vim-patch:8.2.3580: gj does not move properly with a wide character
2022-01-27 08:41:29 +01:00
480fbbe296 Merge pull request #17145 from zeertzjq/vim-8.2.0128
vim-patch:8.2.0128: cannot list options one per line
2022-01-27 08:37:36 +01:00
0813b9fde4 Merge pull request #17094 from zeertzjq/vim-8.2.4091
vim-patch:8.2.4091: virtcol is recomputed for statusline unnecessarily
2022-01-27 08:35:52 +01:00
d50dd12725 Merge pull request #17095 from zeertzjq/vim-8.2.3227
vim-patch:8.2.{3227,3280,4094}: global-local 'virtualedit'
2022-01-27 08:34:57 +01:00
55ad48d939 Merge pull request #17155 from zeertzjq/vim-8.2.3121
vim-patch:8.2.{3121,3410}: two 'listchars' fixes
2022-01-27 08:32:52 +01:00
47b50d5a1c Merge pull request #17174 from zeertzjq/vim-8.2.3153
vim-patch:8.2.3153: URLs with a dash in the scheme are not recognized
2022-01-27 08:32:02 +01:00
f1b91fcdbd Merge pull request #17102 from zeertzjq/vim-8.2.1762
vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
2022-01-27 08:31:17 +01:00
00915864f7 Merge pull request #17184 from zeertzjq/vim-8.2.4190
vim-patch:8.2.4190: all conceal tests are skipped without the screendumps feature
2022-01-27 08:30:24 +01:00
81950af22d refactor: allocate an empty string as unused orig_rhs for Lua mappings 2022-01-27 07:24:25 +08:00
b30ac599f8 ci: remove all code containing python2
Also change all mentions of python 3 to just python.
2022-01-26 23:44:02 +01:00
6006e15e7a Merge pull request #17205 from clason/vim-8.2.4214
Vim 8.2.{4214,4215,4217,4219} various illegal memory accesses
2022-01-26 22:39:45 +01:00
540264306b vim-patch:8.2.4219: reading before the start of the line
Problem:    Reading before the start of the line.
Solution:   Check boundary before trying to read the character.
44db8213d3
2022-01-26 22:02:56 +01:00
e9247b0d5d vim-patch:8.2.4217: illegal memory access when undo makes Visual area invalid
Problem:    Illegal memory access when undo makes Visual area invalid.
Solution:   Correct the Visual area after undo.
8d02ce1ed7

vim-patch:8.2.4218: illegal memory access with bracketed paste in Ex mode (N/A)
2022-01-26 22:01:19 +01:00
b2b288f33c vim-patch:8.2.4215: illegal memory access when copying lines in Visual mode
Problem:    Illegal memory access when copying lines in Visual mode.
Solution:   Adjust the Visual position after copying lines.
dc5490e2cb
2022-01-26 22:00:29 +01:00
de673966c3 vim-patch:8.2.4214: illegal memory access with large 'tabstop' in Ex mode
Problem:    Illegal memory access with large 'tabstop' in Ex mode.
Solution:   Allocate enough memory.
85b6747abc
2022-01-26 21:34:26 +01:00
17e2938b10 Merge pull request #17132 from zeertzjq/vim-8.2.3611
vim-patch:8.2.{3494,3611,3613}: two Visual mode crash fixes
2022-01-26 21:33:53 +01:00
b7dc4491a9 refactor: include missing assert header
This will solve the "implicit declaration of function ‘assert’" warning
when running "make lint".
2022-01-26 20:44:45 +01:00
20482a2b83 Merge pull request #17204 from dundargoc/ci/windows/python-version 2022-01-26 13:43:38 -05:00
16d64796f4 ci(windows): use the provided python from github actions
This will prevent future errors whenever support for a specific python
version we rely on is removed.
2022-01-26 16:40:43 +01:00
d11bbacf0f fix(inccommand): do not change reg_prev_sub when previewing 2022-01-25 16:18:58 +08:00
ecec957125 vim-patch:8.2.4196: various file types not recognized (#17182)
Problem:    Various file types not recognized.
Solution:   Add patterns to recognize more file types (closes vim/vim#9607)
428058ab32
2022-01-25 08:22:15 +01:00
dd21e21e97 fix: set RedrawingDisabled before entering aucmd_win 2022-01-25 09:44:37 +08:00
95873aa3eb test: add more tests for Insert mode Ctrl-V 2022-01-25 08:29:04 +08:00
3d9ff675f8 vim-patch:8.2.4203: entering a character with CTRL-V may include modifiers
Problem:    Entering a character with CTRL-V may include modifiers.
Solution:   Reset "mod_mask" when entering a character with digits after
            CTRL-V. (closes vim/vim#9610)
502d8ae3e8

Commenting out test_override() as before.

Commenting out part of CheckNotFeature() because Vim patch 8.2.0427
cannot be ported without breaking a lot of oldtests that check for
removed features.
2022-01-25 08:21:20 +08:00
1b6ae2dbb0 Merge pull request #15910 from glacambre/silent_stdioopen
feat(--headless): do not print anything when stdioopen() has been used
2022-01-24 22:33:55 +01:00
a4069a3eed feat(--headless): add on_print callback to stdioopen
This commit adds an on_print callback to stdioopen's dictionary
argument which lets the caller specify a function called each time
neovim will try to output something to stdout (e.g. on "echo" or
"echoerr" in --headless mode).
2022-01-24 13:59:16 +01:00
1907a94814 Merge pull request #17143 from jamessan/coverity-fixes
Various Coverity fixes
2022-01-24 06:28:09 -05:00
c0a97d982a test(unit): add unit tests for path_with_url 2022-01-24 13:01:35 +08:00
9bb9f17592 vim-patch:8.2.3153: URLs with a dash in the scheme are not recognized
Problem:    URLs with a dash in the scheme are not recognized.
Solution:   Allow for a scheme with a dash, but not at the start or end.
            (Tsuyoshi CHO, closes vim/vim#8299)
7b7a118e74
2022-01-24 13:01:35 +08:00
5c897b6d0c vim-patch:8.2.4002: first char typed in Select mode can be wrong
Problem:    First char typed in Select mode can be wrong.
Solution:   Escape special bytes in the input buffer. (closes vim/vim#9469)
6cac77016b

The `buf` should already be large enough, but I'll change its size
anyway in case future patches change the meaning of `MB_MAXBYTES` macro.

`fix_input_buffer()` cannot be used here because of the `using_script()`
check, and there is already equivalent code in its place.
2022-01-24 12:46:52 +08:00
8f1efb018b vim-patch:8.2.3993: when recording a change in Select mode char appears twice
Problem:    When recording a change in Select mode the first typed character
            appears twice.
Solution:   When putting the character back into typeahead remove it from
            recorded characters. (closes vim/vim#9462)
c88e977862
2022-01-24 12:46:52 +08:00
1b184cea3b vim-patch:8.2.4190: all conceal tests are skipped without the screendumps feature
Problem:    All conceal tests are skipped without the screendumps feature.
Solution:   Only skip the tests that use screendumps. (closes vim/vim#9599)
206919191f
2022-01-24 11:10:37 +08:00
3d9ae9d2da feat(api): expose extmark right_gravity and end_right_gravity 2022-01-24 09:52:13 +09:00
7e2ce35e3b Merge pull request #17156 from zeertzjq/vim-8.2.3584
vim-patch:8.2.{3584,3586,3587}: :command "-keepscript" argument
2022-01-23 19:42:30 +01:00
f20bd439df Merge pull request #17168 from zeertzjq/ins-char-typebuf-mods
fix(input): put modifiers back into typeahead buffer when needed
2022-01-23 19:40:59 +01:00
4ba7fa1700 vim-patch:6f4754b9f725 (#17179)
Update runtime files
6f4754b9f7
2022-01-23 18:38:41 +01:00
28352dc6e5 vim-patch:8.2.4188: not all gitconfig files are recognized (#17178)
Problem:    Not all gitconfig files are recognized.
Solution:   Add a few more patterns. (Tim Pope, closes vim/vim#9597)
bcfa11b7df
2022-01-23 17:50:45 +01:00
ffd9551aa2 vim-patch:8.2.4191: json5 files are not recognized (#17180)
Problem:    json5 files are not recognized.
Solution:   Add a pattern for json5 files. (closes vim/vim#9601)
e15ebeffb3
2022-01-23 16:19:48 +01:00
3d62dd2077 vim-patch:8.2.4187: gnuplot file not recognized (#17177)
Problem:    Gnuplot file not recognized.
Solution:   Recognize ".gnuplot". (closes vim/vim#9588)
ff5cbe8133
2022-01-23 13:52:37 +01:00
0efe1ec6b3 test(input): add more tests for K_SPECIAL escaping in ins_char_typebuf() 2022-01-23 05:58:32 +08:00
818456470c fix(input): put modifiers back into typeahead buffer when needed 2022-01-23 05:58:32 +08:00
7717f38d3f Merge pull request #17169 from clason/bump-treesitter
build(deps): bump tree-sitter to v0.20.3
2022-01-22 18:39:14 +01:00
db9cfb18e1 build(deps): bump tree-sitter to v0.20.3
this version contains massive performance improvements as well as a new
`--abi` flag that allows generating backward compatible parsers
2022-01-22 09:02:06 +01:00
d7ab4e819a vim-patch:8.2.4160: cannot change the register used for Select mode delete
Problem:    Cannot change the register used for Select mode delete.
Solution:   Make CTRL-R set the register to be used when deleting text for
            Select mode. (Shougo Matsushita, closes vim/vim#9531)
4ede01f188
2022-01-22 11:57:06 +09:00
e07a4b97f6 Merge pull request #16936 from zeertzjq/no-escape-csi
input: never escape CSI bytes and clean up related names and comments
2022-01-21 18:04:40 +01:00
be22cc1264 Merge pull request #17076 from notomo/expose-extmark-more-details
feat(api): expose extmark more details
2022-01-21 18:02:47 +01:00
9d02fc4c00 vim-patch:8.2.4172: filetype detection for BASIC is not optimal (#17161)
Problem:    Filetype detection for BASIC is not optimal.
Solution:   Improve BASIC filetype detection. (Doug Kearns)
6517f14165
2022-01-21 16:45:32 +01:00
f2dbeca863 vim-patch:8.2.3587: compiler test fails with backslash file separator
Problem:    Compiler test fails with backslash file separator.
Solution:   Accept slash and backslash.
0a15c7676b
2022-01-21 18:18:18 +08:00
792381e1a0 vim-patch:8.2.3586: command completion test fails
Problem:    Command completion test fails.
Solution:   Add new argument to expected output
326e7da609
2022-01-21 18:18:18 +08:00
8e84d1b930 vim-patch:8.2.3584: "verbose set efm" reports location of the :compiler command
Problem:    "verbose set efm" reports the location of the :compiler command.
            (Gary Johnson)
Solution:   Add the "-keepscript" argument to :command and use it when
            defining CompilerSet.
58ef8a31d7
2022-01-21 18:18:18 +08:00
cb39c825c4 vim-patch:8.2.3410: crash with linebreak, listchars and large tabstop
Problem:    Crash with linebreak, listchars and large tabstop.
Solution:   Account for different size listchars for a tab. (closes vim/vim#8841)
89a54b413a
2022-01-21 18:16:16 +08:00
296b8fbe3b vim-patch:8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Problem:    'listchars' "exceeds" character appears in foldcolumn. Window
            separator is missing. (Leonid V.  Fedorenchik)
Solution:   Only draw the "exceeds" character in the text area.  Break the
            loop when not drawing the text. (closes vim/vim#8524)
41fb723ee9
2022-01-21 18:16:16 +08:00
6e69a3c3e7 refactor: remove CSI unescaping and clean up related names and comments 2022-01-21 18:08:56 +08:00
8300d337c8 refactor: remove the <xCSI> key
CSI typed directly is now just <CSI>. The <xCSI> key is obsolete.
2022-01-21 18:08:56 +08:00
ff7c3d1275 fix(input): never escape CSI bytes 2022-01-21 18:08:56 +08:00
c977d8b43c docs(lsp): fix on_publish_diagnostics example (#17146) 2022-01-21 08:40:48 +01:00
8e702c14ac feat(lsp): add handler for workspace/workspaceFolders (#17149) 2022-01-21 07:51:34 +01:00
2fa1b4cbff vim-patch:8.2.4166: undo synced when switching buffer in another window
Problem:    Undo synced when switching buffer in another window.
Solution:   Do not sync undo when not needed. (closes vim/vim#9575)
e615db0604
2022-01-21 05:14:40 +08:00
aa4eadd2be vim-patch:8.2.0128: cannot list options one per line
Problem:    Cannot list options one per line.
Solution:   Use ":set!" to list one option per line.
6b915c0c0e
2022-01-20 14:34:24 +08:00
5971b86338 feat(api): expose extmark more details 2022-01-20 13:25:46 +09:00
d224957d30 fix(coverity/188749): nullify pointer to fix use-after-free 2022-01-19 22:47:09 -05:00
e850a92986 fix(coverity/340720): error if nvim_eval_statusline given invalid winid 2022-01-19 21:54:06 -05:00
8f241e535f refactor(coverity/345583): assert fp is non-NULL
Since we already have a typval, we know the lookup will succeed.
2022-01-19 21:43:09 -05:00
0c541ab1f6 refactor(coverity/345582): assert fp is non-NULL
Since we already have a typval, we know the lookup will succeed.
2022-01-19 21:42:23 -05:00
431915fe6a test(put_spec): correctly order parameters to eq() (#17134)
The first parameter to eq() should be the expected value, and the second
parameter should be the actual value.
2022-01-19 13:53:39 -07:00
96aa7dd097 Merge pull request #17130 from clason/bump-treesitter
build(deps): bump tree-sitter
2022-01-19 09:24:20 +01:00
de6f9233ee refactor: source ftplugin.vim separately from filetype.vim (#17129)
This is a follow-on to #17040. The real benefit of #17040 was ensuring
that the ftplugin FileType autocommand was defined first and thus always
fired first. A side effect of the implementation in #17040 was that
setting variables that modified the state of filetype detection (such as
g:did_load_filetypes or g:do_filetype_lua) could no longer be set in the
user's init file. Filetype detection can also no longer be prevented
from loading by using `:filetype off`.

This PR addresses both of those side effects by unconditionally sourcing
ftplugin.vim and indent.vim before the user's init file (which ensures
that these autocommands run first) and sourcing filetype.vim *after* the
user's init file (thus allowing it to be blocked or modified).
2022-01-18 12:46:41 -07:00
1ae73e2d1c vim-patch:8.2.0175: crash when removing list element in map()
Problem:    Crash when removing list element in map().
Solution:   Lock the list. (closes vim/vim#2652)
db661fb95d
2022-01-18 12:49:30 +00:00
5e81687d9a vim-patch:8.2.3402: invalid memory access when using :retab with large value
Problem:    Invalid memory access when using :retab with large value.
Solution:   Check the number is positive.
b7081e135a
2022-01-18 10:04:32 +01:00
45f7fc9b06 build(deps): bump tree-sitter
update tree-sitter to
2346570901
which includes a massive performance improvement to query construction
(bumping ABI compatibility to 14; parsers need to be generated with a
flag to take advantage of this)
2022-01-18 09:07:12 +01:00
dda1c8edda vim-patch:8.2.3613: :find test fails
Problem:    :find test fails.
Solution:   Put length check inside if block.
e015d99abb
2022-01-18 10:05:31 +08:00
ec39e1e421 vim-patch:8.2.3611: crash when using CTRL-W f without finding a file name
Problem:    Crash when using CTRL-W f without finding a file name.
Solution:   Bail out when the file name length is zero.
615ddd5342
2022-01-18 10:05:31 +08:00
0a65d821fc vim-patch:8.2.3494: illegal memory access in utf_head_off
Problem:    Illegal memory access in utf_head_off.
Solution:   Check cursor position when reselecting the Visual area.
            (closes vim/vim#8963)
b07626d4af

Including the XTest_beval -> XTest_block from patch 8.2.3096.
2022-01-18 10:05:31 +08:00
176df92bd7 vim-patch:8.2.3580: gj does not move properly with a wide character
Problem:    gj does not move properly with a wide character.
Solution:   Move one to the right. (Christian Brabandt, closes vim/vim#8702)
aaec1d4fb1
2022-01-18 07:46:46 +08:00
fcf5dd34fd refactor: enable filetype detection before user startup scripts (#17040) 2022-01-17 14:11:59 -07:00
ad2dbd4b5f fix(man.vim): support calling :Man without a section again (#17119)
When `man -w` is called with an empty string as section name, it may
fail with an error code, which causes :Man to no longer work without a
section. Just remove that argument when no section is specified.
2022-01-17 11:45:46 -07:00
70db972e5f Merge pull request #16813 from neovim/marvim/api-doc-update/master
docs: regenerate
2022-01-17 13:37:28 -05:00
64b906a3fa Merge pull request #17125 from jamessan/auto-prs-as-draft
ci: create automated PRs as draft PRs
2022-01-17 13:37:19 -05:00
66076e5e1b ci: create automated PRs as draft PRs
GH workflows aren't allowed to trigger other GH workflows.  Since
commitlint is a required check now, we need something manual to happen
for it to run on vim-patch/api-doc PRs.

Creating these PRs as drafts and then marking them as "ready to review"
when we want to merge them will provide the manual trigger to run
commitlint.

[skip ci]
2022-01-17 13:36:01 -05:00
2c94b75eac docs: regenerate [skip ci] 2022-01-17 18:28:23 +00:00
8f54b88a5e Merge pull request #17122 from dundargoc/ci/remove-non-working-job
ci: remove non-working add-reviewer job
2022-01-17 13:11:46 -05:00
50eabe1c47 Merge pull request #17106 from jamessan/always-run-commitlint
Always run commitlint check
2022-01-17 13:08:27 -05:00
6c1d6f3dd6 ci: remove non-working add-reviewer job 2022-01-17 18:48:08 +01:00
69b2dd175c ci(api-docs): avoid running ci for doc commits 2022-01-17 12:21:16 -05:00
d7e2229b41 ci(commitlint): use pull_request_target to avoid "skip ci" 2022-01-17 12:21:09 -05:00
9055ec5792 perf(lsp): request only changed portions of the buffer in changetracking (#17118)
This commits introduces two performance improvements in incremental sync:

* avoiding expensive lua string reallocations on each on_lines call by requesting
only the changed chunk of the buffer as reported by firstline and new_lastline
parameters of on_lines
* re-using already allocated tables for storing the resulting lines to reduce the load on
the garbage collector

The majority of the performance improvement is from requesting only changed chunks
of the buffer.

Benchmark:

The following code measures the time required to perform a buffer edit to
that operates individually on each line, common to plugins such as vim-commentary.

    set rtp+=~/.config/nvim/plugged/nvim-lspconfig
    set rtp+=~/.config/nvim/plugged/vim-commentary
    lua require('lspconfig')['ccls'].setup({})
    function! Benchmark(tries) abort
        let results_comment = []
        let results_undo = []
        for i in range(a:tries)
            echo printf('run %d', i+1)
            let begin = reltime()
            normal gggcG
            call add(results_comment, reltimefloat(reltime(begin)))
            let begin = reltime()
            silent! undo
            call add(results_undo, reltimefloat(reltime(begin)))
            redraw
        endfor
        let avg_comment = 0.0
        let avg_undo = 0.0
        for i in range(a:tries)
            echomsg printf('run %3d: comment=%fs undo=%fs', i+1, results_comment[i], results_undo[i])
            let avg_comment += results_comment[i]
            let avg_undo += results_undo[i]
        endfor
        echomsg printf('average: comment=%fs undo=%fs', avg_comment / a:tries, avg_undo / a:tries)
    endfunction
    command! -bar Benchmark call Benchmark(10)

All text changes will be recorded within a single undo operation. Both the
comment operation itself and the undo operation will generate an on_lines event
for each changed line. Formatter plugins using setline() have also been found
to exhibit the same problem (neoformat, :RustFmt in rust.vim), as this function
too generates an on_lines event for every line it changes.

Using the neovim codebase as an example (commit 2ecf0a4)
with neovim itself built at 2ecf0a4 with
CMAKE_BUILD_TYPE=Release shows the following performance improvement:

src/nvim/lua/executor.c, 1432 lines:
  - baseline, no optimizations:             comment=0.540587s undo=0.440249s
  - without double-buffering optimization:  comment=0.183314s undo=0.060663s
  - all optimizations in this commit:       comment=0.174850s undo=0.052789s

src/nvim/search.c, 5467 lines:
  - baseline, no optimizations:             comment=7.420446s undo=7.656624s
  - without double-buffering optimization:  comment=0.889048s undo=0.486026s
  - all optimizations in this commit:       comment=0.662899s undo=0.243628s

src/nvim/eval.c, 11355 lines:
  - baseline, no optimizations:             comment=41.775695s undo=44.583374s
  - without double-buffering optimization:  comment=3.643933s undo=2.817158s
  - all optimizations in this commit:       comment=1.510886s undo=0.707928s

Co-authored-by: Dmytro Meleshko <dmytro.meleshko@gmail.com>
2022-01-17 08:19:33 -08:00
3906b2d4fc vim-patch:fd31be29b822 (#17114)
Update runtime files
fd31be29b8
2022-01-17 11:58:36 +01:00
0c0469c4f5 Merge pull request #15242 from dundargoc/docs/vim-patch/move-outsite-of-getting-started
docs: deprioritize vim-patch as a good beginner task
2022-01-16 23:39:38 +01:00
4388793799 docs: deprioritize vim-patch as a good beginner task
Also add a disclaimer where familiarity with vim is strongly suggested.
2022-01-16 22:10:22 +01:00
be15ac06ba feat(statusline): support multibyte fillchar
This includes a partial port of Vim patch 8.2.2569 and some changes to
nvim_eval_statusline() to allow a multibyte fillchar. Literally every
line of C code touched by that patch has been refactored in Nvim, and
that patch contains some irrelevant foldcolumn tests I'm not sure how to
port (as Nvim's foldcolumn behavior has diverged from Vim's).
2022-01-16 19:54:27 +08:00
658ef9c01e vim-patch:8.2.3663: using %S in printf() does not work correctly
Problem:    Using %S in printf() does not work correctly.
Solution:   Fix the problem and add more tests. (closes vim/vim#9208)
1f2453fec6
2022-01-16 17:37:06 +08:00
9afefd32d3 vim-patch:8.2.3630: printf() with %S does not handle multi-byte correctly
Problem:    Printf() with %S does not handle multi-byte correctly.
Solution:   Count cells instead of bytes. (closes vim/vim#9169, closes vim/vim#7486)
d85fccdfed
2022-01-16 17:37:06 +08:00
7085e5b0c8 fix(lsp): avoid nil workspace/symbol query (#17107) 2022-01-15 23:08:35 -08:00
a0201b6ed3 fix(lsp): fetch offset_encoding from client in references (#17104) 2022-01-15 15:49:29 -08:00
561df30981 Merge pull request #16836 from bfredl/mark2
refactor(marks): use a more efficient representation with less pointer indirection
2022-01-15 23:59:40 +01:00
b455e0179b feat: use nvim_buf_set_extmark for vim.highlight (#16963)
Closes https://github.com/neovim/neovim/issues/13647

This allows customizing the priority of the highlights.

* Add default priority of 50
* Use priority of 200 for highlight on yank
* use priority of 40 for highlight references (LSP)
2022-01-15 14:19:20 -08:00
95ab979fde refactor(extmarks): use a more efficient representation
marktree.c was originally constructed as a "generic" datatype,
to make the prototyping of its internal logic as simple as possible
and also as the usecases for various kinds of extmarks/decorations was not yet decided.
As a consequence of this, various extra indirections and allocations was
needed to use marktree to implement extmarks (ns/id pairs) and
decorations of different kinds (some which is just a single highlight
id, other an allocated list of virtual text/lines)

This change removes a lot of indirection, by making Marktree specialized
for the usecase. In particular, the namespace id and mark id is stored
directly, instead of the 64-bit global id particular to the Marktree
struct. This removes the two maps needed to convert between global and
per-ns ids.

Also, "small" decorations are stored inline, i.e. those who
doesn't refer to external heap memory anyway. That is highlights (with
priority+flags) are stored inline, while virtual text, which anyway
occurs a lot of heap allocations, do not. (previously a hack was used
to elide heap allocations for highlights with standard prio+flags)

TODO(bfredl): the functionaltest-lua CI version of gcc is having
severe issues with uint16_t bitfields, so splitting up compound
assignments and redundant casts are needed. Clean this up once we switch
to a working compiler version.
2022-01-15 22:08:12 +01:00
f3193c7b54 Merge pull request #17001 from mjlbach/feat/non-strict-extmarks
feat(extmarks): add strict option
2022-01-15 21:06:04 +01:00
d8eec8e344 Hopefully last attempt 2022-01-15 09:00:01 -08:00
facd07bcf7 Address review r3 2022-01-15 08:37:44 -08:00
8e945c2524 vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
Problem:    When a timer uses :stopinsert Insert mode completion isn't
            stopped. (Stanley Chan)
Solution:   Call ins_compl_prep(ESC).
d0e1b7103c
2022-01-15 22:33:16 +08:00
c09147aad9 vim-patch:8.2.4095: sed script not recognized by the first line (#17101)
Problem:    Sed script not recognized by the first line.
Solution:   Recognize a sed script starting with "#n". (Doug Kearns)
e3ce17a3ca
2022-01-15 14:47:25 +01:00
6c22e5fd1a vim-patch:8.2.4094: 'virtualedit' is window-local but using buffer-local enum
Problem:    'virtualedit' is window-local but using buffer-local enum.
Solution:   Use window-local enum. (closes vim/vim#9529)
e1833bfd01
2022-01-15 19:21:17 +08:00
87e54f123a vim-patch:8.2.3280: 'virtualedit' local to buffer is not the best solution
Problem:    'virtualedit' local to buffer is not the best solution.
Solution:   Make it window-local. (Gary Johnson, closes vim/vim#8685)
51ad850f5f
2022-01-15 19:21:17 +08:00
d391940b9a vim-patch:8.2.3227: 'virtualedit' can only be set globally
Problem:    'virtualedit' can only be set globally.
Solution:   Make 'virtualedit' global-local. (Gary Johnson, closes vim/vim#8638)
53ba05b090

I changed some macros to unsigned integer literals to avoid compiler warnings.
2022-01-15 19:21:17 +08:00
147f65373e vim-patch:8.2.4091: virtcol is recomputed for statusline unnecessarily
Problem:    Virtcol is recomputed for statusline unnecessarily.
Solution:   Just use "w_virtcol". (closes vim/vim#9523)
0f112052ac
2022-01-15 07:47:13 +08:00
574a582202 feat(lsp): dynamically generate list title in response_to_list (#17081)
This gives quickfix/location lists created by handlers which use
'response_to_list' (textDocument/documentSymbols and workspace/symbol by
default) the ability to set a more useful list title. This commit gives
lists created for documentSymbols a title of the form:

    Symbols in <filename>

and lists for workspace/symbol a title of the form:

    Symbols matching '<query>'

These are more informative than a standard "Language Server" list title
and can help disambiguate results when users have multiple quickfix
lists that they cycle through with `:colder` and `:cnewer`.
2022-01-14 14:20:50 -07:00
59ea8fa322 fix(filetype): expand tildes in filetype patterns (#17091)
This allows patterns like

  ["~/.config/foo"] = "fooscript"

to work.
2022-01-14 14:20:17 -07:00
bac4bb1900 Merge pull request #16998 from zeertzjq/lua-vim-var-funcref
feat(api, lua): more conversions between LuaRef and Vim Funcref
2022-01-14 18:00:20 +01:00
b72aae85fd fix(lsp): always split text edits on \r, \r\n, and \n (#17087)
Closes: https://github.com/neovim/neovim/issues/17053

Servers can return a mix of line endings per the language server
protocol. See:

https://microsoft.github.io/language-server-protocol/specification.html#textDocuments

All should be equally treated as line endings.
2022-01-14 08:02:44 -08:00
a88046fe2d Merge pull request #17086 from zeertzjq/vim-8.1.2375
vim-patch:8.1.2375: no suffucient testing for registers
2022-01-13 21:43:58 -05:00
e1b557d913 vim-patch:8.1.2375: no suffucient testing for registers
Problem:    No suffucient testing for registers.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5296)
            Fix that "p" on last virtual column of tab inserts spaces.
6f1f0ca3ed

This patch doesn't actually change any behavior in Nvim, because Nvim
always has vartabs feature.

I modified a line in the test because of #6137.
2022-01-14 07:31:21 +08:00
9b04336445 Merge pull request #16978 from gpanders/filetype-updates 2022-01-13 15:58:39 -07:00
6e04c8653c fix(filetype): fix foam pattern detection 2022-01-13 15:32:20 -07:00
c38d602b88 feat(filetype.lua): fix .cc file not detected 2022-01-13 15:32:20 -07:00
7a574e54f2 feat(filetype.lua): add support for files under .git 2022-01-13 15:32:18 -07:00
27b664a2de feat(filetype.lua): add support for patch files 2022-01-13 15:31:59 -07:00
94d5358922 feat(filetype.lua): add support for tmux.conf files 2022-01-13 15:31:59 -07:00
19864bd995 feat(filetype.lua): fix .env file not detected 2022-01-13 15:31:59 -07:00
596c55756a vim-patch:8.2.4077: not all Libsensors files are recognized (#17080)
Problem:    Not all Libsensors files are recognized.
Solution:   Add "sensors.d/*" pattern. (Doug Kearns)
8d9e470aa9
2022-01-13 18:31:15 +01:00
8066abcd65 fix(lsp): forward offset_encoding in rename handler (#17079) 2022-01-13 18:28:27 +01:00
9304ee3874 fix(lsp): forward offset_encoding to apply_text_edits (#17075) 2022-01-13 06:47:35 -08:00
4570df0b43 Merge pull request #17034 from zeertzjq/compl-lua-select
feat(completion): support selecting item via API from Lua mapping
2022-01-13 12:26:34 +01:00
bc722c8a74 fix(lsp): strictly enforce passing offset encoding (#17049)
This removes the "fallback" to utf-16 in many of our helper functions. We
should always explicitly pass these around when possible except in two
locations:

* generating params with help utilities called by buf.lua functions
* the buf.lua functions themselves

Anything that is called by the handler should be passed the offset encoding.
2022-01-13 02:34:04 -08:00
e7cd811567 fix(lsp): handle negative activeSignature in signatureHelp (#17064)
omnisharp-roslyn can send negative values:

    {
      activeParameter = 0,
      activeSignature = -1,
      signatures = { {
          documentation = "",
          label = "TestEntity.TestEntity()",
          parameters = {}
        } }
    }

In 3.16 of the specification `activeSignature` is defined as `uinteger`
and therefore negative values shouldn't be allowed, but within 3.15 it
was defined as `number` which makes me think we can be a bit lenient in
this case and handle them.

The expected behavior is quite clear:

    The active signature. If omitted or the value lies outside the
    range of `signatures` the value defaults to zero or is ignored if
    the `SignatureHelp` has no signatures.

Fixes an error:

    util.lua:1685: attempt to get length of local 'lines' (a nil value)
    util.lua:1685: in function 'trim_empty_lines'
    handlers.lua:334: in function 'textDocument/signatureHelp'
2022-01-13 01:47:36 -08:00
43ef7df22d fix(lsp): fix applying multiple out-of-range TextEdits (#17037) 2022-01-13 10:28:13 +01:00
f9b3b2dcfc Merge pull request #16945 from theHamsta/cached-queries
perf(treesitter): cache query parsing
2022-01-13 08:50:01 +00:00
c8656e44d8 feat(api, lua): more conversions between LuaRef and Vim Funcref 2022-01-13 15:07:40 +08:00
3ee1ba35a7 fix(keywordprg): retain terminal buffer after K (#17046) 2022-01-12 22:04:30 -07:00
2fd8330628 Address review r2 2022-01-12 12:46:31 -08:00
d0d4fb792f Address 'review' 2022-01-12 12:28:18 -08:00
39a35dd006 Merge pull request #17058 from clason/bump-treesitter
build(deps): bump treesitter to commit bf210f0
2022-01-12 17:56:44 +00:00
5d15829c2b build(deps): bump treesitter to commit bf210f0
Update to bf210f0c9e, which is a significant improvement to query performance.
2022-01-12 17:04:00 +01:00
c4ce51478a Merge pull request #17054 from jamessan/debug-publish-issues
ci(release): enable gh's api debug logs when creating the release
2022-01-12 07:15:41 -05:00
5bd7ae5b0f ci(release): enable gh's api debug logs when creating the release
This is intended to help track down why the release is sporadically left
in draft state, rather than being published.

[skip ci]
2022-01-12 07:13:25 -05:00
f92a2457c2 Merge pull request #17045 from gpanders/diagnostic-fixups
Various diagnostic fixups
2022-01-11 19:47:50 -07:00
c915571b99 feat(diagnostic): allow retrieving current diagnostic config 2022-01-11 16:46:42 -07:00
8a27205d09 fix(diagnostic): only set default handler config if unset 2022-01-11 16:44:07 -07:00
984270c09f fix(diagnostic): allow setting arbitrary config values 2022-01-11 16:43:47 -07:00
fc8af96888 fix(diagnostic): resolve nil opts tables
In functions which allow opts to be optional, ensure that the value
actually resolves to a non-nil value.
2022-01-11 16:39:15 -07:00
70fe3ce004 vim-patch:8.2.4064: foam files are not detected (#17041)
* vim-patch:8.2.4064: foam files are not detected

Problem:    Foam files are not detected.
Solution:   Detect the foam filetype by the path and file contents. (Mohammed
            Elwardi Fadeli, closes vim/vim#9501)
2284f6cca3

* Port foam ft detection to filetype.lua

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-01-11 21:02:58 +01:00
074b033e7e refactor(lsp): debounce timer per buf and unify with non-debounce (#17016)
Part of the `pending_change` closure in the `changetracking.prepare` was
a bit confusing because it has access to `bufnr` and `uri` but it could
actually contain pending changes batched for multiple buffers.

(We accounted for that by grouping `pending_changes` by a `uri`, but
it's not obvious what's going on)

This commit changes the approach to do everything per buffer to avoid
any ambiguity.

It also brings the debounce/no-debounce a bit closer together: The
only difference is now whether a timer is used or if it is triggered
immediately
2022-01-11 18:10:29 +01:00
43b95b5430 Merge pull request #16962 from f380cedric/vim-8.2.3409
vim-patch:8.2.3409
2022-01-11 14:14:27 +00:00
e866da12ee vim-patch:2f0936cb9a2e (#17007)
* vim-patch:2f0936cb9a2e

Update runtime files
2f0936cb9a
2022-01-11 14:14:17 +01:00
25eb7692d8 Merge pull request #16961 from f380cedric/vim-8.2.3582
vim-patch:8.2.3582
2022-01-11 06:50:13 +00:00
c7aa64631d feat(completion): support selecting item via API from Lua mapping 2022-01-11 13:59:39 +08:00
7165e7770d fix(man.vim): fix search function on some systems (#13709)
Fixes man.vim's searching on some systems (namely mandoc) where
previously it would not respect the value of b:man_default_sects. It now
properly parses man pages on these systems.
2022-01-10 09:36:46 -07:00
3f2fbb824e fix(lsp): ensure pending changes are flushed on skipped debounce (#17015)
Follow up to https://github.com/neovim/neovim/pull/16881

Document changes could get sent out of order to the server:

    1. on_lines: debounce > 0; add to pending changes; setup timer
    2. on_lines: debounce = 0; send new changes immediately
    3. timer triggers, sending changes from 1.
2022-01-10 17:33:36 +01:00
69f1f906a0 Merge pull request #17025 from zeertzjq/compl-k-lua
fix(completion): prevent K_LUA from closing pum
2022-01-10 15:50:37 +01:00
42e5fd32b0 fix(completion): prevent K_LUA from closing pum 2022-01-10 21:30:32 +08:00
2818de8b76 Merge pull request #17006 from vigoux/tree-sitter-alloc
feat(treesitter): set allocator when possible
2022-01-10 10:52:23 +00:00
8f27c4a041 Merge pull request #17013 from dundargoc/ci/continue-on-error
ci: add a continue-on-error to the add-reviewer jobs
2022-01-09 15:24:43 -05:00
4b84544d86 Merge pull request #16849 from dundargoc/refactor/pvs/v1048
refactor(PVS/V1048): prevent "variable was assigned the same value" warning
2022-01-09 20:30:47 +01:00
f29a4ec553 ci: add a continue-on-error to the add-reviewer jobs
This is to circumvent a limitation in GitHub Actions that requires
special organization access in order to add any reviewers.
2022-01-09 19:57:25 +01:00
6ecaba510f test: use old style test for testing filetype.lua (#17003)
This is a much better solution than #16942 as it doesn't require copying
every new change from test_filetype.vim into filetype_spec.lua (which is
much more maintainable).
2022-01-09 09:11:09 -07:00
a34652ee84 fix(api): validate user_command name (#17004)
The name argument of nvim_add_user_command must begin with an uppercase
character. Check that is does.
2022-01-09 08:54:03 -07:00
8d5288889a Merge pull request #16965 from dundargoc/ci/add-reviewer-based-on-label
ci: add reviewer based on label
2022-01-09 08:57:13 -05:00
fd71162428 ci: add reviewer based on label
Also remove CODEOWNERS since this is a superior solution.
2022-01-09 11:30:05 +01:00
b1e0aa60f9 feat(treesitter): set allocator when possible
Adds a new cmake check to keep this backwards compatible with the
different versions of tree-sitter.
2022-01-09 10:17:46 +00:00
c7ffe406bc Merge pull request #16983 from dundargoc/test/add-vimruntime-variable
test: add VIMRUNTIME variable to the clear function
2022-01-08 19:31:37 -05:00
2e5bafa04c Merge pull request #17000 from dundargoc/ci/use-continue-on-error
ci: use continue-on-error instead of "|| true"
2022-01-08 16:10:47 -05:00
adf213e05e refactor(PVS/V1048): ignore "assigned the same value" warning 2022-01-08 21:11:43 +01:00
6c4b9c914b Merge pull request #16979 from dundargoc/ci/add-tsan-clang-sanitizer
ci: set CLANG_SANITIZER variable to TSAN when running the tsan job
2022-01-08 15:01:27 -05:00
e41e8b3fda fix(lsp): only send valid params in executeCommand (#16987) 2022-01-08 10:15:41 -08:00
11142f6ffe feat(extmarks): add strict option
The strict option, when set to false, allows placing extmarks on
invalid row and column values greater than the maximum buffer row
or line column respectively.

This allows for nvim_buf_set_extmark
to be a drop-in replacement for nvim_buf_set_highlight.
2022-01-08 08:47:20 -08:00
9386fca597 Merge pull request #16848 from dundargoc/refactor/prevent-overflow-by-casting
refactor: avoid overflow by explicitly casting operand to a wider type
2022-01-08 16:47:23 +01:00
e70ea6ea20 test: remove redundant feed_command('terminal') (#16993)
It just types :terminal<CR> into the terminal, which is redundant.
2022-01-08 08:29:32 -07:00
559aa4179c ci: use continue-on-error instead of "|| true"
The intention is clearer and doesn't rely on shell-isms.
2022-01-08 15:31:14 +01:00
14ec38bcf9 test: add VIMRUNTIME variable to the clear function
Some of the tests will fail if this isn't explicitly set.
2022-01-08 14:40:29 +01:00
3088ac71f9 Merge pull request #16991 from bk2204/ex-mode
Make mode() return correct value in ex mode
2022-01-08 13:13:43 +01:00
b65a23a13a fix(lsp): resolve bufnr for get_lines (#16986)
Closes https://github.com/neovim/neovim/issues/16985

* get_lines checks if buf_loaded using bufnr 0, which is
  typically used as a sentinel value, but here must be resolved
  to the true bufnr
2022-01-08 11:30:59 +01:00
600e7e3b32 fix: make mode() return correct value in ex mode
When the user is in ex mode, a call to mode(1) is documented to return
"cv".  However, it does not currently do so, because the check which
checks for ex mode is nested inside a conditional which is never reached
in ex mode.  Vim uses an explicit check for exmode_active, so let's do
the same thing here.  Add some tests for this case both with a TTY and
in silent mode.
2022-01-08 03:11:50 +00:00
e92b816336 fix(filetype): match negative priority patterns after extensions (#16980)
Negative priority patterns are those that act as catch-alls when all
other attempts at matching have failed (typically the patterns that use
the StarSetf functions).
2022-01-07 19:17:07 -07:00
20122a3590 vim-patch:8.2.4033: running filetype tests leaves directory behind (#16984)
Problem:    Running filetype tests leaves directory behind.
Solution:   Delete the top directory. (closes vim/vim#9483)
a4c96252b1
2022-01-07 19:15:27 -07:00
c2b9dea4ba ci: set CLANG_SANITIZER variable to TSAN when running the tsan job 2022-01-07 20:20:02 +01:00
b4fbb9dcf2 Merge pull request #16970 from dundargoc/ci/serialize-labeler-workflow 2022-01-07 10:33:19 -05:00
df06c36932 ci: run type-scope job after the triage job
This should prevent the scenario of one job accidentally removing a
relevant label from the other.
2022-01-07 13:32:14 +01:00
b680392687 feat(lsp): skip or reduce debounce after idle (#16881)
The idea of the debounce is to avoid overloading a server with didChange
notifications. So far this used a constant value to group changes within
an interval together and send a single notification. A side effect of
this is that when you were idle, notifications are still delayed.

This commit changes the logic to take the time the last notification
happened into consideration, if it has been greater than the debounce
interval, the debouncing is skipped or at least reduced.
2022-01-07 11:56:09 +01:00
bba679c431 vim-patch:8.2.4014: git and gitcommit file types not properly recognized (#16953)
Problem:    Git and gitcommit file types not properly recognized.
Solution:   Adjust filetype detection. (Tim Pope, closes vim/vim#9477)
c689f8c3d9
2022-01-07 10:27:34 +01:00
aa5adef969 vim-patch:8.2.4007: session does not restore help buffer properly
Problem:    Session does not restore help buffer properly when "options' is
            missing from 'sessionoptions'.
Solution:   Use a ":help" command to create the help window. (closes vim/vim#9475,
            closes vim/vim#9458, closes vim/vim#9472)
8e7d9db32b
2022-01-07 13:39:52 +08:00
e58071c92c vim-patch:8.2.0951: search stat test has leftover from debugging (#16967)
Problem:    Search stat test has leftover from debugging.
Solution:   Remove line that writes a file. (Christian Brabandt, closes vim/vim#6224)
6ba24d8763
2022-01-06 18:51:06 -07:00
b435755452 fix(runtime): check markdownError before syn-clear (#16930)
Avoids `E28: No such highlight group name: markdownError` when using a
foreign markdown syntax.
2022-01-06 11:51:47 -07:00
287d3566de fix(lua): print multiple return values with =expr (#16933) 2022-01-06 11:42:31 -07:00
d78e46679d feat(lua): add notify_once() (#16956)
Like vim.notify(), but only displays the notification once.
2022-01-06 11:10:56 -07:00
c6dddc3464 vim-patch:8.2.3582: reading uninitialized memory when giving spell suggestions
Problem:    Reading uninitialized memory when giving spell suggestions.
Solution:   Check that preword is not empty.
15d9890eee
2022-01-06 18:47:31 +01:00
2f779e3361 Merge pull request #16591 from shadmansaleh/feat/lua_keymaps2
feat(lua): add support for lua keymaps
2022-01-06 18:35:31 +01:00
bb7ef83dd3 Merge pull request #16817 from lewis6991/master
vim-patch:8.2.3921: the way xdiff is used is inefficient
2022-01-06 18:26:29 +01:00
9c26939f75 perf(treesitter): cache query parsing 2022-01-06 13:20:22 +01:00
d63284e5a6 vim-patch:8.2.3409: reading beyond end of line with invalid utf-8 character
Problem:    Reading beyond end of line with invalid utf-8 character.
Solution:   Check for NUL when advancing.
65b6056659

Dropped the non-test part, since it is only non-utf8 related.
2022-01-06 13:16:04 +01:00
09d270bcea Merge pull request #16942 from gpanders/test-filetype-lua 2022-01-05 13:21:18 -07:00
ef214e9753 chore: remove lspconfig checkhealth from issue template (#16948) 2022-01-05 12:13:16 -08:00
6c86079fa0 fix(filetype): normalize slashes in file paths 2022-01-05 12:26:43 -07:00
f1590717ac test(filetype): port test_filetype to Lua
Because filetype.lua is gated behind an opt-in variable, it's not tested
during the "standard" test_filetype.vim test. So port the test into
filetype_spec where we enable the opt-in variable.

This means runtime Vim patches will need to update test_filetype in two
places. This can eventually be removed if/when filetype.lua is made
opt-out rather than opt-in.
2022-01-05 10:41:25 -07:00
f40ce34563 fix(filetype): match on <afile> rather than <abuf> (#16943)
Filetype detection runs on BufRead and BufNewFile autocommands, both of
which can fire without an underlying buffer, so it's incorrect to use
<abuf> to determine the file path. Instead, match on <afile> and assume
that the buffer we're operating on is the current buffer. This is the
same assumption that filetype.vim makes, so it should be safe.
2022-01-05 09:50:54 -07:00
55a59e56ed feat(lsp): enable default debounce of 150 ms (#16908) 2022-01-05 08:36:35 -08:00
30547c0d2b vim-patch:8.2.3999: redundant check for NUL byte
Problem:    Redundant check for NUL byte.
Solution:   Remove the check for a NUL byte. (closes vim/vim#9471)
c024ed9233
2022-01-05 22:11:28 +08:00
bfe11dc8d0 vim-patch:8.2.3414: fullcommand() gives wrong name with buffer-local user command
Problem:    fullcommand() gives the wrong name if there is a buffer-local user
            command. (Naohiro Ono)
Solution:   Use a separate function to get the user command name.
            (closes vim/vim#8840)
80c88eac5a
2022-01-05 22:11:28 +08:00
6e1a59da6c vim-patch:8.2.2887: crash when passing null string to fullcommand()
Problem:    Crash when passing null string to fullcommand().
Solution:   Check for NULL pointer. (closes vim/vim#8256)
4c8e8c6e19
2022-01-05 22:11:28 +08:00
f65b0d4236 feat(autocmd): populate v:event in RecordingLeave (#16828) 2022-01-04 18:55:29 -07:00
a45b578dbe feat(filetype.lua): add support for txt files (#16926) 2022-01-04 16:06:57 -07:00
74a90cf098 chore: ignore unused args in filetype functions (#16927)
Also mark the 'getline' helper function as private to avoid docgen.
2022-01-04 15:24:14 -07:00
bb5e03fa4b test: fix absolute paths in filetype_spec (#16920) 2022-01-04 15:21:36 -07:00
60d3bb745d fix(filetype): set default ft_ignore_pat in filetype.lua (#16917)
This default value is also set in filetype.vim, but if filetype.vim is
disabled the variable is never defined, which causes errors in some of
the dist#ft detection functions.
2022-01-04 15:02:01 -07:00
8ade8009ee feat(filetype.lua): Add typescript extension to filetype detection (#16923)
port from `filetype.vim`; also add `getline` convenience function
2022-01-04 22:34:55 +01:00
39238435db fix(api): force redefinition of user commands by default (#16918) 2022-01-04 11:51:45 -07:00
0b0c4f7dfa chore: fix typos (#16816)
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sebastian Volland <seb@baunz.net>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-04 11:07:40 -07:00
d6f0c9539c fix(lsp): suppress ContentModified errors from UI (#16904)
Fixes https://github.com/neovim/neovim/issues/16900

If clients receive a ContentModified error, it generally should not
show it in the UI for the end-user. Clients can resend the request if
they know how to do so.

https://microsoft.github.io/language-server-protocol/specifications/specification-current/#implementationConsiderations
2022-01-04 09:28:13 -08:00
6d41f65aa4 feat(lua): add vim.keymap
This introduces two new functions `vim.keymap.set` & `vim.keymap.del`

differences compared to regular set_keymap:
- remap is used as opposite of noremap. By default it's true for <Plug> keymaps and false for others.
- rhs can be lua function.
- mode can be a list of modes.
- replace_keycodes option for lua function expr maps. (Default: true)
- handles buffer specific keymaps

Examples:
```lua
vim.keymap.set('n', 'asdf', function() print("real lua function") end)
vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, {buffer=true})
vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", {silent = true, buffer = 5 })
vim.keymap.set('i', '<Tab>', function()
  return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>"
end, {expr = true})
vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)')

vim.keymap.del('n', 'asdf')
vim.keymap.del({'n', 'i', 'v'}, '<leader>w', {buffer = 5 })
```
2022-01-04 22:31:59 +06:00
3fd454bd4a feat: filetype.lua (#16600)
Adds a new vim.filetype module that provides support for filetype detection in
Lua.
2022-01-04 07:28:29 -07:00
cc62f3d6cb test: make test for #14040 more stable (#16911) 2022-01-04 07:25:28 -07:00
e79a588937 Merge pull request #16912 from shadmansaleh/enhance/lua_cmd_inspect
feat(lua): make :lua =expr print result of expr
2022-01-04 14:34:42 +01:00
d44254641f feat(lua): make =expr print result of expr 2022-01-04 16:08:07 +06:00
4ddd6c53bd fix(screen): don't put empty sign text in line number column
When `signcolumn=number` but no sign on a given line has any text,
display the line's line number instead of the (empty) sign text in the
line number column.
2022-01-04 01:49:40 -05:00
207307d0fa fix(lsp): explicitly pass bufnr in didSave handler (#16906)
Addresses a regression introduced by the stricter type checking
in lua api functions from https://github.com/neovim/neovim/pull/16745
2022-01-03 21:03:16 -05:00
efe6485aca Merge pull request #16903 from dundargoc/ci/install-flake-with-apt
ci: install flake8 with apt instead of pip
2022-01-03 16:23:20 -05:00
ec615abd1f ci: install flake8 with apt instead of pip 2022-01-03 21:54:23 +01:00
1036ca846e Merge pull request #16901 from dundargoc/ci/add-codeowners
ci: add jamessan as codeowner for ci related files
2022-01-03 14:50:40 -05:00
e402103911 chore(build): compile lua only on release builds (#16859) 2022-01-03 12:44:30 -07:00
e6c1545b19 fix(lsp): resolve nil bufnr (#16902)
Related: #16889, #16745
2022-01-03 12:40:09 -07:00
b402cd3315 ci: add jamessan as codeowner for ci related files
[skip ci]
2022-01-03 20:27:31 +01:00
6aeaff1220 vim-patch:8.2.3995: not all sshconfig files are detected as such (#16899)
Problem:    Not all sshconfig files are detected as such.
Solution:   Adjust the patterns used for sshconfig detection. (David Auer,
            closes vim/vim#9322)
9acf2d8be9
2022-01-03 19:29:46 +01:00
be255557ce ci: simplify ci_fold function (#16874) 2022-01-03 11:47:11 -05:00
6ed9ddec29 Merge pull request #16895 from dundargoc/ci/fix-shellcheck-warnings
ci: fix shellcheck errors introduced in version 0.8.0
2022-01-03 11:40:20 -05:00
297ff97647 fix(lua): stricter type check when calling API function (#16745)
Solves #13651

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-01-03 08:00:50 -07:00
76435c0cfa docs(usr_05): fix section numbers (#16886)
Other refs to 05.3 don't need to be updated as they refer to the simple mappings
section anyway. Seems they weren't updated when the defaults.vim section was
added as 05.3 instead.
2022-01-03 14:52:01 +01:00
36662c9612 fix: resolve nil arguments to API functions (#16889)
As revealed by #16745, some functions pass a nil value to API functions,
which have been implicitly converted to 0. #16745 breaks this implicit
conversion, so explicitly pass a resolved buffer number to these API
functions.
2022-01-03 06:48:01 -07:00
167c10130c ci: fix shellcheck errors introduced in version 0.8.0
Solved following shellcheck warnings:
SC2030
SC2295
SC2015
2022-01-03 12:47:06 +01:00
2f31e7b88b Merge pull request #16890 from dundargoc/ci/nuke-before-install
ci: remove unnecessary before_install script
2022-01-02 20:13:07 -05:00
e71fbf2eb0 ci: remove unnecessary before_install script 2022-01-02 23:46:46 +01:00
b0993bdc45 Merge pull request #16853 from jamessan/clint-master-only
ci: run lint only on master branch
2022-01-02 14:07:01 -05:00
b823ff9a60 Merge pull request #16883 from dundargoc/ci/remove-watchdog
ci: remove watchdog function run_tests_wd
2022-01-02 12:54:42 -05:00
64f23c27e2 ci: remove watchdog function run_tests_wd
It's only used once for running check-single-includes (which I strongly
suspect it doesn't need anyway), its core logic is incorrect since both the
variables "tempsize" and "prev_temsize" are never defined and parsing ps
is incredibly fragile.
2022-01-02 18:23:28 +01:00
e42c906597 fix(lsp): always use target bufnr in location handler (#16876) 2022-01-02 07:55:16 +01:00
838631e29e fix(diagnostic): improve validation for list arguments (#16855)
Function arguments that expect a list should explicitly use tbl_islist
rather than just checking for a table. This helps catch some simple
errors where a single table item is passed as an argument, which passes
validation (since it's a table), but causes other errors later on.
2022-01-01 12:58:34 -07:00
55c4393e9f feat(lua): add support for multiple optional types in vim.validate (#16864) 2022-01-01 12:35:15 -07:00
f86039de1e ci: remove outdated travis-specific code (#16869) 2022-01-01 12:42:26 -05:00
302beaa36b build(deps): bump tree-sitter to v0.20.2 (#16863) 2022-01-01 17:59:00 +01:00
603db555a4 Merge pull request #16870 from dundargoc/refactor/pvs/V009
refactor(PVS/V009): add special comment at top of file required by PVS
2022-01-01 11:55:27 -05:00
e5f7b61136 Merge pull request #16840 from zeertzjq/ci-clang-13
ci: bump clang version to 13 in asan and tsan
2022-01-01 11:43:38 -05:00
273b5c9282 Merge pull request #16871 from bfredl/luaperf
perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap
2022-01-01 17:21:26 +01:00
9f489f591d perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap 2022-01-01 16:41:16 +01:00
68b23b08a0 refactor(PVS/V009): add special comment at top of file required by PVS
More info: https://pvs-studio.com/en/docs/warnings/v009/
2022-01-01 16:23:22 +01:00
a5eadbaf3c test: make some tests more stable (#16860) 2022-01-01 07:28:52 -07:00
5dbc64dced Merge pull request #16857 from dundargoc/vim-8.2.3956
vim-patch:8.2.3956
2022-01-01 14:15:54 +01:00
b0f21adef0 vim-patch:8.2.3964: some common lisp and scheme files not recognized (#16866)
Problem:    Some common lisp and scheme files not recognized.
Solution:   Recognize *.asd as lisp and *.sld as scheme. (Alex Vear,
            closes vim/vim#9447)
654b729c4c
2022-01-01 14:00:33 +01:00
f6c89e03d7 vim-patch:8.2.3956: duplicate assignment
Problem:    Duplicate assignment.
Solution:   Remove the second assignment. (closes vim/vim#9442)
4b1478093e
2022-01-01 12:44:26 +01:00
36a8f31a37 vim-patch:partial 04fb91668482 (#16852)
Update runtime files
04fb916684

omits doc/usr_41.txt (rewritten to focus on vim9script)
2022-01-01 10:56:55 +01:00
3fccdeb326 chore(fixup): bfredl size_t 2022-01-01 02:55:34 +01:00
6fb9c278d8 chore(fixup): zeer
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-01 02:52:39 +01:00
6a932f68e6 ci: bump clang version to 13 in asan and tsan 2022-01-01 06:24:48 +08:00
b218d02c44 Merge pull request #16594 from shadmansaleh/feat/api/lua_keymaps
feat(api): add support for lua function & description in keymap
2021-12-31 20:10:35 +01:00
b411f436d3 feat(api): add support for lua function & description in keymap
Behavioral changes:

1. Added support for lua function in keymaps in
--------------------------------------------
- nvim_set_keymap
  Can set lua function as keymap rhs like following:
```lua
vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references})
```
  Note: lua function can only be set from lua . If api function being
  called from viml or over rpc this option isn't available.
- nvim_{buf_}get_keymap
  When called from lua, lua function is returned is `callback` key .
  But in other cases callback contains number of the function ref.
- :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly.
- :map commands for displaing rhs .
   For lua keymaps rhs is displayed as <Lua function ref_no>
   Note: lua keymap cannot be set through viml command / functions.
- mapargs()
  When dict is false it returns string in `<Lua function ref_no>`
  format (same format as :map commands).
  When dict is true it returns ref_no number in `callback` key.
- mapcheck()
  returns string in `<Lua function ref_no>` format (same format as :map commands).

2. Added support for keymap description
---------------------------------------
- nvim_{buf_}set_keymap: added `desc` option in opts table .
 ```lua
vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'})
```
- nvim_{buf_}get_keymap: contains `desc` in returned list.
- commands like `:nmap <leader>w` will show description in a new line below rhs.
- `maparg()` return dict contains `desc`.
2022-01-01 00:26:58 +06:00
5c1b8b77c5 fix(runtime): add missing release metadata 2021-12-31 19:04:37 +01:00
35034da779 ci: run lint only on master branch
The list of known lint issues is only updated for the master branch, so
other branches report lots of false positive issues.
2021-12-31 12:09:23 -05:00
fc62fdd42f Merge pull request #16846 from dundargoc/ci/remove-brew-workaround
ci: remove outdated brew workaround that isn't needed anymore
2021-12-31 11:24:48 -05:00
dc3a16abfc Merge pull request #16851 from zeertzjq/vim-8.2.3952
vim-patch:8.2.3952: first line not redrawn when adding lines to an empty buffer
2021-12-31 15:48:02 +01:00
ba7b30080f vim-patch:8.2.3952: first line not redrawn when adding lines to an empty buffer
Problem:    First line not redrawn when adding lines to an empty buffer.
Solution:   Adjust the argument to appended_lines(). (closes vim/vim#9439,
            closes vim/vim#9438)
1fa3de1ce8
2021-12-31 22:20:31 +08:00
db7fe34017 refactor: avoid overflow by explicitly casting operand to a wider type 2021-12-31 14:45:03 +01:00
2a12e8ddfd ci: remove outdated brew workaround that isn't needed anymore 2021-12-31 13:09:01 +01:00
991e872d80 Merge pull request #16728 from dundargoc/refactor/remove-unused-macros
refactor: remove unused macros
2021-12-30 22:20:10 +01:00
7e9aaf1e0f refactor: remove unused macros
Closes #13505
2021-12-30 21:53:18 +01:00
9d37b0998f vim-patch:8.2.3571: some unicode control characters are considered printable
Problem:    Some unicode control characters are considered printable.
Solution:   Make 0x2060 - 0x2069 not printable.
2021-12-30 12:53:38 +09:00
c46f7caad0 Merge pull request #16373 from zeertzjq/terminal-mouse-release-forward
fix(terminal): correctly forward mouse events
2021-12-28 23:44:17 +01:00
7bb593169e Merge pull request #16752 from gpanders/lua-user-commands
feat(api): implement nvim_{add,del}_user_command
2021-12-28 23:18:07 +01:00
f89989dbf3 vim-patch:8.2.3921: the way xdiff is used is inefficient
Problem:    The way xdiff is used is inefficient.
Solution:   Use hunk_func instead of the out_line callback. (Lewis Russell,
            closes vim/vim#9344)
d9da86e94e
2021-12-28 21:12:44 +00:00
eff11b3c3f feat(api): implement nvim_{add,del}_user_command
Add support for adding and removing custom user commands with the Nvim
API.
2021-12-28 14:08:44 -07:00
08616571f4 chore: fix typos (#16506)
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
Co-authored-by: Alef Pereira <ealefpereira@gmail.com>
Co-authored-by: AusCyber <willp@outlook.com.au>
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2021-12-28 18:15:16 +01:00
2ff5189d68 chore: fix compiler warning for multi-line comment (#16812) 2021-12-28 15:55:28 +01:00
645b314576 vim-patch:a4d131d11052 (#16811)
Update runtime files
a4d131d110
2021-12-28 12:24:44 +01:00
6e00d4754c vim-patch:8.2.3914 (#16808)
* vim-patch:8.2.3914: various spelling mistakes in comments

Problem:    Various spelling mistakes in comments.
Solution:   Fix the mistakes. (Dominique Pellé, closes vim/vim#9416)
af4a61a85d

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2021-12-28 11:28:48 +01:00
9804a2870f Merge pull request #16805 from clason/vim-8.2.3905
vim-patch:8.2.{3905,3909}: Dockerfile, Containerfile using prefix name not recognized
2021-12-27 12:52:43 +01:00
d54329e1b6 vim-patch:8.2.3909: Containerfile using prefix name not recognized
Problem:    Containerfile using prefix name not recognized.
Solution:   Recognize Containerfile.*.
bbdd3fb804
2021-12-27 12:52:17 +01:00
5743b0345c vim-patch:8.2.3905: Dockerfile using prefix name not recognized
Problem:    Dockerfile using prefix name not recognized.
Solution:   Recognize Dockerfile.*. (closes vim/vim#9410)
c88ac94a0b
2021-12-27 12:52:17 +01:00
f6df44232c docs: clarify UIEnter and UILeave docs 2021-12-27 17:31:32 +08:00
06ca0667a1 Merge pull request #16799 from bfredl/nohlsplash
fix(api): nvim__set_hl_ns causes extra redraws
2021-12-27 08:56:45 +01:00
505c12cb9c fix(api): nvim__set_hl_ns causes extra redraws 2021-12-26 23:43:37 +01:00
e0956f7452 fix(terminal): correctly forward mouse events 2021-12-27 06:08:16 +08:00
56f3c41f5f fix(uri): change scheme pattern to not include the comma character (#16797) 2021-12-26 16:36:14 -05:00
99526dc9b3 Merge pull request #16596 from dm1try/do_not_leave_terminal_mode_after_mouse_activation
do not leave Terminal mode after entering to it using a mouse
2021-12-26 19:11:51 +01:00
457a8ca7a7 Merge pull request #16630 from kylo252/unused-includes
refactor(build): remove unused includes
2021-12-26 19:03:21 +01:00
a23f4a7921 Merge pull request #16792 from zeertzjq/ins-lastc-k-event
fix: do not save K_EVENT as lastc in Insert mode
2021-12-26 18:29:49 +01:00
2b0be9eff8 Merge pull request #16788 from jamessan/strptime-fix
fix(msgpack#strptime): use calendar.timegm to get seconds since epoch
2021-12-26 09:42:52 -05:00
8c720f6b9d vim-patch:partial fa3b72348d88 (#16780)
Update runtime files
fa3b72348d

omit
doc/eval.txt (needs 8.2.3864)
doc/map.txt (needs 8.2.3619)
menu.vim (needs 8.2.0413)
2021-12-26 11:03:25 +01:00
ab1ceaaaa9 fix: do not save K_EVENT as lastc in Insert mode
I'm also gonna move some other K_EVENT-related tests to vim_spec.lua
2021-12-26 16:14:35 +08:00
9dd8557921 Merge pull request #16774 from zeertzjq/vim-8.2.2468
vim-patch:8.2.2468: not easy to get the full command name from a shortened one
2021-12-25 23:26:59 -05:00
333dd6f80b vim-patch:8.1.1412: test 30 is old style (#16768)
Problem:    Test 30 is old style.
Solution:   Turn it into a new style test. (Yegappan Lakshmanan, closes vim/vim#4440)
72fcf07b06
2021-12-25 23:20:03 -05:00
599a3d6abd fixup! vim-patch:8.2.2468: not easy to get the full command name from a shortened one 2021-12-26 11:25:57 +08:00
1dcdf86849 Merge pull request #16618 from zeertzjq/vim-8.2.3780
vim-patch:8.2.{3780,3784}: ":cd" works differently on MS-Windows
2021-12-25 21:10:44 -05:00
8bc7c6fab9 Merge pull request #16767 from zeertzjq/vim-8.2.3879
vim-patch:8.2.{3879,3882}
2021-12-25 19:36:02 -05:00
397201f2c6 Merge pull request #16705 from zeertzjq/vim-8.2.2508
vim-patch:8.2.{2508,2641,3846}
2021-12-25 19:08:36 -05:00
06985fa595 vim-patch:8.2.3883: crash when switching to other regexp engine fails (#16773)
Problem:    Crash when switching to other regexp engine fails.
Solution:   Check for regprog being NULL.
5937c7505f
2021-12-25 19:02:54 -05:00
96230d6c69 Merge pull request #16789 from janlazo/vim-8.1.1184
vim-patch:8.1.{1184,1379}
2021-12-25 18:30:51 -05:00
19ec20700b vim-patch:8.2.3880: Solution filter files are not recognized (#16779)
Problem:    Solution filter files are not recognized.
Solution:   Add pattern *.slnf and use json. (Doug Kearns)
70a120b72b
2021-12-25 18:26:27 -05:00
f7d840e295 Merge pull request #16724 from VVKot/vim-8.2.3850
vim-patch:8.2.{3850,3855}
2021-12-25 18:24:23 -05:00
57337e6814 vim-patch:8.1.1379: filechanged test hangs
Problem:    Filechanged test hangs.
Solution:   Do not check 'autoread'.
8239c62067
2021-12-25 18:01:17 -05:00
2f1e6ca773 vim-patch:8.1.1184: undo file left behind after running test
Problem:    Undo file left behind after running test.
Solution:   Delete the undo file. (Dominique Pelle, closes vim/vim#4279)
137c14bb4f
2021-12-25 17:59:41 -05:00
6b8a365465 test: port test_filechanged.vim
I can't port patch 8.1.0820.
Attempt failed in https://github.com/neovim/neovim/pull/12948.
test_filechanged.vim is required for later patches.
2021-12-25 17:55:52 -05:00
7622f1afe9 test(old): reenable Test_virtual_replace() (#16674) 2021-12-25 17:26:29 -05:00
e11a44aa22 feat(lua): add vim.spell (#16620) 2021-12-25 12:36:56 -07:00
2ae63161e8 Merge pull request #16725 from VVKot/vim-8.1.0040
vim-patch:8.1.0040: warnings from 64-bit compiler
2021-12-25 19:32:13 +01:00
fb14e2a8d6 fix(msgpack#strptime): use calendar.timegm to get seconds since epoch
datetime.datetime.timestamp does not exist on Windows and
datetime.datetiem.strftime('%s') is not supported, since '%s' is a POSIX
format.  Instead, use the recommended `calendar.timegm(obj.utctimetuple())`.
2021-12-25 12:11:34 -05:00
9e93e5c0c8 Merge pull request #16786 from jamessan/cancel-previous-ci
ci: cancel in-progress CI if a PR is updated
2021-12-25 12:03:01 -05:00
094c3f2b54 ci: cancel in-progress CI if a PR is updated
[skip ci]
2021-12-25 11:11:54 -05:00
4f95224907 vim-patch:8.2.3873: go.mod files are not recognized (#16757)
Problem:    go.mod files are not recognized.
Solution:   Check for the file name. (closes vim/vim#9380)
82b3b4c6cf
2021-12-25 15:17:55 +01:00
3e81c1f9b5 Merge pull request #16762 from zeertzjq/grid-truncate-pum-double-width
Truncate double-width character at the end of popup menu correctly
2021-12-25 13:36:37 +01:00
d2f62b3164 chore(editorconfig): set max_line_length for .h and .in files (#16775) 2021-12-24 22:35:38 -07:00
70a68dc2c5 fix(options): disallow empty 'fdc' and 'scl' (#16765)
Empty string values for these options aren't actually allowed, but
check_opt_strings allows empty string options.

It so happens that 'scl' handles empty string like "auto", but empty 'fdc'
causes glitchiness (win_fdccol_count returns an incorrect value).

Just disallow empty string values for these options completely.
2021-12-24 22:30:34 -07:00
a5d3dd9359 vim-patch:partial:0e6adf8a29d5
Update runtime files
0e6adf8a29
2021-12-25 11:31:54 +08:00
cf609ce655 vim-patch:8.2.3784: the help for options is outdated
Problem:    The help for options is outdated.
Solution:   Include all the recent changes.
7b1463bca3

This is the only applicable hunk.
2021-12-25 11:31:54 +08:00
42cf76fd0a vim-patch:8.2.3780: ":cd" works differently on MS-Windows
Problem:    ":cd" works differently on MS-Windows.
Solution:   Add the 'cdhome' option. (closes vim/vim#9324)
29f3a45915
2021-12-25 11:31:54 +08:00
ccc4d83507 vim-patch:partial:6c391a74fe90
Update runtime files
6c391a74fe
2021-12-25 08:36:32 +08:00
7fa8411d8b vim-patch:partial:6aa57295cfbe
Update runtime files
6aa57295cf
2021-12-25 08:32:58 +08:00
8eff0ca6d5 vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Problem:    Not easy to get the full command name from a shortened one.
Solution:   Add fullcommand(). (Martin Tournoij, closes vim/vim#7777)
038e09ee76
2021-12-25 07:42:06 +08:00
903ec5bd85 vim-patch:8.2.3882: more duplicated code in f_getreginfo()
Problem:    More duplicated code in f_getreginfo().
Solution:   Also use getreg_get_regname(). (closes vim/vim#9398)
d3f00f54bf
2021-12-24 21:20:34 +08:00
125e870772 vim-patch:8.2.3879: getreg() and getregtype() contain dead code
Problem:    getreg() and getregtype() contain dead code.
Solution:   Remove the needless check. (closes vim/vim#9392)  Also refactor to put
            common code in a shared function.
51e64b2789
2021-12-24 21:20:34 +08:00
4f70b31f7a refactor(pum_redraw): rename col -> grid_col
This is initialized to `col_off`, while in Vim this variable `col` that
is used in the same places is initialized to `pum_col`. This can cause
confusion in patch porting, and it caused Vim patch 8.2.1995 to be
ported incorrectly. (I reverted the incorrect part in the last commit
though.) Rename it to `grid_col` to make it clear that it is different
from Vim's `col` variable.
2021-12-24 08:06:27 +08:00
e6d35b9e40 fix(pum_redraw): use grid_puts_len() to truncate the text
Nvim already resizes grid to the required width, so there is no need to
truncate the text in pum_redraw(). What's more, truncation is currently
done incorrectly because Vim patch 8.2.1995 was ported incorrectly.

This nearly reverts the truncation part of Vim patch 8.2.1995, but not
the part that reduces unnecessary calls to pum_redraw(). The original PR
https://github.com/vim/vim/pull/7306 didn't explain much about which
part of it actually reduces redraws.
2021-12-24 08:06:27 +08:00
28dadd5a54 fix(screen): truncate when overwriting right half of a double-width char
Unlike the code above, this truncates the character in the same grid.
This is mainly for the pum scrollbar in the next commit.
2021-12-24 08:06:27 +08:00
bc75544fac fix(screen): truncate double-width character correctly
The `c = '>';` is useless here, because it is not used later.
`u8c` should also need to be set to '>', and `u8cc` needs to be cleared.
2021-12-24 08:06:26 +08:00
0d7a97224f chore: set max_line_length in editorconfig (#16755)
We established a while ago that 100 chars is our line length for both C
and Lua. Not all editorconfig plugins support the "max_line_length"
option, but many do (including all of the ones available for Vim/Neovim
to the best of my knowledge).
2021-12-23 06:46:57 -07:00
bc27d807f3 docs: regenerate (#16742)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-12-23 13:55:38 +01:00
67bf5c237f vim-patch:8.2.3876: 'cindent' does not recognize inline namespace
Problem:    'cindent' does not recognize inline namespace.
Solution:   Skip over "inline" to find "namespace". (closes vim/vim#9383)
f2f0bddf30
2021-12-23 07:41:23 +08:00
de8a2f20e9 vim-patch:8.2.3625: illegal memory access when C-indenting
Problem:    Illegal memory access when C-indenting.
Solution:   Also set the cursor column.
2de9b7c7c8
2021-12-23 07:41:23 +08:00
6714ea35ac vim-patch:8.2.3482: reading beyond end of line ending in quote and backslash
Problem:    Reading beyond end of line ending in quote and backslash.
Solution:   Check for non-NUL after backslash. (closes vim/vim#8964)
78e0fa4cf4
2021-12-23 07:41:23 +08:00
b8d6ab04a2 vim-patch:8.1.1585: :let-heredoc does not trim enough
Problem:    :let-heredoc does not trim enough.
Solution:   Trim indent from the contents based on the indent of the first
            line.  Use let-heredoc in more tests.
e7eb92708e

This is a missing part of Vim patch 8.1.1585 from #11211.
2021-12-23 07:41:23 +08:00
e3f615b205 vim-patch:8.1.1434: test 3 is old style
Problem:    Test 3 is old style.
Solution:   Turn into a new style test. (Yegappan Lakshmanan, closes vim/vim#4460)
1ab74a5af3
2021-12-23 07:41:23 +08:00
7b8fbbdebe Merge pull request #16754 from jamessan/vim-8.2.3874
vim-patch:8.2.3874
2021-12-22 17:34:36 -05:00
29141fc66a vim-patch:8.2.3874: cannot highlight the number column for a sign
Problem:    Cannot highlight the number column for a sign.
Solution:   Add the "numhl" argument. (James McCoy, closes vim/vim#9381)
a80aad7174
2021-12-22 15:03:32 -05:00
0c35fd5fcc refactor: fix comment spacing in option.h (#16749) 2021-12-21 18:13:17 -07:00
33cd1ba00a fix(api): make nil value in nvim_set_option_value clear local value (#16710)
For special options such as 'undolevels' and 'scrolloff', this sets the
local value to the special "unset" value (e.g. -12345 for 'undolevels').
2021-12-21 14:20:34 -07:00
1b04da52b3 feat(lsp): add buf_detach_client (#16250)
This allows the user to detach an active buffer from the language
client. If no clients remain attached to a buffer, the on_lines callback
is used to cancel nvim_buf_attach.
2021-12-21 10:53:34 -08:00
1062ea2cc5 Merge pull request #16736 from dundargoc/ci/remove-unused-typo-fix
ci: remove unused "squash typo" workflow
2021-12-20 17:52:19 -05:00
89a844a9c7 ci: remove unused "squash typo" workflow 2021-12-20 23:47:04 +01:00
9241c684e1 Merge pull request #16734 from zeertzjq/chdir-refactor
refactor: remove some chdir-related unnecessary calls and checks
2021-12-20 14:28:11 -05:00
9625832372 fix(lsp): fix nil-index behavior for UTF-8 in _str_*index_enc methods (#16731)
Previously, the `_str_utfindex_enc` and `_str_byteindex_enc` helper functions would return `nil` when `offset_encoding == "utf-8"` and `index == nil`. Clearly, this doesn't reflect the expected behavior of the functions they're wrapping which would return the length of the line in this case. This should fix behavior with servers that use UTF-8 `offset_encoding` when applying text edits, formatting a range, and doing range code actions (though this isn't tested currently).
2021-12-20 08:54:05 -08:00
63b21ab30d Merge pull request #16727 from dundargoc/docs/remove-good-first-issue-suggestion
docs: stop suggestion "good first issue" as a good first issue
2021-12-20 11:35:07 -05:00
09c412837f refactor: remove some chdir-related unnecessary calls and checks
xmalloc() always retuns a valid pointer.

Calling os_chdir() with the same directory as the current one doesn't do
anything other than wasting time.
2021-12-20 18:58:13 +08:00
26ced79c3b vim-patch:8.1.0040: warnings from 64-bit compiler
Problem:    Warnings from 64-bit compiler.
Solution:   Add type casts. (Mike Williams)
e31e256ba1
2021-12-20 05:30:15 +00:00
482df82e69 docs: stop suggestion "good first issue" as a good first issue
They're simply too difficult and too niche for an actual newcomer to
solve them. Instead, use the "complexity:low" as a substitute.
2021-12-19 22:15:42 +01:00
67bb01ae27 chore(build): add option to disable Lua bytecode compilation (#16722)
Include a build option to explicitly disable Lua bytecode compilation.
This is needed in some situations where the existing checks are not
sufficient (e.g. cross compilation).
2021-12-19 14:00:53 -07:00
d6b939a13f fix(lsp): avoid attaching to unloaded buffers (#16723)
Closes https://github.com/neovim/neovim/issues/16562 https://github.com/neovim/neovim/issues/16249 https://github.com/neovim/neovim/issues/16297

* buf_attach_client can be called on an unloaded buffer
* on_attach will prematurely fail, while the language server client
  tracks this buffer as attached
* The language server client will track this buffer as attached despite
  textDocument/didChange notifications not being sent to the server
* Instead, check if the buffer is loaded and return early, warning via
  the lsp logger that buf_attach_client was called on an invalid buffer
2021-12-19 12:49:56 -08:00
115d4da882 Merge pull request #16657 from lewis6991/unused_warn
chore(): suppress -Wunused-but-set-variable warns
2021-12-19 21:38:07 +01:00
6f72236a00 vim-patch:8.2.3855: illegal memory access when displaying a blob
Problem:    Illegal memory access when displaying a blob.
Solution:   Append a NUL at the end. (Yegappan Lakshmanan, closes vim/vim#9372)
bc404bfb32
2021-12-19 19:50:59 +00:00
bdfca2028b vim-patch:8.2.3850: illegal memory access when displaying a partial
Problem:    Illegal memory access when displaying a partial.
Solution:   Terminate the string with a NUL. (closes vim/vim#9371)
2de5371a75
2021-12-19 19:48:57 +00:00
e0750f3e8a chore: suppress -Wunused-but-set-variable warns 2021-12-19 13:20:17 +00:00
abdf3a8128 fix(build): check that LuaJIT has required modules for compilation (#16714)
Apparently some installations of LuaJIT do not have the "jit.bcsave"
module which is required for pre-compilation. Check that this module
exists before using LuaJIT as luac and if it doesn't, skip compiling
bytecode.
2021-12-18 20:59:02 -07:00
b42e0c40c8 fix: update last cursor on first CursorMoved (#16698)
Closes https://github.com/neovim/neovim/issues/16625 https://github.com/neovim/neovim/issues/12923

The first defined CursorMoved autocommand will immediately
fire if the cursor has previously moved upon definition
of the autocommand.

Plugins add dummy autocommands such as:

```lua
autocmd CursorMoved * execute ''
```

to avoid this behavior.

Instead, when defining a new CursorHold autocommand, force
update the last cursor position.

See https://github.com/vim/vim/issues/2053
2021-12-18 19:18:47 -08:00
0e18cf4b6d vim-patch:8.2.3846: no error when using control character for 'lcs' or 'fcs'
Problem:    No error when using control character for 'lcs' or 'fcs'.
Solution:   Use char2cells() to check the width. (closes vim/vim#9369)
60618c8f1a
2021-12-19 09:55:17 +08:00
c05e647681 vim-patch:8.2.2641: display test fails because of lacking redraw
Problem:    Display test fails because of lacking redraw.
Solution:   Add a redraw command.
2cec027af4
2021-12-19 09:55:17 +08:00
fd70018e21 vim-patch:8.2.2508: cannot change the character displayed in non existing lines
Problem:    Cannot change the character displayed in non existing lines.
Solution:   Add the "eob" item to 'fillchars'. (closes vim/vim#7832, closes vim/vim#3820)
a98f8a2305

Nvim has already implemented this feature, so this just ports the tests
and docs.
2021-12-19 09:55:17 +08:00
95803f0e90 build(deps): bump luajit to commit 1d20f33 (#16712)
fixes a bug with jit.bcsave on Windows (cf. #16631)
2021-12-18 19:09:00 +01:00
8d22049513 Merge pull request #16294 from zeertzjq/test-fewest-iteration
test: require fewest number of main loop iterations possible
2021-12-18 13:08:28 -05:00
2202400f15 Merge pull request #16707 from jamessan/filter-out-tests
test: allow excluding functional/unti tests using TEST_FILTER_OUT
2021-12-18 13:01:38 -05:00
eceb0b305e fix(build): check for empty value of LUAC_PRG (#16711)
If the LUAC_PRG environment variable is defined, but empty, compilation
would still be attempted but would be malformed. This results in garbage
bytes being included.

Fix this by checking that LUAC_PRG is both defined *and* non-empty.
2021-12-18 10:56:10 -07:00
267ec67fab test: allow excluding functional/unit tests using TEST_FILTER_OUT
Although this can already be done using `BUSTED_ARGS`, it complements
our existing shortcut of `TEST_FILTER.`

[skip ci]
2021-12-18 12:55:09 -05:00
2abd17813e fix(build): install luajit modules on windows (#16658) 2021-12-18 10:53:27 -07:00
ff1b0f632a vim-patch:8.2.3843: dep3patch files are not recognized (#16700)
Problem:    Dep3patch files are not recognized.
Solution:   Recognize dep3patch files by their location and content. (James
            McCoy, closes vim/vim#9367)
647ab4cede
2021-12-18 17:22:09 +01:00
34d88edaec feat(tui): add error logging (#16615) 2021-12-18 09:18:30 -07:00
734fba0d88 feat(runtime): new checkhealth filetype (#16660) 2021-12-18 09:14:42 -07:00
36758ba9a7 autocmd: RecordingEnter, RecordingLeave (#16684) 2021-12-18 08:55:43 -07:00
df50fb5859 test(old): change usage of Q to gQ
test(old) fix Test_ex_mode_count_overflow

test(old) change usage of Q to gQ
2021-12-18 08:54:07 -07:00
684c782546 docs(autocmd): update docs to match implementation
docs(reg_recorded): add links to relevant docs

docs(Recording): update docs to match implementation

docs(Q) update references of Q to be gQ

docs(autocmd) add description about state of reg_record{ing,ed} for RecordingLeave

docs(vim_diff) add Recording{Enter,Leave} to features

docs(index) removed duplicate gQ

docs(options) removed line about gQ erroring in visual mode

Update runtime/doc/vim_diff.txt

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

docs(vim_diff) removed double mention of Q
2021-12-18 08:54:07 -07:00
8a4e26c6fe feat(autocmd): add Recording autocmds
feat(eval): add reg_recorded()

This function is used the get the last recorded register.

style(Recording): rename handler to match suggestions

fix(RecordingLeave): send autocommand earlier

This makes the autocommand fire just before setting reg_recorded to
reg_recording, this way we clearly show that we are actually just before
actually quitting the recording mode.
2021-12-18 10:54:26 +01:00
818ae74eaf fix(diagnostic): respect "if_many" source option for virtual text (#16653)
The `prefix_source` function only evaluates the sources from the
diagnostics passed to it; however, because each namespace draws its own
virtual text, its diagnostics will never contain more than a single
source (by definition). This requires changing the semantics of what
"if_many" means from "multiple sources in a single 'batch' of
diagnostics" to "multiple sources of all diagnostics within a buffer".
2021-12-17 19:38:33 -07:00
36c401db24 fix(lsp): correctly align start and end range to codepoints during incremental sync (#16670)
Closes #16624

Fixes two issues with aligning the start position and end position to
codepoints when calculating the start and end range.

When aligning the start position:
* use aligned byte index to calculate character index rather than 
  the unadjusted byte

When aligning the end position:
* do not adjust the end byte if it falls on a UTF-8 codepoint
* align byte to the first byte of the next codepoint rather than the
  last byte of the current codepoint
* compute character character end range on the aligned byte index

This commit also adds additional test coverage, including multibyte operations
that previously failed before this commit.
2021-12-17 18:05:00 -08:00
6a92a53c02 fix(lsp): call config on_exit handler before context is cleared (#16638)
The on_exit handler provided to the client configuration is called after
the client's context is cleared (e.g. which buffers the client was
attached to). Calling the handler sooner allows these handlers to access
the client object and do their own cleanup with the full context.
2021-12-17 12:06:44 -08:00
51306f98b8 Merge pull request #16681 from zeertzjq/vim-8.2.3825
vim-patch:8.2.3825: various comments could be improved
2021-12-17 07:15:42 -05:00
b1757e1c29 vim-patch:0e6adf8a29d5 (#16682)
Update runtime files
0e6adf8a29
2021-12-16 21:46:13 +01:00
80210c189f refactor(diagnostic): remove hack (#16685)
No longer required since #16548.
2021-12-16 12:13:30 -07:00
b515160cef fix(diagnostic): assert that diagnostics have line number and column (#16683)
Line number and column are required and much of the diagnostic API
assumes that these are both present. When one of the two is missing,
cryptic errors pop up in other parts of the diagnostic subsystem.
Instead, assert that diagnostics are well formed when they are entered
into the cache, which provides a clearer error.
2021-12-16 11:20:18 -07:00
4240ce8eb3 perf: pre-compile embedded Lua source into bytecode (#16631)
The Lua modules that make up vim.lua are embedded as raw source files into the
nvim binary. These sources are loaded by the Lua runtime on startuptime. We can
pre-compile these sources into Lua bytecode before embedding them into the
binary, which minimizes the size of the binary and improves startuptime.
2021-12-16 09:27:39 -07:00
f59f81c32e vim-patch:8.2.3825: various comments could be improved
Problem:    Various comments could be improved.
Solution:   Improve the comments.
52797bae17
2021-12-16 23:05:52 +08:00
56fa08b458 Merge pull request #16617 from pekdon/forkpty
fix: add forkpty for SunOS variants
2021-12-16 08:24:29 -05:00
a402b5e2d5 Merge pull request #16134 from zeertzjq/screenpos-border
fix(screenpos, float): add top and left border adjustment
2021-12-16 12:41:43 +01:00
326e74571b Merge pull request #16666 from mjlbach/fix/bad-cast 2021-12-15 13:56:41 -08:00
4218b7079e docs(options): mention how to disable inccommand preview (#16534)
Co-authored-by: Hitarth Thumma
2021-12-15 22:41:24 +01:00
fcbffcd92a chore: improve naming consistency in str_utf_start 2021-12-15 09:07:23 -08:00
1a887293ef fix: do not cast offset to char_u
* str_utf_start/end both cast the offset into the utf string
to a char_u, a pointer + long is well-defined and the cast is
unnecessary. This previously resulted in issues for offsets greater than
256.
2021-12-15 09:07:23 -08:00
4393360796 docs: regenerate (#16468)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-12-15 08:19:54 -07:00
0a1391fdd7 fix(terminal): fix resize crash with pending scrollback (#14891)
refresh_scrollback assumes pending scrollback rows exist only if the
terminal window height decreased (or the screen was full).

However, after accumulating scrollback, it's possible in some cases for
the terminal height to increase before refresh_scrollback is called via
invalidation (especially when the terminal buffer isn't initially
displayed in a window before nvim_open_term), which may crash.

As we'll have enough room for some scrollback rows, just append them to
the top of the buffer until it fills the window, then continue with the
previous logic for any remaining scrollback rows if necessary.
2021-12-15 08:18:06 -07:00
cf65071e2e vim-patch:8.2.3814: .csx files and .sln files are not recognized (#16662)
Problem:    .csx files and .sln files are not recognized.
Solution:   Add filetype patterns. (Doug Kearns)
cfabad9bcf
2021-12-15 16:10:03 +01:00
576408ddde fix(ui): close floating window on BufLeave event (#16557)
When buffer is visible in two splits simultaneously, BufHidden event is
not triggered, causing the floating window to remain on screen after
switching to another buffer.

Remove BufHidden event from close_events defaults, and close the window
if we changed the buffer to something other than the buffer that spawned
the floating window or the floating window buffer itself.
2021-12-15 07:53:09 -07:00
5ba45a7cd6 fix(quickfix): avoid O(N^2) when filling from string typval (#16654)
When filling a quickfix/loclist from a string-typed VimL variable, the
complexity is O(N^2) in the number of lines in the variable.

The problem is caused by using `xstrlcpy(3)` to copy the characters from
the current position up to the next newline into the quickfix/loclist
buffer in a loop.

strlcpy(3) returns the length of `src`, so by necessity it has to
compute `strlen(src)`. This means scanning the full rest of the typval
on every iteration while only copying a small fraction (up to the next
'\n').

This is not a problem whenever the srclen-to-copylen ratio is close to
1, which it usually is. But not in this case. Since we already
calculated exactly how many bytes we want to copy, we should be using
memcpy(3).

This problem is not present in Vim, as it uses `vim_strncpy`, a
`strncpy(3)`-alike, which stops at either `\0` or `n`, whichever comes
first.

The quickfix/loclist window can be filled using a:

  1. File (used by commands like :grep/:make/... to source directly
     from their errorfile)
  2. Buffer (used by :cbuffer and its variants)
  3. Typval
   a. String (used by :cexpr and its variants)
   b. List of strings (used by setqflist(), setloclist(), :cepxr and its
   variants)

This commit optimizes case (3a), especially when the typval is a long
string.

The pathological path is triggered by (e.g.) :grep enhancements as found
in https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3:

    function! Grep(...)
        return system(join([&grepprg] + a:000), ' '))
    endfunction
    :cgetexpr Grep('foo')

It would've been better for Neovim to use `systemlist` here, before this
commit.
2021-12-15 07:47:11 -07:00
ffe3003e02 fix(screenpos, float): add top and left border adjustment 2021-12-15 22:40:10 +08:00
14ffcd190d test: expect the correct screen in TUI paste: big burst of input (#16656) 2021-12-15 07:35:22 -07:00
bdfea9d9ae Merge pull request #16606 from clason/bump-treesitter
build(deps): bump tree-sitter commit
2021-12-14 15:19:21 +01:00
cc4c8e7af6 vim-patch:8.2.3805: i3config files are not recognized (#16645)
Problem:    i3config files are not recognized.
Solution:   Add patterns to match i3config files. (Quentin Hibon,
            closes vim/vim#7969)
8176be1598
2021-12-14 14:01:37 +01:00
f37c5f180a Merge pull request #16602 from zeertzjq/tui-end-streamed-paste 2021-12-13 09:36:02 -05:00
9a0196d245 Merge pull request #16348 from lewis6991/query
feat(treesitter): Support match queries on multiline nodes
2021-12-13 09:39:34 +01:00
5e1320708d refactor(build): remove unused includes 2021-12-12 19:05:50 +01:00
6e6c36ca5b feat(treesitter): multiline match predicates 2021-12-12 12:16:42 +00:00
2c8f4d0912 fix: add forkpty for SunOS variants
forkpty is missing on Solaris < 11 and Illumos, provide fallback implementation
for non Solaris 11 users.
2021-12-12 11:29:56 +00:00
1f3c0593eb feat(ts): add support for multiline nodes in get_node_text (#14999)
Based on https://github.com/neovim/neovim/pull/14445

This extends `vim.treesitter.query.get_node_text` to return the text
that spans a node's range even if start_row ~= end_row.
2021-12-12 12:05:39 +01:00
3aff3d6349 fix(docs): add bufnr and user_data to diagnostic-structure (#16619) 2021-12-11 16:59:16 +01:00
e93b26eb0e Merge pull request #16613 from bfredl/vim-patch-8.2.3777
vim-patch:8.2.3777: spell file write error not checked
2021-12-11 09:25:09 +01:00
a415a7e672 Merge pull request #16614 from zeertzjq/test-remove-misc1
test: remove references to misc1.c
2021-12-11 09:20:50 +01:00
5b153f5d3d test: remove references to misc1.c 2021-12-11 07:10:01 +08:00
3f8703093d Merge pull request #16607 from bfredl/no2misc1
refactor: get rid of misc1.c ("functions that didn't seem to fit elsewhere")
2021-12-10 23:38:00 +01:00
d23a5da890 vim-patch:8.2.3777: spell file write error not checked
Problem:    Spell file write error not checked.
Solution:   Check writing the prefix conditions. (Björn Linse, closes vim/vim#9323)
2021-12-10 23:30:01 +01:00
53c95ccd1b docs(vim_diff.txt): document SearchWrapped (#16612) 2021-12-10 15:04:11 -07:00
2a9aadd09b refactor: replace deprecated lua functions with their new versions (#16603)
Calling vim.lsp.buf.definition() sometimes gives a deprecation warning.
This will likely solve that.

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
2021-12-10 13:20:30 -07:00
63528f4686 runtime: support once on s:GetAutocmdPrefix (#16457)
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2021-12-10 12:28:55 -07:00
8ad6015409 feat: add autocommand event when search wraps around (#8487) 2021-12-10 12:28:25 -07:00
df54d82b7c refactor(misc1): move out high-level input functions to a new file: input.c
Possibly dialog code is messages.c could be moved here as well.
misc1.c is now empty, so delete it.
2021-12-10 18:15:33 +01:00
dc37beed75 refactor(misc1): move shell related functions to os/shell.c 2021-12-10 18:08:04 +01:00
29517d95b7 refactor(misc1): move insertmode related function to edit.c 2021-12-10 17:35:06 +01:00
c88555418a refactor(misc1): move way beep functions elsewhere 2021-12-10 17:11:45 +01:00
6dbd4f3787 refactor(misc1): move msgmore function to messages.c 2021-12-10 17:03:22 +01:00
608f74a0de refactor(misc1): move comment related functions to change.c
These are used in various places, but were grouped with open_line()
which has a lot of comment prefix logic originally.
2021-12-10 16:50:09 +01:00
aad2437fc0 build(deps): bump tree-sitter commit
bump tree-sitter to 25f64e1eb6
to fix query performance regression in 0.20.1
2021-12-10 16:07:03 +01:00
8b316b18d2 refactor(misc1): move user related code to os/users.c 2021-12-10 15:52:38 +01:00
22d7dd2aec fix(lsp): create lsp requests with position offsets considering client encoding (#16382)
Co-authored-by: black-desk <clx814727823@gmail.com>
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2021-12-10 15:17:50 +01:00
40ed2b51cb fix(tui): end streamed paste correctly when key buffer is empty 2021-12-10 18:09:55 +08:00
26eb605152 Merge pull request #16597 from bfredl/nomisc1
refactor: move out some long-hanging fruit from misc1.c
2021-12-10 10:56:17 +01:00
ac2d140a33 Merge pull request #16541 from jamessan/vim-8.2.3664
vim-patch:8.2.3664,8.2.3743,8.2.3747,8.2.3748,8.2.3757
2021-12-09 21:29:15 -05:00
238da85126 Merge pull request #16524 from dundargoc/ci/optimize-brew
ci: remove "brew upgrade" from macos jobs
2021-12-09 21:15:07 -05:00
b20871526e Merge pull request #16414 from zeertzjq/terminal-no-invalid-rows
fix(terminal): return early if there are no invalid rows
2021-12-09 21:13:16 -05:00
0cf546508d Merge pull request #16547 from pekdon/sunos
Portability improvements, first steps at getting neovim on x86_64 SunOS
2021-12-09 21:09:22 -05:00
27648ee218 Merge pull request #16564 from glacambre/improve_test_harness_perf
test(helpers): optimize read_file_list
2021-12-09 21:06:45 -05:00
a59589ca01 refactor(misc1): move preserve_exit() to related functions in main.c 2021-12-09 23:46:37 +01:00
d9c1669a54 refactor(misc1): move out misc functions which obviously belong elsewhere
Also make some function names more descriptive/regular.
2021-12-09 23:17:29 +01:00
c96f7e29dc fix(terminal): ignore left-release mouse action
if it is not proccesed by the terminal program
to prevent leaving Terminal mode after using
a mouse for window switching

closes #9483
closes #8691
2021-12-10 00:53:30 +03:00
8e64b21fed vim-patch:8.2.3769: zig files are not recognized (#16598)
Problem:    Zig files are not recognized.
Solution:   Add *.zig. (Gregory Anders, closes vim/vim#9313)
4c8c634365
2021-12-09 22:03:25 +01:00
51822f0655 refactor(misc1): move out autocmd related functions 2021-12-09 21:10:58 +01:00
2ec0e0a868 refactor(misc1): move line_breakcheck family of functions to os/input.c 2021-12-09 21:00:04 +01:00
2fe60905f6 Merge pull request #16582 from dundargoc/docs/remove-redundant-help-files
docs: remove redundant help files
2021-12-09 09:23:18 -05:00
6063e07a0f fix(diagnostic): set effective buffer number in autocmd (again) (#16589)
Follow up to #16474.
2021-12-08 21:13:47 -07:00
f3fb77c402 vim-patch:8.2.3757: an overlong highlight group name is silently truncated
Problem:    An overlong highlight group name is silently truncated.
Solution:   Give an error if the name is too long. (closes vim/vim#9289)
f7f7aaf8aa
2021-12-08 21:48:00 -05:00
ed35e20640 test(fold): add test for CursorLineFold 2021-12-08 21:47:59 -05:00
931f499d9a test(sign): add test for culhl option 2021-12-08 21:47:59 -05:00
e9051d965e vim-patch:partial 6304be625ce4
Update runtime files.
6304be625c

Remaining changes left out of 03d250eb45
2021-12-08 21:47:59 -05:00
5fda23c307 vim-patch:8.2.3748: giving an error for an empty sign argument breaks a plugin
Problem:    Giving an error for an empty sign argument breaks a plugin.
Solution:   Do not give an error.
e5710a02cb
2021-12-08 21:47:58 -05:00
4453d4c9f1 vim-patch:8.2.3747: cannot remove highlight from an existing sign
Problem:    Cannot remove highlight from an existing sign. (James McCoy)
Solution:   Only reject empty argument for a new sign.
0bac5fc5e1
2021-12-08 21:47:58 -05:00
d0b3efb7db vim-patch:8.2.3743: ":sign" can add a highlight group without a name
Problem:    ":sign" can add a highlight group without a name.
Solution:   Give an error if the group name is missing. (closes vim/vim#9280)
5e18ccc60b
2021-12-08 21:47:58 -05:00
e8f9262125 vim-patch:8.2.3664: cannot adjust sign highlighting for 'cursorline'
Problem:    Cannot adjust sign highlighting for 'cursorline'.
Solution:   Add CursorLineSign and CursorLineFold highlight groups.
            (Gregory Anders, closes vim/vim#9201)
e413ea04b7
2021-12-08 21:47:58 -05:00
2cd815c0af Merge pull request #16418 from zeertzjq/terminal-coladvance
fix(terminal): use coladvance() to calculate buffer cursor position
2021-12-08 21:17:18 -05:00
be84529190 refactor(diagnostic): remove bufnr parameter from open_float (#16579)
The overwhelming majority of use cases for `open_float` are to view
diagnostics from the current buffer in a floating window. Thus, most use
cases will just `0` or `nil` as the first argument, which makes the
argument effectively useless and wasteful.

In the cause of optimizing for the primary use case, make the `bufnr`
parameter an optional parameter in the options table. This still allows
using an alternative buffer for those that wish to do so, but makes the
"primary" use case much easier.

The old signature is preserved for backward compatibility, though it can
likely be fully deprecated at some point.
2021-12-08 18:44:31 -07:00
fb0399aacc docs: remove redundant help files 2021-12-08 19:48:51 +01:00
c096561041 docs(lsp): fix resolve_capabilities docstring (#16577) 2021-12-08 11:01:07 -07:00
e5f691baef docs: update missing help sections from main help page (#16573)
Also replace non-existent help section remote.txt to remote_plugins.txt
2021-12-08 09:56:11 -07:00
db4bc32c4a fix: check for interrupt in nvim_echo, write_msg and nlua_print (#16537)
Fixes `q` in more pager, where `:highlight` can be quit out of with a
single `q` keystroke, while in `:lua print(vim.inspect(vim))` it just
scrolls down a page.
2021-12-08 09:43:58 -07:00
5b117bbc75 ci: install doxygen with conda instead of apt (#16517)
This provides a newer version of Doxygen (1.9.0 or later)
that fixes a bug in the documentation generator.

Closes #16498
2021-12-08 09:28:25 -07:00
51d5f0517f test(helpers): optimize read_file_list
Read_file_list is used to read back data from the nvim log file as the
testsuite executes. However, the nvim log file can get really big
(each full run of the testsuite appends roughly 150MB of data to this
file). Reading each line of this file can thus be extremely slow, and so
are the repeated table.insert/table.removes that are done for each line.

A solution to this issue is tto only read the end of the file.

This results in a sizeable improvement in testsuite run times in some
cases, e.g. on my computer:

Without this commit:
real	20m0.431s
user	17m11.163s
sys	1m59.422s

With this commit:
real	4m25.356s
user	1m41.673s
sys	1m31.253s
2021-12-08 17:25:48 +01:00
c4d70dae80 refactor(diagnostic): add warning to deprecated functions (#16536) 2021-12-08 08:47:19 -07:00
cf32053d60 fix(api): allow nvim_buf_set_extmark to accept end_row key (#16548)
nvim_buf_get_extmark uses "end_row" rather than "end_line" in its
'details' dict, which means callers must modify the key names if they
want to re-use the information. Change the parameter name in
nvim_buf_set_extmark to "end_row" and use "end_line" as an alias
to make this more consistent.
2021-12-08 08:44:48 -07:00
5abd7c2c14 Merge pull request #16421 from seandewar/vim-8.1.0035
vim-patch:8.1.{35,42,64},8.2.{1781,1783,1976,2014,3671}
2021-12-07 21:17:12 -05:00
c83fedf0bd fix(terminal): return early if there are no invalid rows
Prevent on_lines emitting out-of-bounds line indexes.
2021-12-08 08:41:46 +08:00
2784a5d3d2 fix(terminal): use coladvance() to calculate buffer cursor position 2021-12-08 08:11:27 +08:00
be768be6b7 Merge pull request #16556 from zeertzjq/hl-change-update
fix(highlight): always update window highlight if highlight changed
2021-12-07 18:41:17 +01:00
ddf48193e6 Merge pull request #16559 from zeertzjq/filler-end-row
fix(screen): do not draw filler lines post eof if already at last row
2021-12-07 18:36:58 +01:00
a2db756206 refactor(lsp): remove usage of deprecated function (#16539) 2021-12-07 10:25:21 -07:00
f99f3d9052 feat(lsp): use vim.ui.select for selecting lsp client (#16531) 2021-12-07 18:09:43 +01:00
b326bf5f41 fix(screen): do not draw filler lines post eof if already at last row 2021-12-07 23:19:56 +08:00
23dcef9269 fix(highlight): always update window highlight if highlight changed 2021-12-07 20:48:39 +08:00
361f548437 vim-patch:8.2.3671: restarting Insert mode in prompt buffer too often
Problem:    Restarting Insert mode in prompt buffer too often when a callback
            switches windows and comes back. (Sean Dewar)
Solution:   Do not set "restart_edit" when already in Insert mode.
34c20ff85b

As Test_prompt_switch_windows is skipped, implement it in prompt_buffer_spec.

Replace the 50ms term_wait calls with poke_eventloop (test seems to work anyway
without them, so maybe they're not required?)

The new test does include a duplicate screen test that may generate a "screen
test succeeded immediately" warning, but this is done to match the Vim test.
2021-12-07 11:34:28 +00:00
0f792b284f test(prompt_buffer_spec): include changes from v8.1.1984
I already ported v8.1.1984 previously, but hadn't updated prompt_buffer_spec to
match test_prompt_buffer (which we have but due to Vim features such as
term_sendkeys it's mostly skipped).

Required for v8.2.3671.
2021-12-07 11:34:28 +00:00
d6258a9bad vim-patch:8.2.2014: using CTRL-O in a prompt buffer moves cursor to start
Problem:    Using CTRL-O in a prompt buffer moves cursor to start of the line.
Solution:   Do not move the cursor when restarting edit. (closes vim/vim#7330)
ee8b787bcd

Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.
2021-12-07 11:34:27 +00:00
c2d0a1041e vim-patch:8.2.1976: cannot backspace in prompt buffer after using cursor-left
Problem:    Cannot backspace in prompt buffer after using cursor-left. (Maxim
            Kim)
Solution:   Ignore "arrow_used" in a prompt buffer. (closes vim/vim#7281)
6f6244855f

cmdchar_todo wasn't adapted properly for Nvim's state system, which caused it to
be a dead store and such was removed in #11900.

Re-introduce cmdchar_todo properly.
2021-12-07 11:34:27 +00:00
a128b64e73 vim-patch:8.2.1783: try-catch test fails
Problem:    Try-catch test fails.
Solution:   Don't call win_enter(), only call enterering_window().
bdf931c25b

v8.2.1781 caused Test_reload_in_try_catch() from v8.2.0004 to fail in Vim, but
it has not been ported yet.
2021-12-07 11:34:27 +00:00
38cd91de5f vim-patch:8.2.1781: writing to prompt buffer interferes with insert mode
Problem:    Writing to prompt buffer interferes with insert mode.
Solution:   Use win_enter() instead of just setting "curwin". (Ben Jackson,
            closes vim/vim#7035)
4537bcc889

Vim test will be skipped, so add a Lua test.
The problem boils down to the use of aucmd_restbuf in a callback, so just test
that (via nvim_buf_set_lines).
2021-12-07 11:34:27 +00:00
1fffccc5d6 vim-patch:8.1.0064: typing CTRL-W in a prompt buffer shows mode "-- --"
Problem:    Typing CTRL-W in a prompt buffer shows mode "-- --".
Solution:   Set restart_edit to 'A' and check for it.
942b4541a2

Nvim already checked for 'i' in showmode(), so this bug was fixed with <C-W>
(though this patch now changes <C-W> to use 'A').

However, the missing changes I ported for v8.1.0036 use 'A' when a callback
leaves the window in insert mode and edit gets restarted, so this bug was
possible there.

Modify showmode() restart_edit condition to match v8.2.1978:
957cf67d50
2021-12-07 11:34:26 +00:00
b9ab4c1dea vim-patch:8.1.0042: if omni completion opens a window Insert mode is stopped
Problem:    If omni completion opens a window Insert mode is stopped.
            (Hirohito Higashi)
Solution:   Only set stop_insert_mode in a prompt buffer window.
f98b845dd1

popupmenu_spec.lua fails without this.
2021-12-07 11:34:26 +00:00
d6ea0741c9 fix(prompt): add missing changes from v8.1.0036
v8.1.0036 is already marked as ported, but missed out changes that depended on v8.1.0035.
2021-12-07 11:34:26 +00:00
28134f4e78 vim-patch:8.1.0035: not easy to switch between prompt buffer and other windows
Problem:    Not easy to switch between prompt buffer and other windows.
Solution:   Accept CTRL-W commands in Insert mode.  Start and stop Insert mode
            as one would expect.
6d41c78e35

Cherry-pick channel.txt change from:
d2f3a8b878

b_prompt_insert was already ported.
2021-12-07 11:34:24 +00:00
05f9f63f24 fix: don't use cfsetspeed, use i and o variants
cfsetspeed is not available on SunOS, use cfsetispeed and cfsetospeed
instead.
2021-12-07 09:56:25 +01:00
435dd04bdb fix: don't include pty.h on SunOS 2021-12-07 09:56:02 +01:00
afaad8b54e Merge pull request #16194 from seandewar/vim-8.1.1925
vim-patch:7.4.1777,8.1.{1925,1995,2011,2012,2013,2166},8.2.{0532,0871,1168,1241,3576}
2021-12-07 01:14:21 -05:00
bf9e8a9df9 Merge pull request #16546 from zeertzjq/vim-8.1.1797
vim-patch:8.1.{1797,1798}: the vgetorpeek() function is too long
2021-12-07 00:15:04 -05:00
18d81a6724 Merge pull request #16107 from zeertzjq/vim-8.1.1542
vim-patch:8.1.1542,8.2.3549: an OptionSet autocommand does not get enough info
2021-12-06 22:35:05 -05:00
67d3c98dac vim-patch:8.1.2104: the normal.c file is too big (#16389)
Problem:    The normal.c file is too big.
Solution:   Move do_pending_operator() to ops.c. (Yegappan Lakshmanan,
            closes vim/vim#4999).
792cf5e1be
2021-12-06 21:45:30 -05:00
afdd9c19aa refactor: fix indent in decode.c (#16543) 2021-12-06 21:23:52 -05:00
296eb7203c vim-patch:8.1.1798: warning for unused variable in tiny version
Problem:    Warning for unused variable in tiny version. (Tony Mechelynck)
Solution:   Move inside #ifdef.  Reformat code.
eda35f7127
2021-12-07 06:47:33 +08:00
95a5912158 vim-patch:8.1.1797: the vgetorpeek() function is too long
Problem:    The vgetorpeek() function is too long.
Solution:   Split off the part that handles mappings, with fix.
edd680f364
2021-12-07 06:47:33 +08:00
8f1fdbc54a fix: add STRNLEN compatability macro
Older SunOS systems come without strnlen, add STRNLEN macro in line with
the other str* compat macros.
2021-12-06 17:34:26 +01:00
0a3826646f vim-patch:4700398e384f (#16538)
Update runtime files
4700398e38

partial skip:
doc/sign.txt
doc/various.txt
doc/motion.txt
2021-12-06 13:55:38 +01:00
8fdf1b265d fix: define NAME_MAX from _XOPEN_NAME_MAX
On SunOS NAME_MAX is not defined, _XOPEN_NAME_MAX is so fall back to
defining NAME_MAX from _XOPEN_NAME_MAX.
2021-12-06 09:19:24 +01:00
b8ae43dd24 fix: skip libutil on SunOS
libutil is not available on Solaris variants, even on Solaris 11 where
forkpty is available.
2021-12-06 08:18:02 +01:00
523f03b506 lint (#16526) 2021-12-05 23:33:22 -05:00
4306b395de refactor: format diagnostic.lua (#16540) 2021-12-05 19:42:31 -07:00
62f0157853 fix(diagnostic): escape special chars in file names (#16527)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2021-12-05 19:39:00 -07:00
24f9463dd0 refactor: remove unused runtime lua functions (#16535) 2021-12-05 19:11:20 +01:00
9b65a7e064 docs(lsp): re-add client.requests documentation (#16530)
Closes #16528

Added in this PR: d1c470957b (diff-6b5f3071d65558aab177912061ac6a2f5312660655a449276c83697686f28e72R627)

Removed by regeneration in this PR: 2d340a3746 (diff-6b5f3071d65558aab177912061ac6a2f5312660655a449276c83697686f28e72L631)
2021-12-05 14:04:53 +01:00
c5af86b9b9 ci: remove "brew upgrade" from macos jobs
Packages are automatically upgraded on install. This will avoid
upgrading unrelated packages, cutting the macos job time to about a
half.
2021-12-04 23:44:52 +01:00
1e6eeca9d1 Merge pull request #15996 from gpanders/nvim_get_option_value
feat(api): add nvim_{get,set}_option_value
2021-12-04 14:30:27 -07:00
222ef0c00d feat(lsp,diagnostic): open folds in jump-related functions (#16520) 2021-12-04 22:14:38 +01:00
71ac00ccb5 feat(api): add nvim_get_option_value 2021-12-04 14:04:23 -07:00
7b910a1716 chore: bump API version 2021-12-04 14:04:23 -07:00
8dcf45c824 Merge pull request #16518 from dundargoc/ci/use-latest-versions
ci: use tag v2 when using checkout action
2021-12-04 12:50:55 -05:00
8cd1fa8945 ci: use tag v2 when using checkout action
Using v2 automatically fetches the latest minor patch for v2, meaning
free bug fixes without needing to manually update the tag version.
2021-12-04 13:24:46 +01:00
76af219e3e Merge pull request #16411 from dundargoc/refactor/upgrade-uncrustify
refactor: upgrade uncrustify config version to 0.74.0
2021-12-04 12:31:42 +01:00
2ccf6567b7 vim-patch:8.2.3730: "/etc/Muttrc.d/README" gets filetype muttrc (#16515)
Problem:    "/etc/Muttrc.d/README" gets filetype muttrc.
Solution:   Move the Muttrc.d pattern down, add exception for *.rc files.
800b01b0c8
2021-12-04 12:26:37 +01:00
419e0d117d vim-patch:8.2.3729: no support for squirrels (#16513)
Problem:    No support for squirrels. (closes vim/vim#9259)
Solution:   Recognize nuts.
6f42cb6e51
2021-12-03 19:51:30 +01:00
e225397bcb vim-patch:8.2.3726: README file in a config directory gets wrong filetype (#16507)
Problem:    README file in a config directory gets wrong filetype.
Solution:   Match README before patterns that match everything in a directory.
c903695be5
2021-12-03 13:19:17 +01:00
4e352ecc42 Merge pull request #16489 from zeertzjq/patch-1
[skip ci]
2021-12-02 10:33:42 -05:00
cef21e5592 Merge pull request #16408 from jamessan/rm-legacy-test 2021-12-02 10:31:40 -05:00
254c22afc3 fix(diagnostic): clamp diagnostics on negative line numbers (#16496)
Closes https://github.com/neovim/neovim/issues/16492

Despite having logic for setting the maximum diagnostic line
number to at minimum 0, previously the conditional statement only
checked if lnum and end_lnum were greater than the line count.

Fix: also check if lnum and end_lnum are less than 0.
2021-12-02 06:38:44 -08:00
0f82deb2c5 docs(CONTRIBUTING.md): use gh instead of hub; correct uncrustify link 2021-12-02 08:28:05 +08:00
73b35ef10f chore: add default luarc.json for Lua development (#16487)
The Sumneko Lua language server has matured quite a bit and many
Neovim developers use it while working on Neovim. Having a default
configuration for Neovim development is a nice convenience (and
dovetails well with the auto-generated compile_command.json for C
development).

The file is shipped under `contrib` and users can make use of it by
symlinking to `.luarc.json` in the project root.
2021-12-01 12:09:50 -07:00
99f6260f84 fix(diagnostic): set effective buffer number for DiagnosticChanged autocmd (#16474)
This enables use of <abuf> in autocommand handlers for
DiagnosticChanged.
2021-12-01 07:27:17 -07:00
195aec453a chore: remove legacy/059_utf8_spell_checking.vim
The legacy test was converted to a new style Vim test in
8b81218300.
2021-11-30 23:00:48 -05:00
d3585e0ec5 Merge pull request #16478 from jamessan/fragile-server-notifications-test
test(api): mark "notify cancels stale events on channel close" fragile
2021-11-30 22:39:14 -05:00
dd3fe86bbf Merge pull request #16477 from jamessan/backport-action
fix(ci/backport): check for event_name == "pull_request_target"
2021-11-30 22:31:58 -05:00
4342b81e8d test(api): mark "notify cancels stale events on channel close" fragile
This is already skipped in all CI environments, so it should also be
skipped in environments that don't like fragile tests.  Since there's no
convenient way to express these concisely, add the explicit fragile
skip.
2021-11-30 22:27:34 -05:00
50c8cc3020 fix(ci/backport): check for event_name == "pull_request_target"
[skip ci]
2021-11-30 22:20:32 -05:00
828bf128a6 Merge pull request #15840 from vimpostor/vim-8.2.3430
vim-patch:8.2.{3430,3434,3462,3463,3555,3609,3610}: ModeChanged autocmd
2021-11-30 22:13:50 -05:00
2635b77dba Merge pull request #16420 from seandewar/vim-8.1.2136
vim-patch:8.1.2136,8.2.2465
2021-11-30 21:39:22 -05:00
36565c9da2 vim-patch:8.2.2350: using "void" for no reason (#16410)
Problem:    Using "void" for no reason.
Solution:   Use "char *".
033135eb8e
2021-11-30 21:34:33 -05:00
730a9514dc fix(lsp): progress handlers should return vim.NIL on error (#16472) 2021-11-30 21:26:14 -05:00
8ae7dabc10 Merge pull request #16381 from VVKot/vim-8.1.0228
vim-patch:8.1.0228, 8.1.1384, 8.1.1386, 8.1.1393, 8.2.3040
2021-11-30 21:21:36 -05:00
7229afcd60 version bump 2021-11-30 18:38:40 +01:00
e65b724451 NVIM 0.6.0
BREAKING CHANGES

* 32-bit windows builds are no longer provided.

* **build deps**: use libuv 1.42.0 upstream for WIN32 (#15889) (f6c0a37), closes #15889
  * removes Windows 7 support
  * removes support for mouse and alternate buffers in TUI for Windows 8 and 8.1

* **lsp/diagnostic:** highlight groups and signs for LSP diagnostics renamed (e.g. `LspDiagnosticsDefaultWarning` to `DiagnosticWarn`) (a5bbb93)

* **diagnostic:** make DiagnosticChanged a first class autocmd (#16098) (150a592), closes #16098
  * `au User LspDiagnosticsChanged` autocommands are not supported. Use the new first-class DiagnosticChanged event instead.

* **lua**: `register_keystroke_callback` => `on_key` (#15460) (69fe427)
  * **note**: this breaking change was included in 0.5.1

FEATURES

* **:source, nvim_exec:** defer script item creation until s:var access (da9b0ab)
* **:source, nvim_exec:** support script-local variables (d4ed51e), closes #13143 #11507
* **lua:** add trimempty optional parameter to vim.split (5fa26e2)
* **lua:** add vim.str_utf_{start,end} (#16129) (2230b57)
* **lua:** add vim.str_utf_pos function (d752cbc)
* **lsp:** aggregate code actions from all clients (#15121) (c36df20)
* **api:** add lua C bindings for xdiff (#14536) (3d3c0c6)
* **api:** evaluate statusline string #16020 (9086938)
* **api:** named marks set, get, delete #15346 (49fdc62)
* **api:** nvim_get_chan_info: include "argv" for jobs #15537 (0603eba), closes #15440
* **api:** win_viewport also sends line_count #15613 (086631c)
* **api:** support :terminal input callback in lua (9e41e82)
* **ci:** add backport PR action (#14766) (6cc456d)
* **decorations:** allow more than one stacked highlight in a virt_text (1495d36)
* **decorations:** support virtual lines (392c658) (8d7816c)
* **diagnostic:** move vim.lsp.diagnostic to vim.diagostic and support other sources (a5bbb93)
* **diagnostic:** add 'prefix' option to open_float (#16321) (3c74ba4)
* **diagnostic:** add option to include diagnostic source (d43151e)
* **diagnostic:** allow 'prefix' option to return highlight (cc48837)
* **diagnostic:** allow customized diagnostic messages (#15742) (d999c96)
* **diagnostic:** match(), tolist(), fromlist() #15704 (e61ea77)
* **diagnostic:** update jumplist on goto_next/prev (#15942) (b55944e)
* **diagnostic:** use `scope = 'line'` by default for `open_float()` (#16456) (217f9f8), closes #16453
* **diagnostic:** support severity_sort (32c0631)
* **checkhealth:** provide function for command line completion (8b43b07)
* **f_chansend:** support Blob data argument (7e9ea08)
* **job:** add parameter to close stdin (eb7f24b)
* **keywordprg:** use :terminal for external commands #15398 (a90513c), closes #2995 #2761
* **lsp:** add 'focus' option to open_floating_preview (#16465) (fff8827)
* **lsp:** add a registry for client side code action commands (6c03601)
* **lsp:** add client command support to codelens (#15820) (19a77cd)
* **lsp:** add codeAction/resolve support (#15818) (ec4731d)
* **lsp:** add exit_timeout flag (#16070) (80456cf)
* **lsp:** add formatexpr (#16186) (52fa1d2)
* **lsp:** add lsp healthcheck (e268026)
* **lsp:** add per-client commands (#16101) (519d8de)
* **lsp:** add tagfunc (#16103) (f940e7a)
* **lsp:** add warning message for large log size (e6777a7)
* **lsp:** allow configuring zindex for floating windows (#15086) (c487a73)
* **lsp:** allow diagnostics to be disabled for a buffer (#15134) (1aeb945)
* **lsp:** allow root_dir to be nil (#15430) (ff0833c)
* **lsp:** highlight active parameter in signature help (#15018) (af26371)
* **lsp:** improve vim.lsp.util.apply_text_edits (#15561) (41cfba6)
* **lsp:** include original request params in handler ctx (187579f)
* **lsp:** jump to diagnostics by position (#14795) (ea39ff5)
* **lsp:** Make line diagnostics display prettier (e43dbfd)
* **lsp:** make list handlers configurable (#15199) (3e00d4f)
* **lsp:** support textDocument/prepareRename (#15514) (c1f573f)
* **lsp:** use uv_spawn to check if server executable (#16430) (1a60580)
* **lsp:** use vim.ui.select() in codelenses (#16004) (e7ea54a)
* **lsp:** utilize textEdit.range for startbyte in omnifunc (#15957) (e9d6f7c)
* **lua:** add lua-cjson as vendored dependency (8decc9f)
* **lua:** add vim.mpack for msgpack support in lua (eaf661d)
* **lua:** allow passing handles to vim.b/w/t (6c5e7bd)
* **lua:** convert binary string with NULs to Blob (de9df82)
* **lua:** document support of packages with v:lua syntax (9dd371b)
* **lua:** enable stack traces in error output (#16228) (03b805a)
* **lua:** expose lua-cjson as vim.json (30fed27)
* **lua:** make vim.mpack support vim.NIL and vim.empty_dict() (0f59666)
* **match:** allow hl group to be defined after :match command (fca52f5)
* **msgpack:** convert Blobs to BIN strings (af6f454)
* **health:** support lua healthchecks (9249dcd), closes #15632
* **shada:** restore Blob globals properly (ef729fb)
* **terminal:** TermClose: set exit code in v:event.status #15406 (50b30de), closes #4713
* **treesitter:** add next, prev sibling method (1400841)
* **treesitter:** allow to set highlight priority for queries (242608e)
* **ui:** add `opt.kind` to `vim.ui.select` (#15838) (7ae86c1)
* **ui:** add vim.ui.input and use in lsp rename (#15959) (16d4af6)
* **ui:** add vim.ui.select and use in code actions (#15771) (63fde08)
* **vim script:** support calling v:lua as a method (b2994e3)

CHANGES

* **defaults:** auto-create backup dir (4600193)
* **defaults:** inccommand=nosplit #15395 (7215d35)
* **defaults:** set undo points in <C-U> and <C-W> (#15400) (2cb8db3)
* **defaults:** limit syntax cost on CmdwinEnter #15401 (622a36b), closes #6289 #6399
* **defaults:** map CTRL-L to search highlights, update diffs #15385 (0aa8128)
* **defaults:** map Y to y$ #13268 (5a111c1), closes #416 #6289
* **defaults:** remove 'options' from viewoptions #15397 (3954537), closes #6289
* **defaults:** set hidden (f6c72b7)
* **defaults:** set nojoinspaces (d417e67)
* **defaults:** switchbuf=uselast #15394 (4ba7495)
* **runtime:** add packages as `"/pack/*/start/*"` patterns to &rtp (9df7e02)
* **startup:** load builtin plugins with --clean #15893 (c7a63f3), closes #15605
* **terminal:** set cursorlineopt=number in terminal mode (#15493) (c61a386)
* **window:** skip non-focusable floats for :windo (#15378) (e8631cb)

PERFORMANCE IMPROVEMENTS

* **api:** avoid spurious allocations when converting small objects (705e8f1)
* **highlight:** use a hashtable for highlight group names (bb4b4d7)
* **lua:** optimize vim.deep_equal #15236 (4b452d4)
* **lua:** don't use regexes inside lua require'mod' (ea2023f), closes #15147 #15497
* **lsp:** improve json deserialization performance (#15854) (912a6e5)
* **map:** reduce double pointer indirection to single pointer indirection (9e651a9)
* **treesitter:** avoid string lookup of highlight name in hot loop (2460f0a)

FIXES

* **:source, nvim_exec:** handle Vimscript line continuations #14809 (6188926), closes #14807
* **:source:** copy curbuf lines to memory before sourcing #15111 (afdc9e6)
* allow str_utfindex second argument to be an explicit nil  (#16448) (512ec46)
* **api:** fix crash after set_option_value_for() #15390 (8b0e6cc), closes #14097 #13577
* **api:** fix nvim_buf_set_extmark (2338345)
* **autocmd:** fix conditions in block_autocmds, unblock_autocmds #15372 (29712ae), closes #6279
* **buffer_updates:** cleanup test behavior (54b2c68)
* **buffer_updates:** handle :delete of the very last line in buffer (8335e26)
* **buffer_updates:** handle :sort of already sorted buffer (ef687d3)
* **buffer_updates:** make `lockmarks` not affect extmarks and buffer updates. fixes #12861 (7d171b1)
* **bufupdates:** send correct updates for visual paste (1423146)
* **build:** add an env var to re-enable the colors (5087347)
* **build:** call find_package(Threads) before using its variables (f446ab3)
* **build:** export symbols on Windows (aa644b7)
* **build:** fix build failure in MinGW (0503e17)
* **build:** make vendored libmpack and libmpack-lua build properly (2a08aef)
* **channel:** throw error if sending to internal channel w/o terminal (3b89fee)
* **checkhealth:** duplicate checks if module name has "-" #15935 (a36c6e5)
* **checkhealth:** mitigate issues with duplicate healthchecks #15919 (acd5e83), closes #15259
* **ci:** disable broken test on openbsd on all CI due to resource constraints (a3e2636)
* **ci:** re-run GHA for ready_for_review events (#15377) (c6ef956)
* **decorations:** crash when :bdelete (extmark_free_all) after clear_namespace (cd353aa), closes #15212
* **defaults:** "syntax sync maxlines=1" on CmdwinEnter #15552 (5f8518b), closes #15401
* **defaults:** do not map Y in visual-mode #15387 (54726e8), closes #13268
* **diagnostic:** allow floats to be focusable (#16093) (427bac6)
* **diagnostic:** change default severity_sort order (938ed45)
* **diagnostic:** clamp line numbers in setqflist and setloclist (5b0d8f8)
* **diagnostic:** correctly handle folder level diagnostics (f87779a)
* **diagnostic:** deepcopy diagnostics before clamping line numbers (2abc799)
* **diagnostic:** do not focus floats in goto functions (#16433) (b5b025f)
* **diagnostic:** don't clamp line numbers in setqflist (0341c68)
* **diagnostic:** don't return nil when callers expect a table (#15765) (057606e)
* **diagnostic:** don't use nil col if missing from qflist (#16357) (5e46f64)
* **diagnostic:** error on invalid severity value (#15965) (d5dd0aa)
* **diagnostic:** fix navigation with diagnostics placed past end of line (34bb5fa)
* **diagnostic:** fix option resolution in open_float (#16229) (fd34784)
* **diagnostic:** fix wrong data type in setqflist() (3fd1450)
* **diagnostic:** get line count per buffer when clamping (c59f200)
* **diagnostic:** handle an unknown or missing client (#16242) (1fdbd29)
* **diagnostic:** handle diagnostics placed past the end of line (#16095) (a2994c8)
* **diagnostic:** make set() go through cache when calling show() (d93f47d)
* **diagnostic:** only update decorations for loaded buffers (#15715) (924e8e4)
* **diagnostic:** preserve fields from LSP diagnostics via user_data (#15735) (17b7968)
* **diagnostic:** remove useless highlight links (#15683) (c13242c), closes #15585
* disable clipboard when test registers (dd63d93)
* **docgen:** add tagfunc.lua (0746f00)
* **doc:** various fixes #15604 (4eb1ebb)
* **eval:** add the vimscript-1 feature to has() (18b32fc)
* **eval:** checking for a non-empty string is too strict (#15987) (1dbbaf8)
* **eval:** fix has('wsl') #16153 (16d06fa), closes #12642 #16143
* **eval:** fixup for empty modifier in fnamemodify (#16368) (a7ad509), closes #16367
* **extmark:** fix missing virt_lines when using id param of set_extmark (995dbd2)
* **extmarks:** splice extmarks on nv_Undo #15920 (e069361)
* **fileio:** replace characters over INT_MAX with U+FFFD (#16354) (a2e5c2f), closes #11877
* **float:** fix potential heap corruption in win_redr_border (de670f3)
* **float:** redraw if w_border_adj changed (7ff1bc1)
* **heath/provider.vim:** using list as string #16007 (5365f24), closes #15988
* **highlight:** remove syncolor.vim, always include syntax colors (9afa0d2), closes #15176 #12573 #15205
* **inccommand:** ignore trailing commands only for *previewed* command #15638 (1f8c91b), closes #8796 #7494
* include ci/ in exported tarball (d6f03aa), closes #15856
* **input:** never reinterpret unmapped ALT- chrods in Terminal mode (#16222) (5ce35ab)
* **input:** resolve isolated (non-ALT/META) mappings #13109 (c4857b6), closes #13042 #13086 #15869
* **jobwait:** always drain process event queues #15402 (3c081d0), closes #15349
* **lsp_spec:** tests depended on previous session (069d1de)
* **lsp:** accept file URIs without a hostname (a2c2a08)
* **lsp:** add done flag to messages returned in util.get_progress_messages() (#15985) (45fa70a)
* **lsp:** add placeholder cancel function (#16189) (4da0351)
* **lsp:** add textDocument/prepareRename to capability map (#15961) (fcc11d5), closes #15899
* **lsp:** adjust legacy show diagnostic functions to use correct scope (#16106) (dc6c9fe)
* **lsp:** allow diagnostic.clear to accept nil bufnr (#15137) (4ed2d4f)
* **lsp:** avoid duplicates in client attached buffers (#16099) (c5525f2)
* **lsp:** avoid serializing boolean as key (#15810) (96614f8)
* **lsp:** change rpc start notify level to warn (#16467) (04c7b55)
* **lsp:** change signature of buf_highlight_references (#16345) (eb3d591)
* **lsp:** correctly parse LSP snippets #15579 (516775e), closes #15522
* **lsp:** default to UTF-16 in make_position_params (2e3a474)
* **lsp:** do not index nil client in progress (#16262) (8f31b21)
* **lsp:** do not invoke handlers for unsupported methods (#15926) (d288daa)
* **lsp:** don't update active_clients on exit_timeout (#16192) (98f5782)
* **lsp:** enable additional capabilities (#15470) (5d63354)
* **lsp:** ensure buffers are re-attached on rename (#16266) (ee3a58d)
* **lsp:** Ensure users get feedback on references/symbols errors or empty results (256570a)
* **lsp:** expose ContentModified error code to callbacks (#15262) (3f09732)
* **lsp:** fix cursor row after textEdits (#16038) (bd2f61c)
* **lsp:** gracefully handle nil workspaceFolders (#16284) (0ecc58c)
* **lsp:** guard textDocument/codeAction command logic #15769 (433bda4)
* **lsp:** improve symbols_to_items performance (#16197) (5ad15c9)
* **lsp:** Include client name in handler error messages (#15227) (24f2b9e)
* **lsp:** pass bufnr for async formatting (#15084) (c31bc6e)
* **lsp:** persist diagnostic config for clients (bcc9ba5)
* **lsp:** prevent double <text> for cached plaintext markup (910967e)
* **lsp:** restore diagnostics extmarks on buffer changes (#15011) (77b33e4)
* **lsp:** rewrite incremental sync (#16252) (2ecf0a4)
* **lsp:** send buffer contents joined on fileformat-specific linebreak (#16334) (134a638)
* **lsp:** send textDocument/didChange for each buffer (#16431) (3451121)
* **lsp:** support duplicate params in signature help (#15032) (9132b76)
* **lsp:** update lsp-handler signature in call_hierarchy (#15738) (8164adc)
* **lsp:** update workspace/applyEdit handler signature (#15573) (3f526fe)
* **lua:** fix vim.deepcopy for metatables & cycled tables (#16435) (eb876a0)
* **lua:** preserve argument lists which are not lists (6896d22)
* **man.vim:** ensure buftype=nofile after :tag or :stag #15675 (29bc648), closes #15650
* **man.vim:** filetype=man is too eager #15488 (2548a9e), closes #15487 #15487
* **mouse:** fix mouse drag positions on multigrid #12667 (0dcfd0e), closes #15091
* **mouse:** correct dragged position in composed layout (810da1a)
* **multigrid:** mouse events crash neovim (28ac6c0)
* **nvim_open_win:** crash if autocmds delete buffer/window #15549 (0c06da1), closes #15548
* **options:** using :set fillchars should clear local value (7528bce)
* prevent K_EVENT from stopping Select mode CTRL-O #15688 (5f144ef)
* **provider:** compare versions as number, not string (python 3.10 support) #15937 (e16adbf), closes #14586
* **screen:** make display_tick monotonic up to 2^64. fixes #16152 (9e88c9c)
* **screen:** missing search highlights when redrawing from timer #15380 (db695cc), closes #13074 #14064
* **shared:** do not treat empty tables as list in deep extend (#15094) (526fc60)
* **sign:** reset auto sign column with minimum in float win minimal style (c8f57f6)
* **startup:** init.lua: set $MYVIMRC to absolute path #15748 (c76cddf)
* **termdebug:** replace mapset with nvim_set_keymap (#15699) (4d7dcbe)
* **termdebug:** replace term_getline with getbufline #15598 (11289ad)
* **terminal:** close without ! if the job is stopped (55defa1), closes #4683
* **terminal:** free terminal if close_buffer() closes a closed terminal (#16264) (14def4d)
* **test/dumplog:** tostring(rv) before formatting as string (ddaa0cc)
* **tests:** use isolated XDG_DATA_HOME in startup tests (8e663e2)
* **treesitter:** do not map hl_group when no mapping is set (f489d98)
* **treesitter:** run predicates more often in iter_matches (458f2aa)
* **tui:** extend smglr ignores to smglp and smgrp (#16239) (3ba800f)
* **tui:** remove obsolete $NVIM detection #15791 (4414584), closes #12937 #11390
* **tutor:** formatting, layout #15098 (c52ec8f), closes #15088
* **ui:** use nowait for q mapping in floating window (#16427) (c132144)
* **v:lua:** fix emsg when calling v:lua directly (da9005a)
* **vim-patch.sh:** run nvim with -u NONE -n #16179 (97ae0ab)
* **vim.opt:** vimL map string values not trimmed (#14982) (4906156)
* **window:** win_close from other tabpage #15454 (90b2da1), closes #15313
* **windowing:** positioning of relative floats (9065730)
2021-11-30 18:20:42 +01:00
caf41a7ac9 vim-patch:8.2.3703: most people call F# "fsharp" and not "fs" (#16469)
Problem:    Most people call F# "fsharp" and not "fs".
Solution:   Rename filetype "fs" to "fsharp".
53ba95e4f0
2021-11-30 14:51:17 +01:00
04c7b55038 fix(lsp): change rpc start notify level to warn (#16467)
This is less obtrusive, and does not require a confirmation to dismiss
2021-11-30 09:55:42 +01:00
f5fb79733e Merge pull request #16460 from dundargoc/chore/typos
chore: fix typos
2021-11-30 09:28:50 +01:00
d0fbbea62a docs(lsp): do not use nvim_command for Vimscript examples
The examples are relevant and applicable for both Lua and Vimscript
configurations and the `vim.api.nvim_command` prefixes just add noise
that doesn't contribute to the example.
2021-11-30 09:03:41 +01:00
5a24c2c83d docs(lsp): do not use | as argument separator
This translates into a tag in the help doc.
2021-11-30 09:03:41 +01:00
b6e531c1d9 docs(lsp): add annotations for private functions 2021-11-30 09:03:41 +01:00
bc1d13bb36 chore: fix typos
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2021-11-30 09:03:41 +01:00
fff8827908 feat(lsp): add 'focus' option to open_floating_preview (#16465)
When the 'focusable' and 'focus_id' parameters are set,
`open_floating_preview` assumes that it should always move focus to an
existing floating window with the same 'focus_id'. However, there are
cases where we want to make a floating window focusable, but do not want
to focus it upon calling `open_floating_preview`. To distinguish these
cases, add a boolean parameter 'focus' that, when false, prevents
moving focus.
2021-11-29 15:37:55 -07:00
b16b7021ef fix(lsp): do not attempt to index nil client in progress handler (#16463) 2021-11-29 10:03:57 +01:00
6e70b7b31d docs: regenerate (#16461) 2021-11-28 10:47:37 -07:00
217f9f8d1e feat(diagnostic): use scope = 'line' by default for open_float() (#16456)
Closes #16453

Co-authored-by: Cédric Barreteau <cbarrete@users.noreply.github.com>
2021-11-28 09:42:29 -07:00
e4976cbd26 Merge pull request #16452 from clason/vim-8.2.3685
vim-patch:8.2.{3451,3458,3452,3685,3686}: some filetypes are not recognized correctly
2021-11-28 11:57:07 +01:00
1840c82b42 Merge pull request #16451 from clason/vim-8.2.3684
vim-patch:8.2.{3684,3687}: blockwise insert does not handle autoindent properly
2021-11-28 11:47:07 +01:00
2f8ed7b822 vim-patch:8.2.3687: blockwise insert does not handle autoindent properly
Problem:    Blockwise insert does not handle autoindent properly when tab is
            inserted.
Solution:   Adjust text column for indent before computing column.
            (closes vim/vim#9229)
59f4f9505a
2021-11-28 00:47:14 +01:00
07223fae54 Merge pull request #16455 from gpanders/diag-set 2021-11-27 13:11:41 -07:00
6e30461cea test(diagnostic): diagnostics passed to set() should be an array 2021-11-27 12:47:03 -07:00
d93f47dc83 fix(diagnostic): make set() go through cache when calling show()
When `vim.diagnostic.set()` is called, the diagnostics passed to it are
added to the diagnostic cache. `set()` then calls `show()` and passes
those diagnostics along exactly as they were given to `set()`. However,
we sometimes want to do some kind of post-processing on diagnostics when
they come out of the cache, e.g. clamping line numbers. By forwarding
the diagnostics to `show()` verbatim, `set()` skips this post-processing
which can cause other bugs downstream.

Instead of passing the diagnostics directly, make the `show()` call from
within `set()` retrieve diagnostics from the cache. In general, all
diagnostics operations should follow the pattern of "producers put
things in the cache" and "consumers get things out of the cache" and
this change better adheres to that pattern.
2021-11-27 12:32:40 -07:00
03d250eb45 vim-patch:6304be625ce4 (#16450)
Update runtime files.
6304be625c

skip doc/sign.txt (needs 8.2.3664)
2021-11-27 19:39:42 +01:00
ea5699399e vim-patch:8.2.3686: filetype detection often mixes up Forth and F#
Problem:    Filetype detection often mixes up Forth and F#.
Solution:   Add a function to inspect the file contents. (Doug Kearns)
3d14c0f2b9
2021-11-27 19:21:57 +01:00
b51b0aecc9 docs: regenerate (#16390)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-11-27 11:26:49 -05:00
caa6992a10 chore: fix typos (#16361)
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-27 11:10:48 -05:00
b339cb5aca vim-patch:8.2.3451: not all apache files are recognized
Problem:    Not all apache files are recognized.
Solution:   Adjust the filetype pattern. (Zdenek Dohnal, closes vim/vim#8882)
770ddbe159
2021-11-27 16:26:33 +01:00
47ad1a3584 vim-patch:8.2.3458: not all dictdconf files are recognized
Problem:    Not all dictdconf files are recognized.
Solution:   Adjust the pattern. (Doug Kearns)
be01090efa
2021-11-27 16:26:20 +01:00
c1c5676021 vim-patch:8.2.3452: MPD files are not recognized
Problem:    MPD files are not recognized.
Solution:   Recognize MPD files as XML. (Steven Penny, closes vim/vim#8893)
690c524ce6
2021-11-27 16:24:05 +01:00
b156ffedb6 vim-patch:8.2.3685: Visual studio project files are not recognized
Problem:    Visual studio project files are not recognized.
Solution:   Use the xml file type. (Doug Kearns)
c07f11e42f
2021-11-27 16:23:19 +01:00
512ec4632f fix: allow str_utfindex second argument to be an explicit nil (#16448)
* str_utfindex checks number of arguments only, but ignores the case in
  which the second argument is an explicit nil. Previously this required
  dropping the second argument entirely.
* Modify the C binding to explicitly check if the second argument is nil
2021-11-27 10:07:58 -05:00
a8dd1ea011 vim-patch:8.2.3684: blockwise insert does not handle autoindent properly
Problem:    Blockwise insert does not handle autoindent properly.
Solution:   Adjust text column for indent. (closes vim/vim#9229)
e9b0b40b79
2021-11-27 14:55:40 +01:00
6e3e8c51c0 test(oldtest): uncomment method call syntax uses
We should now be equal with Vim in regards to method call support of already ported built-ins.

Enable all relevant commented-out uses of the syntax in tests that I could grep.
2021-11-26 18:53:12 +00:00
752ca2cb9f fix(eval/method): add missing method support for existing built-ins
These functions were ported with the vim-patch token, but didn't actually port
the method call support that was in their patches (method call syntax wasn't
ported yet).

Add the missing method call support and latest docs for:
 - assert_nobeep:
   5b8cabfef7
 - buffer_name, buffer_number: (obsolete)
   a8eee21e75
 - charidx:
   17793ef23a
 - flatten:
   077a1e670a
 - prompt_getprompt:
   077cc7aa0e
 - searchcount:
   e8f5ec0d30
 - strptime:
   10455d43fe
 - win_gettype:
   00f3b4e007
 - win_splitmove:
   d20dcb3d01

Also fix assert_beeps, assert_nobeep and getenv to accept exactly one argument.
Previously, they could erroneously accept one or more.
2021-11-26 18:53:12 +00:00
7e1a2301ff docs(eval): cherry-pick runtime update 2e693a88b2
2e693a88b2

Mainly to keep the method call docs up-to-date.
Much of this RT update has already been ported.
2021-11-26 18:53:12 +00:00
a0c7fff284 vim-patch:8.2.1241: cannot use getbufinfo() as a method
Problem:    Cannot use getbufinfo() as a method.
Solution:   Support using getbufinfo() as a method. (closes vim/vim#6458)
6434fc574d
2021-11-26 18:53:12 +00:00
2c185a18cd vim-patch:8.2.1168: wrong method argument for appendbufline()
Problem:    Wrong method argument for appendbufline().
Solution:   Use FEARG_3.
92053ce59e

Cherry-pick base change for append (and appendbufline) from v8.2.1167.
These changes have no visible impact, but helps us sync with Vim.

Like Vim, BASE_LAST is now unused after this commit.
Keep it anyway in case it sees use in the future.
Comment-out LAST definition in eval.lua to appease linter.
2021-11-26 18:53:11 +00:00
6bc9af43ce vim-patch:8.2.0871: cannot use getmarklist() as a method
Problem:    Cannot use getmarklist() as a method.
Solution:   Make getmarklist() work as a method.  Add one to the column
            number to match getpos(). (Yegappan Lakshmanan, closes vim/vim#6176)
f17e7ea67a

The rest of this patch was ported in:
a1ed941a78
2021-11-26 18:53:11 +00:00
60f0e18588 vim-patch:8.2.0532: cannot use simplify() as a method
Problem:    Cannot use simplify() as a method.
Solution:   Add FEARG_1. (closes vim/vim#5996)
7035fd9d90
2021-11-26 18:53:11 +00:00
f37f08314d vim-patch:8.1.2166: rubyeval() not tested as a method
Problem:    Rubyeval() not tested as a method.
Solution:   Change a test case.
4a4981b7cd
2021-11-26 18:53:11 +00:00
2ad92e9476 vim-patch:8.1.2013: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
f92e58cadb

Cherry-pick s:normalize_fname for tolower test from v8.1.0894 and v8.1.1417 (even though it is
unused for now).

Fix header for win_id2tabwin in eval.txt.
2021-11-26 18:53:11 +00:00
38a831e54a vim-patch:7.4.1777
Problem:    Newly added features can escape the sandbox.
Solution:   Add checks for restricted and secure. (Yasuhiro Matsumoto)
3849992b16

timer_start is missing check_secure.

The timer callback can, for example, call a function defined from outside the sandbox that does
stuff that would be disallowed from inside the sandbox. This is usually not allowed.

Cherry-pick eval.txt change from:
68e6560b84

Required for v8.1.2013.
2021-11-26 18:53:10 +00:00
39776d1a65 vim-patch:8.1.2011: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.  Make the window
            command test faster.
ce90e36f59

test_* functions in the patch are N/A as they modify internal state.

Include test changes for test_ignore_error and test_feedinput (though they aren't run).
Other changed tests were excluded from previous patches, except test_termcodes.vim, which hasn't
been ported yet.
2021-11-26 18:53:10 +00:00
0f4510cb1a feat(eval/method): partially port v8.1.2004
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
f6ed61e148

+sound is needed for sound_* functions.

Make swapinfo and swapname take exactly one argument.
Previously, they could erroneously take one or more.
2021-11-26 18:53:10 +00:00
2ee0bc09d9 feat(eval/method): partially port v8.1.1996
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
aad222c9c9

Partial port as this does not include eval.txt change for listener_add.

Cherry-pick eval.txt changes for:
- bufadd from v8.1.1626:
  5ca1ac373a
- setloclist and setqflist headers from:
  b0d45e7f53

Correct eval.txt typo for settabwinvar method call (matches latest Vim).
2021-11-26 18:52:58 +00:00
aad25ae4fc vim-patch:8.1.1995: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make sign functions usable as a method.
93476fd634

Make sign_placelist and sign_unplacelist accept exactly one argument.
Before, they erroneously accepted one or more arguments.
2021-11-26 18:33:59 +00:00
4efcb72bb7 feat(eval/method): partially port v8.1.1993
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
196b466443

server2client requires +clientserver, which hasn't been ported yet.
The eval.txt docs and test_clientserver.vim tests for server2client already exist, so include those
changes.

test_bufline.vim: Test for setbufline requires v8.1.1189 (which was reverted in #10848).
2021-11-26 18:33:59 +00:00
fa9076f276 vim-patch:8.1.1925: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
4c313b13fb

The rest of this patch was ported in
3137c7d635

N/A patches for version.c:

vim-patch:8.1.2012: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make terminal functions usable as a method.  Fix term_getattr().
7ee80f7661

vim-patch:8.2.3576: some functions are not documented for use with a method

Problem:    Some functions are not documented for use with a method.
Solution:   Add examples.  Fix that sign_unplacelist() only takes one
            argument. (Sean Dewar, closes vim/vim#9081)
a63780b977

Addressed in the port of v8.1.1995.
2021-11-26 18:33:58 +00:00
afbf89dc01 vim-patch:8.2.3679: objc file detected as Octave (#16446)
Problem:    objc file detected as Octave. (Antony Lee)
Solution:   Detect objc by preprocessor lines. (Doug Kearns, closes vim/vim#9223,
            closes vim/vim#9220)
7329cfab36
2021-11-26 17:34:45 +01:00
7ded880227 vim-patch:8.2.3676: unused runtime file (#16441)
Problem:    Unused runtime file.
Solution:   Remove rgb.txt.
309ce25189
2021-11-26 17:16:11 +01:00
a31e7523f4 vim-patch:8.2.3677: after a put the '] mark is on the last byte (#16442)
Problem:    After a put the '] mark is on the last byte of a multi-byte
            character.
Solution:   Move it to the first byte. (closes vim/vim#9047)
4d07253a48
2021-11-26 12:16:04 +01:00
eb876a0a6f fix(lua): fix vim.deepcopy for metatables & cycled tables (#16435)
vim.deepcopy previously didn't retain metatables in copies
and caused stackoverflow on recursive tables/cycled tables this
fixes these issues
2021-11-26 11:06:43 +01:00
3451121a4e fix(lsp): send textDocument/didChange for each buffer (#16431)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2021-11-26 10:54:58 +01:00
102e7e7929 fix(lsp): require bufnr for apply_text_edits (#16444) 2021-11-26 10:36:37 +01:00
72d62aa6aa chore(docs): clarify vim.notify log_level parameter (#16436) 2021-11-25 20:06:42 +01:00
150a5922aa feat(diagnostic)!: make DiagnosticChanged a first class autocmd (#16098)
This allows users to hook into diagnostic events with finer granularity
(e.g. per-buffer or file).

BREAKING CHANGE: DiagnosticsChanged and LspDiagnosticsChanged user
autocommands are removed.
2021-11-25 11:55:11 -07:00
1a60580925 feat(lsp): use uv_spawn to check if server executable (#16430)
Previously, the built-in language server client checked if the first
argument of cmd was executable via vim.fn.executable. This ignores PATH
injected via cmd_env. Instead, we now start the client via uv.spawn, and
handle the failure mode, reporting the error back to the user.

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2021-11-25 07:54:45 -05:00
6ea5e80393 Merge pull request #16434 from gpanders/diagnostic-clampage
fix(diagnostic): line clamping fixes
2021-11-25 07:28:46 -05:00
b5b025f6a3 fix(diagnostic): do not focus floats in goto functions (#16433)
Floating windows opened by `goto_next` and `goto_prev` should not be
focused when repeating the `goto_` function. The float can still be
focused by calling `open_float` with `scope = "cursor"`.
2021-11-24 21:45:42 -07:00
0341c687a3 fix(diagnostic): don't clamp line numbers in setqflist
Reverts 5b0d8f85fd.

Diagnostic producers can send diagnostics for buffers that are not
loaded, for which we cannot retrieve the line count to clamp line
numbers. This means that some diagnostics in the quickfix list could be
line-clamped and others not. The quickfix list can already handle line
numbers past the end of the buffer (i.e. it *already* clamps line
numbers) so just use the "raw" diagnostic positions sent from the
producer.
2021-11-24 20:03:48 -07:00
25ab7c6c0a test(diagnostic): uncomment equality check 2021-11-24 20:03:38 -07:00
c59f2008e0 fix(diagnostic): get line count per buffer when clamping
Fixes a bug when `get_diagnostics` is called with a nil `bufnr`.
Diagnostics should be clamped for the buffer they reside in, not the
current buffer.
2021-11-24 20:03:36 -07:00
f2722884a8 perf(lsp)!: use faster line retrieval for utf-16 to byte idx conversion (#16360) 2021-11-24 20:49:34 -05:00
c132144d24 fix(ui): use nowait for q mapping in floating window (#16427) 2021-11-24 15:57:33 -07:00
dac52e6d04 vim-patch:8.2.2465: using freed memory in :psearch
Problem:    Using freed memory in :psearch. (houyunsong)
Solution:   Check the current window is still valid.  Fix flaky test.
92bb83e41c

Test_cursorhold_insert timer's 100ms delay was already LoadAdjusted, but change
to 200ms (still LoadAdjust) to match Vim anyway.
2021-11-24 05:34:20 +00:00
a2e5c2f7c8 fix(fileio): replace characters over INT_MAX with U+FFFD (#16354)
fixes #11877
credit: @zubairabid https://github.com/neovim/neovim/pull/12010
2021-11-23 21:07:47 -07:00
c366c944c2 vim-patch:8.1.2136: using freed memory with autocmd from fuzzer
Problem:    using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
            Dominique Pelle)
Solution:   Avoid using "wp" after autocommands. (closes vim/vim#5041)
ec66c41d84

Nvim doesn't use Vim's terminal implementation.
Despite this, Nvim has its own *exclusive* way of crashing here.

Requires 'winwidth' > winwidth() and 'nowinfixwidth' to crash; adjust
the test ('nowfw' is the default, but ensure its disabled anyway).
2021-11-24 03:55:02 +00:00
dd8a4e2c22 Merge pull request #16402 from clason/treesitter-bump
build(deps): bump tree-sitter,treesitter-c to v0.20.1 and adapt tests
2021-11-23 20:13:51 +01:00
5676edb86d fix(tests): adapt parser_spec test to tree-sitter bump
Change query to include anonymous nodes (`(_)` -> `[_]`) and
use new syntax (`{vim,lua}.match?`->`#{vim,lua}.match?`)
2021-11-23 18:38:22 +01:00
849f104c27 refactor: upgrade uncrustify config version to 0.74.0
Disable formatting for assert.h since there's a bug that results in a
segmentation fault in uncrustify.
2021-11-23 10:28:49 +01:00
fd6df7481a fix(diagnostic): resolve buffer number in get() (#16407) 2021-11-22 09:22:08 -07:00
e02d4732f2 fix(diagnostics): don't allow 0 bufnr for metatable index (#16405)
04bfd20bb introduced a subtle bug where using 0 as the buffer number in
the diagnostic cache resets the cache for the current buffer. This
happens because we were not checking to see if the _resolved_ buffer
number already existed in the cache; rather, when the __index metamethod
was called we assumed the index did not exist so we set its value to an
empty table. The fix for this is to check `rawget()` for the resolved
buffer number to see if the index already exists.

However, the reason this bug was introduced in the first place was
because we are simply being too clever by allowing a 0 buffer number as
the index which is automatically resolved to a real buffer number.
In the interest of minimizing metatable magic, remove this "feature" by
requiring the buffer number index to always be a valid buffer. This
ensures that the __index metamethod is only ever called for non-existing
buffers (which is what we wanted originally) as well as reduces some of
the cognitive overhead for understanding how the diagnostic cache works.
The tradeoff is that all public API functions must now resolve 0 buffer
numbers to the current buffer number.
2021-11-22 08:47:30 -07:00
33ce02ee4d fix(lsp): avoid indexing vim.NIL for null workspaceFolders (#16404)
* internally represent no workspaceFolders as nil instead of vim.NIL
* rename workspaceFolders -> workspace_folders for consistency
2021-11-22 09:52:24 -05:00
cfa5d06801 docs(man): omit misleading mention of environment for -u NORC (#16379)
The phrase referred specifically to `$VIMINIT` and `$EXRC`, which
are parsed (and available with, e.g., `echo $VIMINIT` if set) but
of course not loaded since _any_ initialization is skipped. Hence
this is redundant and can be misleading.
2021-11-22 12:00:04 +01:00
faae47eddb build(deps): also bump treesitter-c to v0.20.1 2021-11-22 11:05:24 +01:00
e6c46bac3f vim-patch:88a4205f1cfb (#16399)
Update runtime files
88a4205f1c
2021-11-22 10:53:57 +01:00
e1cea4b38d build(deps): bump tree-sitter to 0.20.1 2021-11-22 10:26:17 +01:00
419ebd8ec6 vim-patch:8.2.3549: mistakes in test comments
Problem:    Mistakes in test comments.
Solution:   Fix the comments. (closes vim/vim#9029)
b811de5d49
2021-11-22 15:50:14 +08:00
d40db0edbd vim-patch:8.1.1542: an OptionSet autocommand does not get enough info
Problem:    An OptionSet autocommand does not get enough info.
Solution:   Add v:option_command, v:option_oldlocal and v:option_oldglobal.
            (Latrice Wilgus, closes vim/vim#4118)
d7c9687947
2021-11-22 15:50:14 +08:00
ee99f34438 vim-patch:8.1.1393: unnecessary type casts
Problem:    Unnecessary type casts.
Solution:   Remove type casts from alloc() and lalloc() calls. (Mike Williams)
51e14387f1
2021-11-22 05:44:40 +00:00
6ff3475b42 vim-patch:8.1.1386: unessesary type casts for lalloc()
Problem:    Unessesary type casts for lalloc().
Solution:   Remove type casts.  Change lalloc(size, TRUE) to alloc(size).
18a4ba29ae
2021-11-22 05:44:40 +00:00
c86fb824e0 vim-patch:8.1.1384: using "int" for alloc() often results in compiler warnings
Problem:    Using "int" for alloc() often results in compiler warnings.
Solution:   Use "size_t" and remove type casts.  Remove alloc_check(), Vim
            only works with 32 bit ints anyway.
964b3746b9

N/A commits:

vim-patch:8.1.0228: dropping files is ignored while Vim is busy

Problem:    Dropping files is ignored while Vim is busy.
Solution:   Postpone the effect of dropping files until it's safe.
92d147be95

vim-patch:8.2.3040: GUI: dropping files not tested

Problem:    GUI: dropping files not tested.
Solution:   Add test_gui_drop_files() and tests. (Yegappan Lakshmanan,
            closes vim/vim#8434)
18d46587b9
2021-11-22 05:43:00 +00:00
64abd7be79 Merge pull request #16341 from zeertzjq/vim-8.2.2518
vim-patch:8.2.{2518,2520,3572,3588}: 'listchars' (and 'fillchars'?) fixes
2021-11-21 22:21:32 -05:00
e05db65d2a vim-patch:8.2.3627: difficult to know where the text starts in a window (#16377)
vim-patch:8.2.3627: difficult to know where the text starts in a window

Problem:    difficult to know where the text starts in a window. (Sergey
            Vlasov)
Solution:   Add the "textoff" entry in the result of getwininfo().
            (closes vim/vim#9163)
cdf5fdb294

Fix indent in Test_getbufwintabinfo().
2021-11-21 21:10:03 -05:00
f45b2f313e Merge pull request #16386 from VVKot/vim-8.2.2922
vim-patch:8.2.2922,8.2.3639
2021-11-21 20:41:56 -05:00
04bfd20bb8 fix(diagnostic): remove invalid buffers from cache (#16397)
Errors were being caused by invalid buffers being kept around in
diagnostic_cache, so add a metatable to diagnostic_cache which attaches
to new buffers in the cache, removing them after they are invalidated.

Closes #16391.

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2021-11-21 18:40:06 -07:00
0d967f0298 Merge pull request #16362 from zeertzjq/vim-8.2.3617
vim-patch:8.2.{3468,3617,3618,3622}: some other CWD related patches
2021-11-21 17:47:09 -05:00
d99d4af7b1 Merge pull request #16370 from gpanders/diagnostic-column-clamp 2021-11-21 12:06:44 -07:00
85707a3395 vim-patch:8.2.3255: ci" finds following string but ci< and others don't (#16324)
Problem:    ci" finds following string but ci< and others don't.
Solution:   When not inside an object find the start. (Connor Lane Smit,
            closes vim/vim#8670)
b9115da4be
2021-11-21 14:00:50 -05:00
9d0726f6d8 vim-patch:8.1.1606: on a narrow screen ":hi" output is confusing (#16388)
Problem:    On a narrow screen ":hi" output is confusing.
Solution:   Insert a space between highlight group name and "xxx". (Masato
            Nishihaga, closes vim/vim#4599)
548be7f126
2021-11-21 13:10:24 -05:00
9d868317f9 vim-patch:8.2.3638: getcompletion() always passes zero as position (#16387)
Problem:    getcompletion() always passes zero as position to custom
            completion function.
Solution:   Pass the pattern length. (closes vim/vim#9173)
4785fe02bb

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2021-11-21 13:00:51 -05:00
134a6385e2 fix(lsp): send buffer contents joined on fileformat-specific linebreak (#16334) 2021-11-21 12:03:45 -05:00
a2749482d9 chore(lsp): clean up initialization process (#16369)
* send vim.NIL instead of not sending workspaceFolders
* read fallback rootPath and rootUri from workspaceFolders
* update documentation
2021-11-21 11:39:30 -05:00
ad71ecb49b vim-patch:8.2.3639: line commented out accidentally
Problem:    Line commented out accidentally.
Solution:   Uncomment. (Volodymyr Kot, closes vim/vim#9172)
7f0c4b418e
2021-11-21 13:53:50 +00:00
89270346f9 docs(lua): further improve Lua require() docs
Change docs to reflect recent changes to require() search order and add
info on `.` in module names and search order for shared library modules.
2021-11-22 00:43:18 +13:00
0d32e5ba30 docs(lua): fix, clarify Lua require() docs
Corrects lua.txt help file to say that require() searches runtimepath
and loads the first module found, not the last.

Also adds additional clarification on require() and module search order.

Closes #15480
2021-11-21 21:30:13 +13:00
ddc401a91c vim-patch:8.2.2922: computing array length is done in various ways
Problem:    Computing array length is done in various ways.
Solution:   Use ARRAY_LENGTH everywhere. (Ken Takata, closes vim/vim#8305)
eeec254878
2021-11-21 08:20:38 +00:00
120a881630 Merge pull request #14540 from Shougo/fix_vim8.1.1378
[RFC] Improve tests
2021-11-20 22:46:34 -05:00
2bd8f2fb5e vim-patch:8.1.0753: printf format not checked for semsg() (#16378)
Problem:    printf format not checked for semsg().
Solution:   Add GNUC attribute and fix reported problems. (Dominique Pelle,
            closes vim/vim#3805)
b5443cc46d

(Most of the changes do not apply because Neovim already uses PRId64 and other spelling mistakes were already fixed.)
2021-11-20 13:26:16 +01:00
725cbe7d41 refactor: saner options for uncrustify (#16204)
* sp_enum_after_assign = force
* sp_brace_typedef = force
* nl_do_brace = remove
* sp_do_brace_open = force
* sp_brace_close_while = force
* sp_before_semi = remove
* sp_before_semi_for = remove
* sp_before_semi_for_empty = remove
* sp_between_semi_for_empty = remove
* sp_after_semi_for_empty = remove
* sp_before_square = remove
* sp_before_squares = remove
* sp_inside_square = remove
* sp_inside_fparens = remove
* sp_inside_fparen = remove
* sp_inside_tparen = remove
* sp_after_tparen_close = remove
* sp_return_paren = force
* pos_bool = lead
* sp_pp_concat = remove
* sp_pp_stringify = remove
* fixup: disable formatting for the INIT section
2021-11-19 14:21:53 -05:00
5b0d8f85fd fix(diagnostic): clamp line numbers in setqflist and setloclist 2021-11-19 11:49:44 -07:00
34bb5fa5a9 fix(diagnostic): fix navigation with diagnostics placed past end of line 2021-11-19 11:37:45 -07:00
2abc799ffd fix(diagnostic): deepcopy diagnostics before clamping line numbers
The current 'clamp_line_numbers' implementation modifies diagnostics in
place, which can have adverse downstream side effects. Before clamping
line numbers, make a copy of the diagnostic. This commit also merges the
'clamp_line_numbers' method into a new 'get_diagnostics' local function
which also implements the more general "get" method. The public
'vim.diagnostic.get()' API now just uses this function (without
clamping). This has the added benefit that other internal API functions
that need to use get() no longer have to go through vim.validate.

Finally, reorganize the source code a bit by grouping all of the data
structures together near the top of the file.
2021-11-19 11:37:45 -07:00
9ec4417afc Merge pull request #16066 from neovim/marvim/ci-version-update
version.c: update [skip ci]
2021-11-19 11:54:24 -05:00
7942fb7074 Merge pull request #16091 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-11-19 11:53:53 -05:00
a7ad509902 fix(eval): fixup for empty modifier in fnamemodify (#16368)
* fix(eval): fixup for empty modifier in fnamemodify

1dbbaf89bf
erroneously removed a check for empty modifier and a PVS fix. 
Restore that check and fix.

Fixes #16367

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2021-11-19 16:13:49 +01:00
349b9ce9df vim-patch:8.2.3622: "verbose pwd" shows confusing info
Problem:    "verbose pwd" shows confusing info when :lcd does not change
            directory.
Solution:   Clear last_chdir_reason also when the directory does not change.
            (closes vim/vim#9160)
64be6aa3a5

This only ports the tests, as this is already Nvim's behavior.
2021-11-19 20:07:04 +08:00
3d504f27a0 vim-patch:8.2.3618: getcwd() is unclear about how 'autochdir' is used
Problem:    getcwd() is unclear about how 'autochdir' is used.
Solution:   Update the help for getcwd().  Without any arguments always return
            the actual current directory. (closes vim/vim#9142)
851c7a699a
2021-11-19 20:07:04 +08:00
54e9cce612 revert: partially revert #9894
Vim has a solution to #9892 with fewer side-effects in patch 8.2.3618
2021-11-19 20:07:04 +08:00
4785cad8ee vim-patch:8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Problem:    ":verbose pwd" does not mention 'autochdir' was applied.
Solution:   Remember the last chdir was done by 'autochdir'.  (issue vim/vim#9142)
0526815c15
2021-11-19 20:07:04 +08:00
0f58ba10e2 vim-patch:8.2.3468: problem with :cd when editing file in non-existent directory
Problem:    Problem with :cd when editing file in non-existent directory. (Yee
            Cheng Chin)
Solution:   Prepend the current directory to get the full path. (closes vim/vim#8903)
c6376c7984
2021-11-19 20:07:04 +08:00
2c431943d6 fix: remove unneeded gzip check 2021-11-19 13:45:41 +09:00
e9819ca709 fix: error 2021-11-19 13:45:41 +09:00
c11cf6b415 test: save clipboard 2021-11-19 13:45:41 +09:00
9bcbb7f9d2 fix: shell problem 2021-11-19 13:45:41 +09:00
cf4af351a6 fix: fix GZIP error 2021-11-19 13:45:41 +09:00
18d7ec36f3 fix: remove unnecessary changes 2021-11-19 13:45:41 +09:00
a11cec08e5 fix: for reviews 2021-11-19 13:45:41 +09:00
dd63d93931 fix: disable clipboard when test registers 2021-11-19 13:45:40 +09:00
77c2edcacb fix: remove previous executed directories to execute tests locally 2021-11-19 13:45:40 +09:00
4cb8a399c7 fix: add cd for local execution 2021-11-19 13:45:40 +09:00
133d79a358 vim-patch:8.2.3616: arglist test does not clear the argument list consistently
Problem:    Arglist test does not clear the argument list consistently.
Solution:   Call Reset_arglist(). (Shougo Matsushita, closes vim/vim#9154)
3cad470385
2021-11-19 13:45:29 +09:00
b43b6efa34 version.c: update [skip ci] 2021-11-19 03:07:56 +00:00
2d340a3746 docs: regenerate 2021-11-18 21:50:55 +00:00
f71be1f87b fix(lsp): improve incremental sync robustness (#16358)
closes https://github.com/neovim/neovim/issues/16352

* improve handling of multi-byte deletions
2021-11-18 16:49:46 -05:00
d249e18bbf fix(uri): use valid EmmyLua annotations (#16359)
See:

- https://emmylua.github.io/annotations/param.html
- https://emmylua.github.io/annotations/return.html
2021-11-18 21:12:21 +01:00
722647dd8c Merge pull request #16356 from clason/bump-luarocks
build(deps): bump luarocks to 3.8.0
2021-11-18 14:41:14 -05:00
5e46f649e2 fix(diagnostic): don't use nil col if missing from qflist (#16357)
If the quickfixlist item doesn't contain a column it is reported as 0.
Rather than using a nil value in such a case (which breaks diagnostics
elsewhere), just keep the 0 value.
2021-11-18 12:27:46 -07:00
a42a9accab Merge pull request #16355 from mjlbach/fix/docgen-again 2021-11-18 11:31:31 -07:00
8081a30ca8 docs: mark tagfunc.lua methods as private 2021-11-18 11:30:09 -07:00
0746f0021f fix(docgen): add tagfunc.lua 2021-11-18 11:30:09 -07:00
cab542c0f9 build(deps): bump luarocks to 3.8.0 2021-11-18 18:55:36 +01:00
f940e7a5b9 feat(lsp): add tagfunc (#16103) 2021-11-18 12:26:26 -05:00
980c68d036 vim-patch:8.2.3610: crash when ModeChanged triggered too early
Problem:    Crash when ModeChanged triggered too early.
Solution:   Trigger ModeChanged after setting VIsual.
a062006b9d
2021-11-18 14:23:33 +01:00
1fb101afe4 vim-patch:8.2.3609: internal error when ModeChanged is triggered recursively
Problem:    Internal error when ModeChanged is triggered when v:event is
            already in use.
Solution:   Save and restore v:event if needed.
3075a45592

In the vim codebase there is no occurrence of get_vim_var_dict(VV_EVENT)
after the above patch, so in order to hold the same invariant in the
neovim codebase we needed to replace more occurrences than the related
vim patch.
2021-11-18 14:23:33 +01:00
fdfd1eda43 feat: trigger ModeChanged for terminal modes 2021-11-18 11:23:18 +01:00
11683193f5 vim-patch:8.2.3555: ModeChanged is not triggered on every mode change
Problem:    ModeChanged is not triggered on every mode change.
Solution:   Also trigger on minor mode changes. (Maguns Gross, closes vim/vim#8999)
25def2c8b8
2021-11-18 11:23:18 +01:00
60c154687a vim-patch:8.2.3463: pattern matching with ModeChanged not tested
Problem:    Pattern matching with ModeChanged not tested.
Solution:   Add a few more test lines. (issue vim/vim#8856)
72d2fa69e5
2021-11-18 11:23:18 +01:00
fc3e5caefd vim-patch:8.2.3462: ModeChanged only uses one character for new_mode and old_mode
Problem:    The ModeChanged event only uses one character for the new_mode and
            old_mode values.
Solution:   Pass one as first argument to mode(). (issue vim/vim#8856)
d85931e673
2021-11-18 11:23:18 +01:00
69bd1e4e36 vim-patch:8.2.3430: no generic way to trigger an autocommand on mode change
Problem:    No generic way to trigger an autocommand on mode change.
Solution:   Add the ModeChanged autocommand event. (Magnus Gross, closes vim/vim#8856)
f1e8876fa2

N/A patches for version.c:

vim-patch:8.2.3434: function prototype for trigger_modechanged() is incomplete

Problem:    Function prototype for trigger_modechanged() is incomplete.
Solution:   Add "void".
28e591dd50

Fixes #4399.
Fixes #7416.
2021-11-18 11:23:18 +01:00
36538417f0 vim-patch:01164a6546b4 (#16335)
missing changes to src/nvim/po/check.vim from 01164a6546 (diff-ed3e88d59856bb5b62b2a394fb8c7293cd5794531e0718c0aa2d3d768d7973d1)
2021-11-17 21:28:20 -05:00
1f68a21d66 vim-patch:8.2.3593: directory is wrong after executing "lcd" with win_execute() (#16314)
Problem:    Directory is wrong after executing "lcd" with win_execute().
Solution:   Correct the directory when going back to the original window.
            (closes vim/vim#9132)
7f13b24ab6
2021-11-17 21:18:55 -05:00
dba3590a0e vim-patch:8.2.3591: no event is triggered when closing a window (#16306)
Problem:    No event is triggered when closing a window.
Solution:   Add the WinClosed event. (Naohiro Ono, closes vim/vim#9110)
23beefed73

Nvim has already implemented this feature, so this only changes tests
and docs.
2021-11-17 21:11:09 -05:00
5ff972cafe vim-patch:8.2.3522: cannot use \x and \u when setting 'listchars' (#16049)
Problem:    Cannot use \x and \u when setting 'listchars'.
Solution:   Support hex and unicode in hex form. (closes vim/vim#9006)
93ff6720fe
2021-11-17 20:55:59 -05:00
eb3d59126e fix(lsp): change signature of buf_highlight_references (#16345)
the prior signature did not assume an active language client
this function can now be used directly by passing an offset encoding
defaults to utf-16 (standard for LSP)
2021-11-17 21:14:45 +01:00
c0efe49e78 vim-patch:519cc559b08b (#16340)
Update runtime files
519cc559b0
2021-11-17 10:02:59 +01:00
145fc69df9 vim-patch:8.2.3588: break statement is never reached
Problem:    Break statement is never reached.
Solution:   Rely on return value of set_chars_option() not changing.
            (closes vim/vim#9103)
606efc7df4
2021-11-17 07:11:46 +08:00
8dbe47a4bc vim-patch:8.2.3572: memory leak when closing window and using "multispace"
Problem:    Memory leak when closing window and using "multispace" in
            'listchars'.
Solution:   Free the memory. (closes vim/vim#9071)
7a33ebfc5b
2021-11-17 07:11:46 +08:00
5ed2a5cf9c vim-patch:8.2.2520: missing tests for 'listchars'
Problem:    Missing tests for 'listchars'.
Solution:   Add a few more checks. (Yegappan Lakshmanan, closes vim/vim#7854)
04ea7e9049
2021-11-17 07:11:46 +08:00
7528bcec42 fix(options): using :set fillchars should clear local value 2021-11-17 07:11:46 +08:00
8c24e1462c vim-patch:8.2.2518: 'listchars' should be window-local
Problem:    'listchars' should be window-local.
Solution:   Make 'listchars' global-local. (Yegappan Lakshmanan, Marco Hinz,
            closes vim/vim#5206, closes vim/vim#7850)
eed9d46293

Nvim already has this feature, but it implements :set listchars the same
as :setglobal listchars, which is incorrect. Vim's implementation of
:set listchars is correct: using :set listchars clears local value.
2021-11-17 07:11:40 +08:00
eba317d7a9 refactor: reduce number of explicit char casts (#16077)
* refactor: reduce number of explicit char casts
2021-11-16 20:27:59 +01:00
99211b008c vim-patch:8.2.3604: not all sudoers files are recognized (#16338)
Problem:    Not all sudoers files are recognized.
Solution:   Add a file pattern. (Doug Kearns, closes vim/vim#1192)
c143fa0778
2021-11-16 18:34:39 +01:00
b5eab2a98a vim-patch:8.2.3603: fish filetype not recognized (#16337)
Problem:    Fish filetype not recognized.
Solution:   Add a file pattern and match script line. (Doug Kearns)
b1b163efd7
2021-11-16 18:26:03 +01:00
8fb09bc512 Merge pull request #16328 from gpanders/diagnostic-prefix-hi 2021-11-16 08:48:26 -07:00
98af683e0f refactor(diagnostic): make bufnr arguments consistent (#16323)
Make the bufnr argument have similar semantics across API functions;
namely, a nil value means "all buffers" while 0 means "current buffer".
This increases the flexibility of the API by allowing functions such as
enable() and disable() to apply globally or per-namespace, rather than
only on a specific buffer.
2021-11-16 08:47:49 -07:00
890f8cd750 Merge pull request #16330 from clason/vim-8.2.3598
vim-patch:8.2.3598,3599,3600: some filetypes are not recognized
2021-11-16 13:38:07 +01:00
75959d04c4 vim-patch:8.2.3600: filetype test fails
Problem:    Filetype test fails.
Solution:   Add missint change.
314b773abb
2021-11-16 13:04:14 +01:00
b20429c8a5 vim-patch:8.2.3599: not all gdbinit files are recognized
Problem:    Not all gdbinit files are recognized.
Solution:   Add "gdbinit". (Doug Kearns)
782b4bbc16
2021-11-16 12:40:50 +01:00
e5ef736dfe vim-patch:8.2.3598: RouterOS filetype is not recognized
Problem:    RouterOS filetype is not recognized.
Solution:   Add file and script patterns. (closes vim/vim#9097)
0818ab82e7
2021-11-15 23:03:10 +01:00
87a053f126 fix(lsp): fix edge cases in incremental sync (#16308) 2021-11-15 08:51:30 -08:00
63413bd047 refactor(diagnostic)!: rename 'show_header' to 'header'
Rename the `show_header` option in `open_float` to simply `header` and
allow users to specify both the header string as well as the highlight
group.
2021-11-15 09:12:27 -07:00
cc48837622 feat(diagnostic): allow 'prefix' option to return highlight
Extend the 'prefix' option for `open_float` to also provide an optional
highlight group for the prefix string.
2021-11-15 09:05:40 -07:00
bd15ff7b84 test: require fewest number of main loop iterations possible
Change exc_exec to pcall_err to reduce one main loop iteration.
No need to call poke_eventloop() unless after nvim_input().
2021-11-15 10:34:43 +08:00
8f984dc1f2 Merge pull request #16047 from mcepl/vim-8.2.3520
vim-patch:8.2.3520: cannot define a function for thesaurus completion
2021-11-14 21:23:42 -05:00
3c74ba4acb feat(diagnostic): add 'prefix' option to open_float (#16321)
The 'prefix' option accepts a function or a string that is used to add a
prefix string to each diagnostic displayed in the floating window.
2021-11-14 18:40:11 -07:00
2f37ffb719 Merge pull request #16316 from bfredl/macroman
refactor(macros): delete multibyte macros which just are aliases
2021-11-14 17:43:21 +01:00
1450a6f753 refactor(macroman): get rid of MB_COPY_CHAR macro
clean up docs for MB_PTR_ADV and MB_PTR_BACK
2021-11-14 17:08:50 +01:00
54ff21a153 refactor(macros): delete multibyte macros which just are aliases 2021-11-14 16:33:12 +01:00
ede00b29d1 Merge pull request #16317 from jamessan/remove-32bit-windows-ci
ci!: remove win32 builds/releases
2021-11-14 09:13:48 -05:00
7bd6f12b3e ci!: remove win32 builds/releases 2021-11-14 08:51:39 -05:00
27f8b04f17 Merge pull request #16315 from bfredl/multibytes
refactor(multibyte): eliminate mb_* aliases for utf_* functions
2021-11-14 13:44:18 +01:00
ee3a58d42e fix(lsp): ensure buffers are re-attached on rename (#16266)
If a LSP server sent a workspace edit containing a rename the buffers
file name changed without the server receiving a close notification for
the old buffer and without the client properly re-attaching on the new
file.

This affected `Move` code-actions in nvim-jdtls, but also
`vim.lsp.buf.rename` on a class level.
2021-11-14 12:55:16 +01:00
71a4d275dc refactor(multibyte): eliminate mb_char2len alias for utf_char2len 2021-11-14 12:49:12 +01:00
0039ba04b0 refactor(multibyte): eliminate mb_ptr2len alias for utfc_ptr2len 2021-11-14 12:49:12 +01:00
9f27e6cbe7 refactor(multibyte): eliminate mb_char2cells alias for utf_char2cells 2021-11-14 12:49:09 +01:00
2ef9d2a663 chore: disable creating a blank issue 2021-11-11 19:41:37 +01:00
e8631cb8a6 fix(float): skip non-focusable windows for :windo (#15378) 2021-11-11 11:05:18 -07:00
9d6a475ced fix(docs): add sync.lua to gen_vimdoc (#16285) 2021-11-11 07:23:52 -07:00
5d653a1344 Merge pull request #16276 from zeertzjq/channel-closed-term-error
Fixes and tests for sending to terminal channel whose terminal has been deleted
2021-11-11 10:57:16 +01:00
0ecc58c277 fix(lsp): gracefully handle nil workspaceFolders (#16284)
* handle when workspaceFolder is nil in buf.list_workspace_folders and buf.add_workspace_folder
2021-11-11 01:15:59 -08:00
8b5c32c8cd test: add tests for freeing channel opened by termopen()
This indirectly covers #16264
2021-11-11 09:34:23 +08:00
a502a7a731 fix(channel): fix channels opened by nvim_open_term() never being freed 2021-11-11 09:34:23 +08:00
3b89fee246 fix(channel): throw error if sending to internal channel w/o terminal
Prevent SIGABRT when sending to a channel created by nvim_open_term()
after the associated terminal has been deleted.
2021-11-11 09:34:23 +08:00
14def4d227 fix(terminal): free terminal if close_buffer() closes a closed terminal (#16264)
Use the (currently unused) 'destroy' field of the terminal struct as a
flag to indicate that the terminal's destruction is imminent (and
therefore it's close callback should not be called again).

Co-authored-by: Gregory Anders <greg@gpanders.com>
2021-11-10 15:28:55 -07:00
2ecf0a4c61 fix(lsp): rewrite incremental sync (#16252)
* use codeunits/points instead of byte ranges when applicable
* take into account different file formats when computing range and
  sending text (dos, unix, and mac supported)
* add tests of incremental sync
2021-11-09 14:37:48 -08:00
953ae71fd3 feat(diagnostic): do not require namespace for hide() and show() (#16261)
Also fix a few other small bugs regarding saving and restoring extmarks.
In particular, now that the virtual text and underline handlers have
their own dedicated namespaces, they should be responsible for saving
and restoring their own extmarks. Also fix the wrong argument ordering
in the call to `clear_diagnostic_cache` in the `on_detach` callback.
2021-11-09 14:33:01 -07:00
8f31b218f9 fix(lsp): do not index nil client in progress (#16262) 2021-11-09 22:05:41 +01:00
4174244d8b docs: update description for 'list' option (#16254)
Neovim has different defaults for 'list' compared to Vim which is why
the documentation needs to be updated.
2021-11-08 08:22:53 -07:00
8cbe100fcc vim-patch:partial 113cb513f76d (#16260)
Update runtime files
113cb513f7

skip doc/eval.txt
skip doc/insert.txt
skip doc/user_06.txt (needs 8.2.3562)
partial skip doc/syntax.txt (needs 8.2.3562)
2021-11-08 00:10:44 +01:00
16d4af6d2f feat(ui): add vim.ui.input and use in lsp rename (#15959)
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default
2021-11-07 07:13:53 -08:00
b74916cfd2 fix(lsp): convert range to byte index before highlighting (#16218)
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
2021-11-06 15:05:52 -07:00
77c54fc995 Merge pull request #16155 from zeertzjq/fix-redr-border-corruption
fix(float): fix potential heap corruption in win_redr_border
2021-11-06 22:32:28 +01:00
03b805aee6 feat(lua): enable stack traces in error output (#16228) 2021-11-06 08:26:10 -06:00
2dc0af3a4f vim-patch:8.2.3528: 'thesaurus' and 'thesaurusfunc' do not have the same scope
Problem:    'thesaurus' and 'thesaurusfunc' do not have the same scope.
Solution:   Make 'thesaurusfunc' global-local.
f4d8b76d30
2021-11-06 14:24:46 +01:00
1fdbd29dfa fix(diagnostic): handle an unknown or missing client (#16242)
Sometimes plugins use pseudo-client IDs (e.g. nvim-lint or null-ls) in
order to hook into the LSP infrastructure without being a bona fide LSP
client. In these cases, get_client_by_id() will return nil since the
client ID given does not correspond to a real client recognized by the
LSP subsystem. When this happens, use "unknown" for the client name.
2021-11-05 10:10:27 -06:00
c0ba315b54 Merge pull request #16241 from bfredl/disptick
fix(screen): make display_tick monotonic up to 2^64. fixes #16152
2021-11-05 11:19:46 +01:00
9e88c9c12f fix(screen): make display_tick monotonic up to 2^64. fixes #16152
18446744073709551616 screen redraws should be enough for everyone.
2021-11-05 10:43:19 +01:00
3ba800f153 fix(tui): extend smglr ignores to smglp and smgrp (#16239)
The latter were added for xterm by ncurses 6.3 and are similarly
affected.

Fixes https://github.com/neovim/neovim/issues/16238
2021-11-04 20:36:16 -06:00
5ce35abae6 fix(input): never reinterpret unmapped ALT- chrods in Terminal mode (#16222) 2021-11-04 07:43:05 -06:00
fd347840ba fix(diagnostic): fix option resolution in open_float (#16229) 2021-11-04 06:59:24 -06:00
f26b391317 Merge pull request #16221 from glacambre/fix_13187
fix: remove double slash in sysinit path
2021-11-03 18:24:24 -04:00
2481b18a53 Merge pull request #16055 from doubleloop/config_depends 2021-11-03 08:24:39 -04:00
52efcefcc8 fix: remove double slash in sysinit path
Closes https://github.com/neovim/neovim/issues/13187 .
2021-11-03 07:47:40 +01:00
7899c4099b docs(lsp): correct usage examples of formatexpr (#16216) 2021-11-02 17:02:04 -07:00
487286b621 docs: mention replacement for deprecated vim.lsp.diagnostic.show_* (#16211) 2021-11-02 16:24:05 +01:00
ed2573b7e1 Merge pull request #16207 from jamessan/delete-release-tag
ci(release): delete nightly/stable tag so release recreates it
2021-11-02 07:36:33 -04:00
14716e4619 ci(release): delete nightly/stable tag so release recreates it
Even though the releaes itself gets deleted, if the tag is not, then
creating a new release just re-uses the same tag, even though we're
using “--target <sha>”.

[skip ci]
2021-11-02 07:34:55 -04:00
29cec32f44 Merge pull request #16203 from bfredl/revision
fix(extmark): fix missing virt_lines when using id param of set_extmark
2021-11-01 23:50:19 +01:00
995dbd2ca6 fix(extmark): fix missing virt_lines when using id param of set_extmark 2021-11-01 22:57:33 +01:00
b8eabb37b1 Merge pull request #16131 from jamessan/vim-8.1.0306 2021-11-01 11:27:42 -04:00
961cd83b3b refactor(api/marks)!: add opts param for feature extensibility (#16146)
In the future we might want to extend the concept of named marks and
adding opts reduces the need of changing the function signature in the
furute.
2021-11-01 07:46:26 -06:00
fa97d34858 fix(lsp): pass the enriched ctx to the client-side command (#16201) 2021-11-01 14:29:50 +01:00
9e479ea05e vim-patch:8.2.3561: cscope has a complicated way of giving an error message
Problem:    Cscope has a complicated way of giving an error message.
Solution:   Use semsg(). (James McCoy, closes vim/vim#9038)
3c5904d2a5
2021-11-01 06:41:29 -04:00
502ff11663 vim-patch:8.1.0783: compiler warning for signed/unsigned
Problem:    Compiler warning for signed/unsigned.
Solution:   Add type cast.  Change type of buffer. (Ozaki Kiichi, closes vim/vim#3827)
63c0ccd2b6
2021-11-01 06:41:29 -04:00
e6ff154be6 vim-patch:8.1.0779: argument for message functions is inconsistent
Problem:    Argument for message functions is inconsistent.
Solution:   Make first argument to msg() "char *".
32526b3c18
2021-11-01 06:41:29 -04:00
efa924f66b vim-patch:8.1.0743: giving error messages is not flexible
Problem:    Giving error messages is not flexible.
Solution:   Add semsg().  Change argument from "char_u *" to "char *", also
            for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
            vim/vim#3302)  Also make emsg() accept a "char *" argument.  Get rid of
            an enormous number of type casts.
f9e3e09fdc
2021-11-01 06:41:28 -04:00
684640f551 vim-patch:8.1.0306: plural messages are not translated properly
Problem:    Plural messages are not translated properly.
Solution:   Add more usage of NGETTEXT(). (Sergey Alyoshin)
da6e8919e7
2021-11-01 06:40:00 -04:00
7f4b7320f6 Merge pull request #16198 from jamessan/limit-ci-branches
ci: limit CI checks to the main dev branches
2021-11-01 06:37:37 -04:00
519d8deb08 feat(lsp): add per-client commands (#16101) 2021-11-01 03:14:59 -07:00
7ae86c1d4c feat(ui): add opt.kind to vim.ui.select (#15838)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2021-10-31 17:15:09 -07:00
ea2ce90cc6 ci: limit CI checks to the main dev branches
Now that we have various GH actions creating branches in the main repo,
using the generic '**' pattern for the CI workflow is just wasting CI
time and leading to more queued jobs.

[skip ci]
2021-10-31 20:05:52 -04:00
a68faed02d refactor: saner options for uncrustify #16196
* refactor: general good option changes
  sp_deref = remove
  sp_not = remove
  sp_inv = remove
  sp_inside_paren_cast = remove
  mod_remove_duplicate_include = true
  sp_after_semi = add
  sp_after_semi_for = force
  sp_sizeof_paren = remove
  nl_return_expr = remove
  nl_else_brace = remove
  nl_else_if = remove
* refactor: mod_remove_extra_semicolon = true
* refactor: nl_max = 3
* refactor: sp_bool = force
* refactor: sp_compare = force
* refactor: sp_inside_paren = remove
* refactor: sp_paren_paren = remove
* refactor: sp_inside_sparen = remove
* refactor: sp_before_sparen = force
* refactor: sp_sign = remove
* refactor: sp_addr = remove
* refactor: sp_member = remove
* refactor: nl_struct_brace = remove
* refactor: nl_before_if_closing_paren = remove
* refactor: nl_fdef_brace = force
* refactor: sp_paren_comma = force
* refactor: mod_full_brace_do = add
2021-10-31 17:03:08 -07:00
5ad15c9fa1 fix(lsp): improve symbols_to_items performance (#16197)
* use table.insert instead of list_extend to avoid validation overhead

Co-authored-by: Gianmarco Fantinuoli <fanto-dev@hotmail.com>
2021-10-31 15:18:51 -07:00
69e4cb7116 Merge pull request #15907 from black-desk/utf32-to-utf16
fix(lsp): default to UTF-16 in make_position_params
2021-10-31 14:47:08 -07:00
85a8bede45 fix(lsp): default to UTF-16 when lsp client using str_utfindex 2021-10-31 14:15:56 -07:00
2e3a4747e2 fix(lsp): default to UTF-16 in make_position_params 2021-10-31 14:15:56 -07:00
0c1585bc63 Merge pull request #16195 from jamessan/really-fix-win-ci
fix(ci): use correct check for path-existence
2021-10-31 15:11:21 -04:00
98f578293b fix(lsp): don't update active_clients on exit_timeout (#16192) 2021-10-31 12:05:57 -07:00
7126315935 fix(ci): use correct check for path-existence 2021-10-31 14:09:10 -04:00
478748881f Merge pull request #16187 from erw7/fix-build-MinGW
fix(build): fix build failure in MinGW
2021-10-31 12:54:52 -04:00
4445e0230b Merge pull request #16188 from bfredl/packentry
fix(runtime): fix missing packpath entries
2021-10-31 16:19:30 +01:00
0503e17375 fix(build): fix build failure in MinGW
The new MinGW fails to build libuv due to a typedef conflict between
mstcpip.h and src/win/winapi.h. This change avoids conflicts by disabling
typedef in the MinGW header.
2021-11-01 00:07:16 +09:00
e6b8d4f67b fix(runtime): fix missing packpath entries 2021-10-31 15:37:09 +01:00
346227e3ad Merge pull request #16191 from jamessan/fix-cpack-removal
ci(win): only remove choco's cpack.exe if it exists
2021-10-31 10:35:43 -04:00
ec0f4fab48 ci(win): only remove choco's cpack.exe if it exists 2021-10-31 09:41:10 -04:00
52fa1d26db feat(lsp): add formatexpr (#16186)
Co-authored-by: Meck <yesmeck@gmail.com>
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2021-10-31 05:40:26 -07:00
4da0351651 fix(lsp): add placeholder cancel function (#16189)
Fixes a bug introduced by https://github.com/neovim/neovim/pull/15949

When no supported clients for a given method are available, buf_request
returns early with a nil value. If buf_request_sync is called on a
buffer with no clients that support a given method, the returned
`cancel` method (which is nil), is invoked, resulting in an error.

Solution: return an empty function handle
2021-10-31 04:44:45 -07:00
653d963293 Merge pull request #16182 from jamessan/backport-comment
ci(backport): trigger on comments too, so "/backport" works
2021-10-30 16:51:50 -04:00
a1eea968a5 ci(backport): trigger on comments too, so "/backport" works
[skip ci]
2021-10-30 16:50:13 -04:00
91f6c06b52 Merge pull request #16181 from jamessan/backport-perms
ci(backport): add write permissions for contents/pull_requests
2021-10-30 16:35:47 -04:00
9f5e736e5d ci(backport): bump version to v0.0.7
[skip ci]
2021-10-30 16:33:20 -04:00
0c1b80efec ci(backport): add write permissions for contents/pull_requests
The workflow needs to create commits and PRs.

[skip ci]
2021-10-30 16:29:02 -04:00
e501aac7ff Merge pull request #16180 from jamessan/release-workflow
Refactor release workflow to use gh instead of a third-party action
2021-10-30 16:07:31 -04:00
c84b86fe3d ci: make sure choco cpack does not interfere with CMake cpack
[skip ci]
2021-10-30 14:02:04 -04:00
c819ce1fd4 ci(release): do not fail if stable/nightly release doesn't exist
[skip ci]
2021-10-30 14:02:04 -04:00
eede587b06 ci(release): re-publish "stable" release for versioned releases
[skip ci]
2021-10-30 14:02:04 -04:00
0ce800753e ci(release): use gh cli instead of 3rd-party actions
Closes #15709

[skip ci]
2021-10-30 14:01:47 -04:00
2230b578d1 feat: add vim.str_utf_{start,end} (#16129)
vim.str_utf_{start,end} return the offset from the current position to
the start and end of the current utf-character (nearest codepoint)
respectively.
2021-10-30 10:30:40 -07:00
97ae0ab4d8 fix(vim-patch.sh): run nvim with -u NONE -n #16179
Problem:
Because of -u NORC, vim-patch.sh would hang on my machine due to one of my
plugins (start package) waiting for prompt input.

Solution:
- Use -u NONE instead to disable all plugins.
- Also use -n to disable swapfiles. These changes only apply to the --headless
  nvim instances used to process things.
2021-10-30 09:04:04 -07:00
c9e5c778b0 feat(lsp): default to botright for setting qflist (#16177)
* Opens quickfix list spanning the entire nvim window in location
  handlers

closes https://github.com/neovim/neovim/issues/12241
2021-10-30 08:17:00 -07:00
a141f6e922 fix(vim.mpack): rename pack/unpack => encode/decode #16175
Problem:
1. "unpack" has an unrelated meaning in Lua:
   https://www.lua.org/manual/5.1/manual.html#pdf-unpack
2. We already have msgpackparse()/msgpackdump() and
   json_encode()/json_decode(), so introducing another name for the same
   thing is entropy.

Solution:
- Rename vim.mpack.pack/unpack => vim.mpack.encode/decode

Caveat:
This is incongruent with the `Unpacker` and `Packer` functions.
- It's probably too invasive to rename those.
- They also aren't part of our documented interface.
- This commit is "reversible" in the sense that we can always revert
  it and add `vim.mpack.encode/decode` as _aliases_ to
  `vim.mpack.pack/unpack`, at any time in the future, if we want
  stricter fidelity with upstream libmpack. Meanwhile,
  `vim.mpack.encode/decode` is currently the total _documented_
  interface of `vim.mpack`, so this change serves the purpose of
  consistent naming in the Nvim stdlib.
2021-10-30 06:59:59 -07:00
eb6a1039c5 fix(build): remove amalg build target for LuaJIT (#16178)
fixup for #16041 (`amalg` build is recommended by LuaJIT for performance
but this way of doing it breaks parallel build with `make -j`)
2021-10-30 12:10:19 +02:00
e921e98ce3 refactor(diagnostic): make display handlers generic (#16137)
Rather than treating virtual_text, signs, and underline specially,
introduce the concept of generic "handlers", of which those three are
simply the defaults bundled with Nvim. Handlers are called in
`vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to
handle how diagnostics are displayed.
2021-10-29 18:47:34 -07:00
4472c56d54 refactor: uncrustify #16090 2021-10-29 17:23:20 -07:00
16d06fa3eb fix(eval): fix has('wsl') #16153
Problem:
has('wsl') is decided at build-time.

Solution:
Check os_uname().
Fixes #12642, #16143
2021-10-29 16:55:32 -07:00
ac358bfb2f Merge pull request #16154 from bfredl/neoscript
refactor(api): break out Vim script functions to its own file
2021-10-30 00:05:02 +02:00
615e03c33e build(deps): bump luv to 1.42.0-1 (#16113)
* Use uv_handle_size/uv_req_size instead of sizeof
* LuaJIT: add missing LJ_ENDIAN and LJ_NO_UNWIND checks for DASM [fixes building on aarch64]
2021-10-29 17:55:21 +02:00
6acfbd810d build(deps): bump luajit to latest commit (#16041)
bump LuaJIT to b4b2dce9fc
now requires `-funwind-tables` build flag, which conflicts with
`-DLUA_USE_ASSERT`
2021-10-29 17:54:59 +02:00
a60beeb34f refactor(api): break out Vim script functions to its own file 2021-10-29 16:59:53 +02:00
c3a3e65428 refactor(api): break out vim_to_object/object_to_vim to own file 2021-10-29 15:52:28 +02:00
d1c470957b feat(lsp): track pending+cancel requests on client object #15949 2021-10-29 05:45:01 -07:00
1dbbaf89bf fix(eval): checking for a non-empty string is too strict (#15987)
Cherry-pick check_for_nonempty_string() from patch vim-8.2.2133 and
apply it on the bases of https://github.com/neovim/neovim/pull/13489

2a9d5d386b
2021-10-28 22:13:40 -04:00
bb79e05f81 vim-patch:8.2.3556: filler lines are incorrect for other window in diff mode (#16164)
Problem:    Filler lines are incorrect for other window in diff mode after
            making a change.
Solution:   Copy filler lines from the current window. (closes vim/vim#8809)
841c225b9e
2021-10-28 22:04:57 -04:00
4a618b00bc Merge pull request #16141 from dundargoc/ci/split-jobs 2021-10-28 11:57:17 -04:00
a91a5c1880 ci: run functionaltest-lua on drafts as well 2021-10-28 10:55:26 +02:00
7ff1bc18a9 fix(float): redraw if w_border_adj changed 2021-10-28 06:32:36 +08:00
de670f3809 fix(float): fix potential heap corruption in win_redr_border 2021-10-28 06:32:36 +08:00
d918759dee test(vim_spec): fix MSVC_32 skip for nvim_parse_expression test (#16161)
"works with &opt" is flaky; now it always fails after #15999 for some reason.

This test was skipped in #10773 due to previous flakiness, but after the switch away from appveyor
the check no longer works. Just skip for any CI running the MSVC_32 job.
2021-10-27 16:27:17 -06:00
3e1ef18579 ci: add newly added api file extmark.c to gen-vimdoc (#16158) 2021-10-27 11:42:19 -06:00
a5d6f36fc7 Merge pull request #16125 from dundargoc/refactor/lua/split-executor
refactor: split lua/executor.c into two files
2021-10-26 21:43:13 +02:00
13d331ef0d refactor: split executor.c into two files 2021-10-26 21:04:52 +02:00
6cc456deeb feat(ci): add backport PR action (#14766)
Trigger the backport action upon merge by marking a PR with the label `backport <branchname>` or after merge by applying the label and writing a comment containing `/backport`.
2021-10-26 08:45:15 -07:00
5e207a65e3 Merge pull request #16149 from zeertzjq/man-clean 2021-10-26 10:12:35 -04:00
f75d00456d Merge pull request #16147 from bfredl/neomark
refactor(api): move extmark API to its own file
2021-10-26 10:45:11 +02:00
72309d13b4 docs(manpage): update description of --clean 2021-10-26 07:03:14 +08:00
c8882ca7e7 refactor(api): move extmark API to its own file 2021-10-25 22:33:40 +02:00
09e96fe609 Merge pull request #16124 from mjlbach/feat/bjorn-bait
feat: add vim.str_utf_pos
2021-10-24 16:20:16 +02:00
d752cbc4d2 feat: add vim.str_utf_pos function
vim.str_utf_pos returns the codepoints for all utf-8 chars (only, currently)
in a string
2021-10-24 03:35:38 -07:00
b092171e7c vim-patch:8.2.3525: option variable name does not match option name
Problem:    Option variable name does not match option name. (Christ van
            Willigen)
Solution:   Rename the variable.
d4c4bfa007
2021-10-24 08:57:30 +02:00
6acebb8b56 vim-patch:8.2.3547: opening the quickfix window triggers BufWinEnter twice (#16108)
Problem:    Opening the quickfix window triggers BufWinEnter twice. (Yorick
            Peterse)
Solution:   Only trigger BufWinEnter with "quickfix". (closes vim/vim#9022)
1d30fde3c9
2021-10-23 21:55:04 -04:00
36ff5976b9 vim-patch:8.2.3521: options completion test fails
Problem:    Options completion test fails.
Solution:   Add 'thesaurusfunc' to the results.
abdcfd1c83
2021-10-23 22:30:53 +02:00
cbec765915 vim-patch:8.2.3520: cannot define a function for thesaurus completion
Problem:    Cannot define a function for thesaurus completion.
Solution:   Add 'thesaurusfunc'. (Yegappan Lakshmanan, closes vim/vim#8987,
            closes 8950)
160e994d76
2021-10-23 22:30:50 +02:00
9f392c071a vim-patch:partial 079ba76ae7a7 (#16126)
Update runtime files
079ba76ae7

skip optwin.vim (needs 8.2.3520)
skip doc/options.txt (needs 8.2.1535)
skip doc/insert.txt (needs 8.2.3528)
2021-10-23 22:29:17 +02:00
966e605db9 Merge pull request #16128 from bfredl/vluapack
feat(lua): document support of packages with v:lua syntax
2021-10-23 21:44:30 +02:00
96ce6327a3 vim-patch:8.2.3542: too many comments are old style (#16096)
Problem:    Too many comments are old style.
Solution:   Change comments to // style. (closes vim/vim#9021)
c5935a859e
2021-10-23 13:58:56 -04:00
4a0acd6fac vim-patch:8.2.0026: still some /* */ comments (#16088)
Problem:    Still some /* */ comments.
Solution:   Convert to // comments.
85a2002adb
2021-10-23 13:56:43 -04:00
bb9e6a1583 Merge pull request #16111 from dundargoc/vim-patch/comments
vim-patch:8.1.2368,8.1.2378,8.1.2379,8.1.2380,8.1.2387,8.1.2388,8.1.2392,8.1.2394,8.1.2395,8.1.2396
2021-10-23 13:05:19 -04:00
9dd371bb2e feat(lua): document support of packages with v:lua syntax
this already worked in 0.5 but was not properly documented or tested
2021-10-23 18:24:00 +02:00
fa4b24072e Merge pull request #16029 from bfredl/multiline
feat(decorations): support more than one virt_lines block
2021-10-23 16:54:49 +02:00
8d7816cf27 feat(decorations): support more than one virt_lines block 2021-10-23 14:17:09 +02:00
8ade2f5b04 refactor(decorations): mark decorations directly on the marktree
This allows to more quickly skip though regions which has non-decorative
marks when redrawing. This might seem like a gratuitous
micro-optimization in isolation.

But!

Soon decorations are gonna crop into other hot inner-loop paths,
including the plines.c code for calculating the horizontal and
vertical space of text. Then we want to quickly skip over regions with
"only" overlaying decorations (which do not affect text size)
2021-10-23 11:11:00 +02:00
cb15055c29 fix(lsp): cleanup progress messages for the correct client (#16110) 2021-10-21 09:36:27 -07:00
80456cf836 feat(lsp): add exit_timeout flag (#16070)
* This flag allows customizing the time before sending kill -15 to the
  server. If set to false, neovim exits immediately after sending
  request('shutdown'). Otherwise, polls until all servers have shutdown,
  and then kills remaining servers via kill -15 at exit_timeout
  duration. Defaults to 500 ms.
2021-10-21 09:36:01 -07:00
eaa03b7181 vim-patch:8.2.3550: completion() does not work properly (#16112)
* vim-patch:8.2.3550: completion() does not work properly

Problem:    completion() does not work properly.
Solution:   Set xp_line and add WILD_HOME_REPLACE. (Shougo Matsushita,
            closes vim/vim#9016)
ae38a9db77

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2021-10-21 17:46:24 +02:00
e59c0009a7 vim-patch:8.1.2396: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
e38eab22c1
2021-10-21 12:07:15 +02:00
8000f6d566 vim-patch:8.1.2395: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
0d6f5d9740
2021-10-21 12:07:14 +02:00
daf670dde6 vim-patch:8.1.2394: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
63d9e730f7
2021-10-21 12:07:14 +02:00
ce441b8b13 vim-patch:8.1.2392: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
6e0ce171e1
2021-10-21 12:07:14 +02:00
df27579f54 vim-patch:8.1.2388: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
4ba37b5833
2021-10-21 12:07:14 +02:00
1d54153ee0 vim-patch:8.1.2387: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
2ab2e8608f
2021-10-21 12:07:14 +02:00
050130ce12 vim-patch:8.1.2380: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
306139005c
2021-10-21 12:07:14 +02:00
f677ba4dab vim-patch:8.1.2379: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
217e1b8359
2021-10-21 12:07:14 +02:00
122c0dfb5d vim-patch:8.1.2378: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
5d18efecfd
2021-10-21 12:07:14 +02:00
d5894ada70 vim-patch:8.1.2368: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
c667da5185
2021-10-21 12:07:14 +02:00
d0f10a7add Merge pull request #14794 from BK1603/gdbserver_fix
functionaltest: fix running tests under gdbserver
2021-10-20 21:27:40 +02:00
81717d2461 vim-patch:8.1.2243: typos in comments (#16104)
Problem:    Typos in comments.
Solution:   Fix the typos. (Dominique Pelle, closes vim/vim#5160)  Also adjust
            formatting a bit.
32aa10203b
2021-10-20 12:19:14 -07:00
c5525f265b fix(lsp): avoid duplicates in client attached buffers (#16099)
closes https://github.com/neovim/neovim/issues/16058

* add client.attached_buffers
* only update client.attached_buffers in on_attach
* use table instead of list for attached_buffers to avoid duplication
2021-10-20 09:33:09 -07:00
dc6c9fe442 fix(lsp): adjust legacy show diagnostic functions to use correct scope (#16106)
* `where` was renamed to `scope`
2021-10-20 08:27:55 -07:00
f421718d8d Merge pull request #16086 from bfredl/termpipe_input
feat(nvim_open_term): support input callback in lua
2021-10-20 14:27:28 +02:00
9e41e82481 feat(nvim_open_term): support input callback in lua 2021-10-20 13:07:43 +02:00
035d82e0d3 build: update cmake min version to 3.10 #16065
* build(cmake): update cmake min version to 3.10
* ci: test cmake minimum required version
* build(cmake): remove some legacy includes
  * Since version 3.5 cmake_parse_arguments is implemented natively.
2021-10-19 19:19:33 -07:00
427bac6877 fix(diagnostic): allow floats to be focusable (#16093)
Setting focus_id allows the float to be focused by calling the function
a second time (a feature of open_floating_preview).
2021-10-19 16:29:52 -06:00
a2994c82e3 fix(diagnostic): handle diagnostics placed past the end of line (#16095) 2021-10-19 16:27:49 -06:00
208d259e83 Merge pull request #15767 from lewis6991/lua_var_index
feat(lua): allow passing handles to `vim.b/w/t`
2021-10-19 22:21:31 +02:00
dfef90a518 fix(gen_vimdoc.py): spacing around inline elements #16092
The spacing fix drew attention to a couple of places that were using
incorrect formatting such as the key listing for `nvim_open_win`, so
those were fixed too.
2021-10-19 12:55:22 -07:00
6c5e7bde9a feat(lua): allow passing handles to vim.b/w/t
vim.bo can target a specific buffer by indexing with a number, e.g:
`vim.bo[2].filetype` can get/set the filetype for buffer 2. This change
replicates that behaviour for the variable namespace.
2021-10-19 19:47:33 +01:00
064411ea7f refactor(diagnostic)!: replace 'show_*' functions with 'open_float' (#16057)
'show_line_diagnostics()' and 'show_position_diagnostics()' are
almost identical; they differ only in the fact that the latter also
accepts a column to form a full position, rather than just a line. This
is not enough to justify two separate interfaces for this common
functionality.

Renaming this to simply 'show_diagnostics()' is one step forward, but
that is also not a good name as the '_diagnostics()' suffix is
redundant. However, we cannot name it simply 'show()' since that
function already exists with entirely different semantics.

Instead, combine these two into a single 'open_float()' function that
handles all of the cases of showing diagnostics in a floating window.
Also add a "float" key to 'vim.diagnostic.config()' to provide global
values of configuration options that can be overridden ephemerally.
This makes the float API consistent with the rest of the diagnostic API.

BREAKING CHANGE
2021-10-19 11:45:51 -06:00
sim
aa4f0879e3 feat(lsp): set codelens virtual text hl_mode to combine (#16048)
It looks a bit off with the extmark going over the cursorline.

(With hl_mode combine it keeps the background of the cursorline under the codelens virtualtext)
2021-10-19 18:41:57 +02:00
308fd88d0d vim-patch:8.2.3537: wrong mode() during 'operatorfunc' #16087
Problem:    mode() does not return the right value in 'operatorfunc'.
Solution:   Reset finish_op while calling 'operatorfunc'.
75c30e96cf
2021-10-19 07:39:25 -07:00
bdd180b5d2 docs: clarify chdir/CWD behaviors #16083 2021-10-19 07:37:11 -07:00
da7a4684df fix(api/nvim_eval_statusline): allow maxwidth=0 #16080
Allows disabling statusline truncation by allowing maxwidth to be
set to 0 in `nvim_eval_statusline`.
2021-10-19 07:35:44 -07:00
9fb0f12357 feat(man.vim): convert spaces to underscores #16068
PostgreSQL ships with man pages for SQL statements like `CREATE TABLE`,
which are provided with underscores as `man 7 CREATE_TABLE`. This patch
updates `man#open_page` (as used by `:Man`) such that visually selecting
the words `CREATE TABLE` in SQL code and pressing `K` properly opens the
desired man page.

Writing `:Man CREATE TABLE` still does not work, since `CREATE` is
interpreted as a section name. (Similarly, `:Man CREATE TABLE AS` fails
because there are too many arguments to `:Man`.) But this is okay,
because if you're typing it anyway then you can just enter underscores
and also tab-completion properly suggests `:Man CREATE_TABLE(7)`.

This is a bit bespoke, but my box has over 9000 man pages (as reported
by `man -k '' | wc -l`), and not one of them has a space in the man page
name, whereas the Postgres manuals do exist and are actually useful.

Test Plan:
On a machine with Postgres manual pages, running

    nvim -u NORC +'exe "norm iCREATE TABLE foo(x int);" | norm 0veeK'

should open the appropriate man page.

wchargin-branch: man-spaces-to-underscores
2021-10-19 07:24:43 -07:00
aac15cf4ad Merge #16000 refactor: uncrustify 2021-10-19 06:51:42 -07:00
6059784770 refactor: remove space after star 2021-10-19 15:20:33 +02:00
38dd53c525 refactor: make commas trail in enums 2021-10-19 15:20:33 +02:00
f98b8d2d44 refactor: enable formatting for files under lib 2021-10-19 15:20:33 +02:00
29b718d04c docs: regenerate (#15986)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-10-19 06:03:20 -07:00
4219cfcb90 Merge pull request #16084 from dundargoc/ci/commitlint/checkout-branch-directly
ci(commitlint): use action to checkout to pr branch directly
2021-10-19 07:30:09 -04:00
9039aa24b6 ci(commitlint): use action to checkout to pr branch directly 2021-10-19 09:58:30 +02:00
9086938f7b feat(api): evaluate statusline string #16020
Adds API function `nvim_eval_statusline` to allow evaluating a
statusline string and obtaining information regarding it.

Closes https://github.com/neovim/neovim/issues/15849
2021-10-18 12:44:17 -07:00
e7ea54a3df feat(lsp): use vim.ui.select() in codelenses (#16004)
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2021-10-18 11:52:22 -07:00
bd2f61c6c4 fix(lsp): fix cursor row after textEdits (#16038) 2021-10-18 11:49:33 -07:00
bcc9ba51fa fix(lsp): persist diagnostic config for clients
Persist configuration settings set with `vim.lsp.with` and
`vim.lsp.diagnostic.on_publish_diagnostics` by setting the config for
the namespace associated with the client.
2021-10-18 10:01:41 -06:00
6b0a2e6996 build(install): rescan GLOB files on rebuild 2021-10-18 11:44:15 +02:00
389a898586 Merge pull request #16034 from rcowsill/ci/labeler/no-checkout
ci(labeler): Remove checkout steps
2021-10-17 21:18:27 -04:00
e62cac5be1 refactor: convert to doxygen-style comments #16013 2021-10-17 17:55:27 -07:00
aff444659e fix(PVS/V1028): prevent possible overflow #16023
Full warning: "Possible overflow. Consider casting operands, not the
result."

https://pvs-studio.com/en/docs/warnings/v1028/
2021-10-17 17:11:23 -07:00
ffc28dcbdb Merge pull request #15999 from famiu/fix/build/export-windows-symbols
fix(build): export symbols on Windows
2021-10-17 23:58:14 +02:00
8f9f127274 Merge pull request #15973 from bfredl/luapath
fix(runtime): don't use regexes inside lua require'mod'
2021-10-17 18:35:53 +02:00
a1e8199fff Merge pull request #15952 from zeertzjq/vim-8.1.1291
vim-patch:8.0.{1459,1460,1461,1463},8.1.{0602,0604,1291},8.2.{0189,0876,0909,1411}: chdir and DirChanged related patches
2021-10-17 10:26:11 -04:00
ea2023f689 fix(runtime): don't use regexes inside lua require'mod'
Fixes #15147 and fixes #15497. Also sketch "subdir" caching. Currently
this only caches whether an rtp entry has a "lua/" subdir but we could
consider cache other subdirs potentially or even "lua/mybigplugin/"
possibly.

Note: the async_leftpad test doesn't actually fail on master, at least
not deterministically (even when disabling the fast_breakcheck
throttling). It's still useful as a regression test for further changes
and included as such.
2021-10-17 16:21:42 +02:00
77e6ecf85a Merge pull request #15930 from dundargoc/vim-patch/old-style-c-comments
vim-patch:8.1.2396,8.1.2395,8.1.2394,8.1.2392,8.1.2368,8.1.2388,8.1.2379
2021-10-17 10:21:40 -04:00
d2d30dfabd fix(diagnostic): do not override existing config settings #16043
When using `true` as the value of a configuration option, the option is
configured to use default values. For example, if a user configures
virtual text to include the source globally (using
vim.diagnostic.config) and a specific namespace or producer configures
virtual text with `virt_text = true`, the user's global configuration is
overriden.

Instead, interpret a value of `true` to mean "use existing settings if
defined, otherwise use defaults".
2021-10-17 07:18:35 -07:00
38821cc50e test(dirchanged): add tests for DirChanged pattern "auto" 2021-10-17 22:04:53 +08:00
6004f9137a refactor(dirchanged): tab -> tabpage
Match Vim's behavior.
2021-10-17 22:04:53 +08:00
36290a2ebd vim-patch:8.2.1411: when splitting a window localdir is copied but prevdir is not
Problem:    when splitting a window localdir is copied but prevdir is not.
Solution:   Also copy prevdir. (closes vim/vim#6667)
a9a47d157a
2021-10-17 22:04:53 +08:00
60584c0245 vim-patch:8.2.0909: cannot go back to the previous local directory
Problem:    Cannot go back to the previous local directory.
Solution:   Add "tcd -" and "lcd -". (Yegappan Lakshmanan, closes vim/vim#4362)
002bc79991
2021-10-17 22:04:53 +08:00
34cfe74568 vim-patch:8.2.0876: :pwd does not give a hint about the scope of the directory
Problem:    :pwd does not give a hint about the scope of the directory
Solution:   Make ":verbose pwd" show the scope. (Takuya Fujiwara, closes vim/vim#5469)
950587242c
2021-10-17 22:04:53 +08:00
b1dd90c760 vim-patch:8.2.0189: cd() with NULL argument crashes
Problem:    cd() with NULL argument crashes.
Solution:   Check for NULL. (Ken Takata, closes vim/vim#5558)
7cc96923c4
2021-10-17 22:04:53 +08:00
8a2489d0a4 test: partially port Vim patches 8.1.2278 and 8.2.1432 2021-10-17 22:04:53 +08:00
8727d38012 vim-patch:8.1.1291: not easy to change directory and restore
Problem:    Not easy to change directory and restore.
Solution:   Add the chdir() function. (Yegappan Lakshmanan, closes vim/vim#4358)
1063f3d200

Also includes some documentation changes from patch 8.1.1218.
2021-10-17 22:04:53 +08:00
57651df9c1 vim-patch:8.1.0604: autocommand test fails on MS-Windows
Problem:    Autocommand test fails on MS-Windows.
Solution:   Use pathcmp() instead of strcmp() to check if a directory differs.
9eb76af451
2021-10-17 22:04:53 +08:00
e91dee5c21 vim-patch:8.1.0602: DirChanged is also triggered when directory didn't change
Problem:    DirChanged is also triggered when the directory didn't change.
            (Daniel Hahler)
Solution:   Compare the current with the new directory. (closes vim/vim#3697)
2caad3fbbd
2021-10-17 22:04:53 +08:00
eed89d5e0c vim-patch:8.0.1463: test fails without 'autochdir' option
Problem:    Test fails without 'autochdir' option.
Solution:   Skip test if 'autochdir' is not supported.
ec48a9c589
2021-10-17 22:04:53 +08:00
920473d2f2 vim-patch:8.0.1459: cannot handle change of directory
Problem:    Cannot handle change of directory.
Solution:   Add the DirChanged autocommand event. (Andy Massimino,
            closes vim/vim#888)  Avoid changing directory for 'autochdir' too often.
b7407d3fc9

Only add "auto" pattern. "window" and "global" are already implemented.
Skip `Test_dirchanged_auto` using `CheckFunction test_autochdir`.
Part of PR #15952. More information can be found there.

N/A patches for version.c:

vim-patch:8.0.1460: missing file in patch

Problem:    Missing file in patch.
Solution:   Add changes to missing file.
b5cb65ba2b

vim-patch:8.0.1461: missing another file in patch

Problem:    Missing another file in patch.
Solution:   Add changes to missing file.
15833239a4
2021-10-17 22:04:53 +08:00
30af69509d Merge #15994 feat(:source, nvim_exec): script-local scope 2021-10-17 06:20:35 -07:00
aa644b7fd3 fix(build): export symbols on Windows
Closes https://github.com/neovim/neovim/issues/15063

Allows using Neovim core functions using LuaJIT FFI on Windows.
2021-10-17 18:49:55 +06:00
b98383a250 fixup! vim-patch:8.1.2379: using old C style comments 2021-10-17 12:04:06 +02:00
f19dc06081 vim-patch:8.2.3519: TOML files are not recognized (#16045)
Problem:    TOML files are not recognized.
Solution:   Add filetype patterns for TOML. (Aman Verma, closes vim/vim#8984)
28b6a3bef6
2021-10-16 23:38:05 +02:00
fc1cdb8821 Merge pull request #16042 from clason/vim-2286304cdbba
vim-patch:2286304cdbba
chore(test): adapt healthcheck test to new css syntax
2021-10-16 19:24:19 +02:00
fbc5b7b090 chore(test): adapt healthcheck test to new css syntax
The runtime file update
2286304cdb
added a `syn keyword` for `css`, which affects (via `html` and
`markdown` syntax files) the highlighting of `:checkhealth` output
(before, `ERROR:` was highlighted with `healthError`; now the colon is
no longer included).
2021-10-16 19:17:28 +02:00
0ba77f2f31 vim-patch:2286304cdbba
Update runtime files
2286304cdb
2021-10-16 18:03:51 +02:00
4476d4ef17 fixup! vim-patch:8.1.2388: using old C style comments 2021-10-16 17:53:03 +02:00
88ef0d3de4 fixup! vim-patch:8.1.2379: using old C style comments 2021-10-16 17:50:51 +02:00
46749faac4 fixup! vim-patch:8.1.2396: using old C style comments 2021-10-16 17:35:37 +02:00
1ced6cf08c vim-patch:8.2.3501: tmux filetype dection is incomplete (#16021)
Problem:    tmux filetype dection is incomplete
Solution:   Also use tmux for files having text after .conf. (Eric Pruitt,
            closes vim/vim#8971)
e519eb41c1
2021-10-15 20:01:36 -04:00
68b2a9e569 fix: correctly capture uri scheme on windows (#16027)
closes https://github.com/neovim/neovim/issues/15261

* normalize uri path to forward slashes on windows
* use a capture group on windows that avoids mistaking drive letters as uri scheme
2021-10-15 12:03:41 -07:00
4c4a41c70c ci(labeler): Remove checkout steps
Sets GH_REPO and passes PR number to `gh`, making checkout unnecessary
2021-10-15 15:08:12 +01:00
5fd4557573 Merge pull request #16014 from dundargoc/refactor/reduce-char-casts
refactor: reduce number of unique char casts
2021-10-14 23:48:42 +02:00
da9b0abc67 feat(:source, nvim_exec): defer script item creation until s:var access
For anonymous scripts, defer the creation of script items until an attempt to access a script-local
variable is made. This dramatically reduces the number of script items created when using lots of
vim.cmd and nvim_exec especially.

This will mean <SID> usage fails until a script-local variable access is first made.
2021-10-14 12:50:04 +01:00
88e16a7f30 Merge pull request #16019 from dundargoc/ci/commitlint/downgrade-necessary-git-version
ci: allow older git versions when using lintcommit
2021-10-14 07:10:33 -04:00
35c13620a1 ci: allow older git versions when using lintcommit
More specifically, use "git rev-parse --abbrev-ref HEAD" instead of "git
branch --show-current" to get current branch.
2021-10-14 10:13:56 +02:00
d4ed51eb44 feat(:source, nvim_exec): support script-local variables
Based on #13143 (and #11507) with changes:

 - Omit script_type_E. Use sn_name == NULL to determine anon items.
 - Keep SID_STR. Used by anon :source for .lua files (no item).
 - Show SID in get_scriptname output (:verbose set).
 - Factor item creation into new_script_item.
 - Leave sc_seq = 0 (anon scripts don't re-use the same item when re-sourced).
 - Add tests for anon :source.

Co-authored-by: Vikram Pal <vikrampal659@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2021-10-14 01:27:10 +01:00
6b9cb665fa Merge pull request #16015 from dundargoc/ci/labeler/breaking-changes 2021-10-13 16:12:22 -04:00
348787a1b7 ci: make labeler also work for breaking changes
This means that

"refactor!: description"

and

"refactor(scope)!: description"

will add the "refactor" label.
2021-10-13 19:55:10 +02:00
24a1880866 refactor: reduce number of unique char casts 2021-10-13 18:26:18 +02:00
33e79237bc build(tests): isolate the user environment XDG_DATA_DIRS #16003
Problem:
Some tests were not passing on my machine, specifically in
`test/functional/api/vim_spec.lua` the two tests under
`describe('nvim_get_runtime_file...`

Solution:
Unset `XDG_DATA_DIRS` in the test runner.
Note: Window CI failed if we set it to the same value as `XDG_DATA_HOME`.
2021-10-12 20:12:11 -07:00
5365f24168 fix(heath/provider.vim): using list as string #16007
Fixes #15988
2021-10-12 20:06:19 -07:00
649b3160a1 refactor: reduce number of unique char casts (#15995) 2021-10-12 17:52:54 +02:00
64f0fdc682 docs: .git-blame-ignore-revs #15775 2021-10-12 08:00:13 -07:00
40be47e0fa refactor: format all C files under nvim/ #15977
* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
    * src/nvim/indent_c.c
    * src/nvim/regexp.c
    * src/nvim/regexp_nfa.c
    * src/nvim/testdir/samples/memfile_test.c
2021-10-12 07:56:52 -07:00
ee342d3cef fix(lsp): maintain client_ids table structure when filtering (#15991) 2021-10-11 08:52:11 -07:00
d288daac2b fix(lsp): do not invoke handlers for unsupported methods (#15926)
Closes https://github.com/neovim/neovim/issues/15174

Instead of invoking handlers with unsupported methods, pre-compute which
clients support a given method and only notify the user if no clients
support the given method.
2021-10-10 22:32:50 -07:00
b3e0d6708e Merge pull request #15502 from seandewar/vim-8.1.1921
Add method call support for more built-ins: vim-patch:8.1.{1336,1952,1961,1984}
2021-10-10 16:48:24 -04:00
62eec98d5f vim-patch:8.2.3491: xpm2 filetype dection is not so good (#15982)
Problem:    xpm2 filetype dection is not so good.
Solution:   Adjust the check for xpm2. (closes vim/vim#8914)
6e77b88df6
2021-10-10 20:57:09 +02:00
45fa70adcb fix(lsp): add done flag to messages returned in util.get_progress_messages() (#15985) 2021-10-10 11:41:16 -07:00
f4359b5dbd vim-patch:8.2.3461: distinguish Normal and Terminal-Normal mode #15878
Problem:    Cannot distinguish Normal and Terminal-Normal mode.
Solution:   Make mode() return "nt" for Terminal-Normal mode. (issue vim/vim#8856)
72406a4bd2
2021-10-09 18:15:46 -07:00
65b8232260 vim-patch:8.2.{210,424,436,...} #15976
* vim-patch:8.2.1082: Coverity complains about ignoring dict_add() return value

Problem:    Coverity complains about ignoring dict_add() return value.
Solution:   Add (void).
91639195ef

N/A patches for version.c:

vim-patch:8.2.0210: Coverity complains about uninitialized field

Problem:    Coverity complains about uninitialized field.
Solution:   Initialize the field.
eed3571fe0

vim-patch:8.2.0424: checking for wrong return value

Problem:    Checking for wrong return value. (Tom)
Solution:   Invert the check and fix the test.
97acfc781b

vim-patch:8.2.0436: no warnings for incorrect printf arguments

Problem:    No warnings for incorrect printf arguments.
Solution:   Fix attribute in declaration.  Fix uncovered mistakes. (Dominique
            Pelle, closes vim/vim#5834)
db99f9f29a

vim-patch:8.2.0498: Coverity complains about uninitialized field

Problem:    Coverity complains about uninitialized field.
Solution:   Initialize the whole typval_T.
4227c789ff

vim-patch:8.2.0668: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Change "int" to "size_t". (Mike Williams)
7f6f56f43c

vim-patch:8.2.1034: compiler warning for uninitialized variables

Problem:    Compiler warning for uninitialized variables.
Solution:   Add initializations. (John Marriott)
38041da1c2

vim-patch:8.2.1117: Coverity warns for unsing unitialized field

Problem:    Coverity warns for unsing unitialized field.
Solution:   Initialize v_lock.
a9a8e5f0dc

vim-patch:8.2.1148: warning for using int instead of size_t

Problem:    Warning for using int instead of size_t.
Solution:   Change "len" argument to size_t. (Mike Williams)
cbb6bdcd89

vim-patch:8.2.1251: Vim9: warning for pointer usage, test failure undetected

Problem:    Vim9: warning for pointer usage, test failure undetected.
Solution:   Fix pointer indirection.  Give error when executing function
            failed for any reason.  Fix instruction names.
682d0a1546

printable_func_name() is applicable but the vim9 changes are N/A.
Compilers can detect misuse of static functions.

vim-patch:8.2.1275: Vim9: compiler warning for buffer size

Problem:    Vim9: compiler warning for buffer size.
Solution:   Change the offset from 10 to 15. (Dominique Pellé, closes vim/vim#6518)
5a67c37a55

vim-patch:8.2.1443: Vim9: crash when interrupting a nested :def function

Problem:    Vim9: crash when interrupting a nested :def function.
Solution:   Push a dummy return value onto the stack. (closes vim/vim#6701)
cdd70f09a5

vim-patch:8.2.1818: SE Linux: deprecation warning for security_context_t

Problem:    SE Linux: deprecation warning for security_context_t.
Solution:   Use "char *" instead. (James McCoy, closes vim/vim#7093)
8956023920

SELINUX support was removed in commit 1de77bbcec

vim-patch:8.2.2004: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable.
Solution:   Initialize "ufunc". (John Marriott)
b3a01946b3

vim-patch:8.2.2051: Vim9: crash when aborting a user function call

Problem:    Vim9: crash when aborting a user function call.
Solution:   Do not use the return value when aboring. (closes vim/vim#7372)
34c54eb6cb

vim-patch:8.2.2270: warning for size_t to int conversion

Problem:    Warning for size_t to int conversion. (Randall W. Morris)
Solution:   Add a type cast.
38a434f7ba

vim-patch:8.2.2333: Vim9: warning for uninitialized variable

Problem:    Vim9: warning for uninitialized variable. (Tony Mechelynck)
Solution:   Initialize "res".
cb6cbf29e9

vim-patch:8.2.2460: Coverity warns for unused value

Problem:    Coverity warns for unused value.
Solution:   Do not reset the return value to OK.
fc1dafa91c

vim-patch:8.2.2461: Coverity warns for unchecked return value

Problem:    Coverity warns for unchecked return value.
Solution:   Add "(void)" to avoid the warning.
fef8064b54

vim-patch:8.2.2557: compiler warning for shadowd variable

Problem:    Compiler warning for shadowd variable.
Solution:   Declare "p" only once.
087b5ff35d

vim-patch:8.2.2730: Coverity complains about not restoring character

Problem:    Coverity complains about not restoring character.
Solution:   Also restore the character in case of an error.
c9605f0595

vim-patch:8.2.2795: Coverity warns for not using return value

Problem:    Coverity warns for not using return value.
Solution:   Check the return value of compiling the substitute expression.
169502fb0b

vim-patch:8.2.2995: linker errors with dynamic Python 3.10

Problem:    Linker errors with dynamic Python 3.10.
Solution:   Add a couple of library entries. (Zdenek Dohnal, closes vim/vim#8381,
            closes vim/vim#8356)
90478f35a8

vim-patch:8.2.3000: Vim9: warning for uninitialized variable

Problem:    Vim9: warning for uninitialized variable.
Solution:   Add initialization. (John Marriott)
3b814af7e1

vim-patch:8.2.3014: Coverity warns for freeing static string

Problem:    Coverity warns for freeing static string.
Solution:   Do not assign static string to pointer. (Dominique Pellé,
            closes vim/vim#8397)
6e9695525e

vim-patch:8.2.3205: Coverity reports a null pointer dereference

Problem:    Coverity reports a null pointer dereference.
Solution:   Change the logic to avoid Coverity gets confused.
1b862c466b

vim-patch:8.2.3294: Lua: memory leak when adding dict item fails

Problem:    Lua: memory leak when adding dict item fails.
Solution:   Free the typval and the dict item.
1b6acf02b7

vim-patch:8.2.3302: Coverity is not run from github

Problem:    Coverity is not run from github.
Solution:   Add a coverity script. (James McCoy, closes vim/vim#8714)
d57a6bd98c

vim-patch:8.2.3319: Coverity action on github does not work

Problem:    Coverity action on github does not work.
Solution:   Remove undefined $SRCDIR. (James McCoy, closes vim/vim#8739)
eed9616120

* vim-patch:8.2.1085: Coverity complains about ignoring dict_add() return value

Problem:    Coverity complains about ignoring dict_add() return value.
Solution:   Add (void).
6d90c61c5a
2021-10-09 16:40:11 -07:00
5940a3415b vim-patch:8.2.3490: superfluous return statements #15978
Problem:    Superfluous return statements.
Solution:   Remove superfluous return statements from void functions.
            (closes vim/vim#8977)
3826c0513b
2021-10-09 16:38:50 -07:00
0fc8597f01 refactor: format header files with uncrustify #15877
* refactor: format header files with uncrustify
* fixup(justin): skip formatting of terminfo_defs.h
* fixup: force winsock2 to be included first
* fixup: simplify disable/enable directive to "uncrustify:off/on"
2021-10-09 05:20:16 -07:00
a36c6e5df9 fix(checkhealth): duplicate checks if module name has "-" #15935
Problem:    Some plugins have structure `lua/nvim-someplugin/..`
            Since `-` is not allowed in vim function names, healthcheck names in
            lua and in vim can not have the same name (typically vim will use `_`
            instead of `-`).
Solution:   Normalize the names before checking for duplicates.
2021-10-08 17:36:35 -07:00
f620008e59 ci: disable commit-lint on draft PRs #15958 2021-10-08 17:08:47 -07:00
2f50c7b5a3 ci(squash_typos.py): credit authors #15967 2021-10-08 16:37:45 -07:00
1e876bd9a8 fix(mpack): clang warning: unused variable #15968 2021-10-08 16:05:26 -07:00
4f4dbfe81c fix(lsp): update tests using 0.5.0 handler calls (#15969)
Fixes test regression introduced in https://github.com/neovim/neovim/pull/15262
2021-10-08 14:01:55 -07:00
fcc11d5942 fix(lsp): add textDocument/prepareRename to capability map (#15961)
This is a simple fix for #15899, as it should at least stop calling
`prepareRename` on servers that don't support renaming.

I imagine a better fix would be to inspect the actual value for, but
that requires some plumbing changes on how capabilities are evaluated
before sending requests out.

Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
2021-10-08 11:30:18 -07:00
d5dd0aa1e6 fix(diagnostic): error on invalid severity value (#15965)
Users can pass string values for severities that match with the enum
names (e.g. "Warn" or "Info") which are converted to the corresponding
numerical value in `to_severity`. Invalid strings were simply left
as-is, which caused confusing errors later on. Instead, report an
invalid severity string right up front to make the problem clear.
2021-10-08 12:28:02 -06:00
3f09732195 fix(lsp): expose ContentModified error code to callbacks (#15262) 2021-10-08 11:19:33 -07:00
5cbd0fba00 Merge pull request #15962 from bfredl/nosort
fix(buffer_updates): handle :sort of already sorted buffer
2021-10-08 18:19:18 +02:00
e9d6f7ca6c feat(lsp): utilize textEdit.range for startbyte in omnifunc (#15957)
Closes https://github.com/neovim/neovim/issues/15784
2021-10-08 08:47:59 -07:00
ef687d3218 fix(buffer_updates): handle :sort of already sorted buffer 2021-10-08 16:15:35 +02:00
93d33ed02e Merge pull request #15954 from virchau13/fix-table-validation
fix(api): check type in nlua_pop_keydict (fixes #15940)
2021-10-08 13:50:29 +02:00
6064376f6d fix(api): check type in nlua_pop_keydict (#15940) 2021-10-08 18:22:33 +08:00
7f93b2ab01 fix: support severity_sort option for show_diagnostic functions (#15948)
Support the severity_sort option for show_{line,position}_diagnostics.
2021-10-07 19:19:30 -06:00
e16adbf238 fix(provider): compare versions as number, not string #15937
"3.10" < "3.3" but v3.10 > v3.3
Fixes #14586
2021-10-07 14:27:40 -07:00
2d206d5ab2 Merge pull request #15946 from bfredl/issue-12861
fix(buffer_updates): make lockmarks not affect extmarks and buffer updates
2021-10-07 20:52:10 +02:00
fe608750a9 Merge pull request #15839 from bfredl/encgrugg
refactor(api): some cleanup
2021-10-07 20:29:53 +02:00
54b2c6800e fix(buffer_updates): cleanup test behavior 2021-10-07 20:22:10 +02:00
7d171b1c48 fix(buffer_updates): make lockmarks not affect extmarks and buffer updates. fixes #12861
Now mark_adjust() will trigger appropriate buf_updates_send_splice() called by extmark_adjust()
2021-10-07 20:21:23 +02:00
206f4429c6 Merge pull request #15945 from bfredl/emptydelete
fix(buffer_updates): handle :delete of the very last line in buffer
2021-10-07 20:13:15 +02:00
413bb6b7a4 refactor(api): cleanup modify_keymap and parse_keymap_opts 2021-10-07 19:45:30 +02:00
8335e26b2d fix(buffer_updates): handle :delete of the very last line in buffer 2021-10-07 19:35:49 +02:00
b9a35ec7a4 Merge pull request #15934 from kylo252/replacement-size
fix(lint): remove redundant ternary operator
2021-10-07 18:57:48 +02:00
684299ed4c Merge pull request #15941 from dundargoc/refactor/remove-redundant-casts
refactor: remove redundant casts
2021-10-07 18:39:27 +02:00
b55944e8af feat(diagnostic): update jumplist on goto_next/prev (#15942) 2021-10-07 08:46:17 -07:00
cbc60524f1 Merge pull request #15932 from erw7/fix-nvim-buf-set-extmark
fix(api): fix nvim_buf_set_extmark
2021-10-07 17:31:56 +02:00
7356d3cdbd Merge pull request #15316 from vigoux/ts-fix-captures
fix(treesitter): run predicates more often in iter_matches
2021-10-07 16:00:36 +02:00
6d9dea4201 refactor: remove redundant casts 2021-10-07 13:16:55 +02:00
23383451b0 fix(api): fix nvim_buf_set_extmark
Fix the problem of calling clear_virttext on undefined variables.
2021-10-07 19:03:54 +09:00
83778ce567 refactor(api): remove duplicated handle mpack encode/decode functions 2021-10-07 08:00:28 +02:00
c61a3865ee fix: set cursorlineopt=number in terminal mode (#15493)
When entering terminal mode, cursorlineopt is no longer entirely
disabled. Instead, it's set to `number`. Doing so ensures that users
using `set cursorline` combined with `set cursorlineopt=number` have
consistent highlighting of the line numbers, instead of this being
disabled when entering terminal mode.

Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2021-10-06 16:31:14 -06:00
e06936125a fix(extmarks): splice extmarks on nv_Undo #15920 2021-10-06 09:35:44 -07:00
47dd6c4f47 fix(lint): remove redundant ternary operator
The value of `new_len` will never be '0' since `replacement.size`
is checked against that early on.
2021-10-06 18:21:43 +02:00
d0c0878b3e fix(PVS/V1048): "variable was assigned the same value" #15870 2021-10-06 07:47:31 -07:00
45b9815fc1 refactor: remove superfluous function-like macros #15918
Remove following macros:
CONVERTED
HMLL_ITER_BACK
PACK_STRUCT
IGNORE_BUF
find_shada_parameter
path_try_shorten_fname
2021-10-06 06:27:27 -07:00
1034f7d7b1 vim-patch:8.2.0017: OS/2 and MS-DOS are still mentioned #15928
Problem:    OS/2 and MS-DOS are still mentioned, even though support was
            removed long ago.
Solution:   Update documentation. (Yegappan Lakshmanan, closes vim/vim#5368)
6f345a1458
2021-10-06 06:14:56 -07:00
a161559a00 fix(tui): remove dead code #15929
Before #15889, we used our fork of libuv which supports Windows 7/8.
After #15889, we use upstream libuv, which does not support Windows 7 and lacks
mouse/altbuf support for Windows 8 console.
2021-10-06 05:13:34 -07:00
0c7d7fb45d vim-patch:8.1.2379: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
217e1b8359
2021-10-06 11:50:10 +02:00
3b3e2244db vim-patch:8.1.2388: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
4ba37b5833
2021-10-06 11:50:10 +02:00
86f32dfcdd vim-patch:8.1.2368: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
c667da5185
2021-10-06 11:50:10 +02:00
b4acae2c4a vim-patch:8.1.2392: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
6e0ce171e1
2021-10-06 11:50:10 +02:00
41d3b98deb vim-patch:8.1.2394: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
63d9e730f7
2021-10-06 11:50:10 +02:00
e8f87f15d7 vim-patch:8.1.2395: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
0d6f5d9740
2021-10-06 11:50:10 +02:00
d6c789a571 vim-patch:8.1.2396: using old C style comments
Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
e38eab22c1
2021-10-06 11:49:42 +02:00
acd5e831b6 fix(checkhealth): mitigate issues with duplicate healthchecks #15919
* fix(runtime/health): mitigate issues with duplicate healthchecks
  Previously if a healthcheck was found as Lua and Vim it was executed
  both times.
  This new implementations prefers Lua, therefore if two are found It only
  runs the Lua one, this way a plugin can mantain both implementations the
  Lua one with the method `check()` and the autoload function `#check()`
  (for none HEAD nvim versions).
  **Note: This will require plugins to use `check()` as the function name,
  since the autoload function that wraps the lua implementation won't be
  called**
* docs(health): use spaces and don't overuse backtics

followup to #15259
2021-10-05 15:37:39 -07:00
6a930a9dc4 vim-patch:8.2.0155: MinGW warnings; tests without +float #15908
Problem:    Warnings from MinGW compiler. (John Marriott) Json test fails when
            building without +float feature.
Solution:   Init variables. Fix Json parsing. Skip a few tests that require
            the +float feature.
a5d5953d59

Omit vim9 changes.
vim9 internal implementation is N/A,
similar to the `vimscript-*` features.

N/A patches for version.c:

vim-patch:8.1.0737: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable.
Solution:   Add initialization. (John Marriott)
e519dfd713

vim-patch:8.1.1385: signed/unsigned compiler warning

Problem:    Signed/unsigned compiler warning.
Solution:   Use STRLEN() instead of strlen().
71de720c2c

vim-patch:8.2.0165: Coverity warning for using NULL pointer

Problem:    Coverity warning for using NULL pointer.
Solution:   Add missing "else".
5b18c248d3

vim-patch:8.2.0166: Coverity warning for using uninitialized variable

Problem:    Coverity warning for using uninitialized variable.
Solution:   Check for failure.
07da94b0f0

vim-patch:8.2.0167: Coverity warning for ignoring return value

Problem:    Coverity warning for ignoring return value.
Solution:   Check the return value and jump if failed.
58ceca5cae

"src/testdir/test_vim9*.vim" files are N/A
because vim9 code is currently unsupported.

vim-patch:8.2.0168: Coverity warning for assigning NULL to an option

Problem:    Coverity warning for assigning NULL to an option.
Solution:   Use empty string instead of NULL.
97a2af39cd

vim-patch:8.2.0169: Coverity warning for dead code

Problem:    Coverity warning for dead code.
Solution:   Check if inside try-finally.
8cbd6dfc0c

vim-patch:8.2.0170: Coverity warning for ignoring return value

Problem:    Coverity warning for ignoring return value.
Solution:   Check the return value and return if failed.
a6d536829a

vim-patch:8.2.0172: Coverity warning for not restoring character

Problem:    Coverity warning for not restoring character.
Solution:   Restore the character also in case of failure.
4549ece47c

vim-patch:8.2.0254: compiler warning for checking size_t to be negative

Problem:    Compiler warning for checking size_t to be negative.
Solution:   Only check for zero. (Zoltan Arpadffy)
ae8d2de3a9

vim-patch:8.2.0326: compiler warning for using uninitialized variable

Problem:    Compiler warning for using uninitialized variable. (Yegappan
            Lakshmanan)
Solution:   Do not jump to failed but return.
d5aec0ced1

vim-patch:8.2.3387: compiler warning for non-static function

Problem:    Compiler warning for non-static function.
Solution:   Make the function static. (Dominique Pellé, closes vim/vim#8816)
de05ae7158
2021-10-05 10:58:06 -07:00
59edd377d3 docs: regenerate #15545 2021-10-05 10:48:48 -07:00
dd7812ec66 fix(docs): add win_config.c 2021-10-05 09:56:22 -07:00
38ef66f4c1 fix(docs): duplicate tag, wrong formatting
Fixes build error:
    cd /usr/home/build/neovim/build/runtime && /usr/local/bin/cmake -E remove doc/* && /usr/local/bin/cmake -E copy_directory /usr/home/build/neovim/runtime/doc doc && /usr/home/build/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
    Error detected while processing command line:
    E154: Duplicate tag "vim.register_keystroke_callback()" in file doc/lua.txt
2021-10-05 09:45:25 -07:00
49fdc62114 feat(api): named marks set, get, delete #15346
Adds the following API functions.

- nvim_buf_set_mark(buf, name, line, col)
  * Set marks in a buffer.
- nvim_buf_del_mark(buf, name)
  * Delete a mark that belongs to buffer.
- nvim_del_mark(name)
  * Delete a global mark.
- nvim_get_mark(name)
  * Get a global mark.

Tests:

- Adds test to all the new api functions, and adds more for the existing
  nvim_buf_get_mark.
    * Tests include failure cases.

Documentation:

- Adds documentation for all the new functions, and improves the
  existing fucntion docs.
2021-10-05 08:49:20 -07:00
912a6e5a9c feat(lsp): improve json deserialization performance (#15854)
* Add optional second table argument to vim.json.decode which takes
  a table 'luanil' which can include the 'object' and/or 'array' keys. These
  options use luanil when converting NULL in json objects and arrays
  respectively. The default behavior matches the original lua-cjson.
* Remove recursive_convert_NIL function from rpc.lua, use
  vim.json.decode with luanil = { object = true } instead. This removes a hotpath
  in the json deserialization pipeline by dropping keys with json NULL
  values throughout the deserialized table.
2021-10-05 08:37:20 -07:00
f6c0a37b02 build(deps)!: use libuv 1.42.0 upstream for WIN32 (#15889)
Switch libuv from https://github.com/neovim/libuv fork to upstream for WIN32.
Upstream at 1.42.0 is now used for all platforms.

BREAKING CHANGE: removes Windows 7 support
BREAKING CHANGE: removes support for mouse and alternate buffers in TUI for
Windows 8 and 8.1
2021-10-05 17:23:42 +02:00
3b531d50a8 docs(contrib): recommend nvim --clean #15917 2021-10-05 08:01:09 -07:00
f6a9f0bfca fix(vim-patch): add missing nginx runtime files (#15916)
Followup to incomplete runtime update https://github.com/neovim/neovim/pull/15911
2021-10-05 15:19:16 +02:00
17f7c83f29 docs(intro.txt): change vimhelp.appspot.com to vimhelp.org (#15915)
Ref 6c1e1570b1 (diff-644ad027e3580bc940a6b7b4aaf1869bae267f7ff30e359e523d5de70e317106)
2021-10-05 06:49:15 -06:00
0c2a7aa5f7 vim-patch:6e649224926b (#15911)
Update runtime files
6e64922492
2021-10-05 14:12:16 +02:00
0a7a215aa6 fix(healthcheck): update builtins to the new convention #15914
Adjust some builtin healthchecks to use Lua, after #15259
2021-10-05 05:05:33 -07:00
6d8cafed40 ci: exclude lua-cjson from PVS report #15859 2021-10-05 05:02:49 -07:00
a2734efdc2 vim-patch:8.2.3473: some tcl files are not recognized #15912
Problem:    Some files with tcl syntax are not recognized.
Solution:   Add a few file patterns. (Doug Kearns)
78aa5ffe31
2021-10-05 04:21:52 -07:00
93a7571fab Merge pull request #15259 from muniter/muniter/checkhealth-from-lua
feat(checkhealth): support Lua healthchecks
2021-10-05 11:27:07 +02:00
655e489e90 docs(develop.txt): nvim_open_win is now in win_config.c (#15909) 2021-10-04 20:10:07 -06:00
8b43b07333 feat(ex_checkhealth): provide function for command line completion
Move away from providing completion with ExpandRTDir to ExpandGeneric
providing the function get_healthcheck_name which caches the results for
the current command line prompt.

It does the almost the same thing the Vim function 'get_healthcheck'
implemented in 'runtime/autoload/health.vim' does.
2021-10-04 16:51:54 -05:00
b60e6448eb Merge pull request #15813 from bfredl/neomouse
fix(mouse): correct dragged position in composed layout
2021-10-04 23:08:39 +02:00
8f2a8b50da docs(runtime/health): update with new lua support
- describe how the lua support works
- explain new behavior of :checkhealth *
- fixed formatting to use tab instead of spaces
2021-10-04 14:28:54 -05:00
c65f956015 test(runtime/health): cover lua healthchecks
- Add tests for lua healthchecks (failure, success and submodules).
- Reword some of the test naming for improved logs readability.
- Modify render test to accomodate the changes of the health autoload function.
- Add test for :checkhealth completion of Lua healtchecks.
2021-10-04 14:28:54 -05:00
9249dcdda1 feat(runtime/health): support lua healthchecks
- Refactor health.vim to discover lua healthcheck in the runtime
  directories lua/**/health{/init}.lua
- Support healthchecks for lua submodules e.g :checkhealth vim.lsp and
  also support wildcard "*" at the end for all submodules
  :checkhealth vim*
- Refactor health.vim to use variable scope instead of output capturing
- Create health.lua module to wrap report functions and future
  extensibility.
- Move away from searching just in the runtimepath, use
  `nvim_get_runtime_file` due to #15632

Example:
Plugin linter in rtp can declare it's checkhealts in lua module
`lua/linter/health{/init}.lua` that returns a table with a method
"check" that when executed calls the report functions provided by the
builtin lua module require("health").

The plugin also has a submodule `/lua/linter/providers` in which it
defines `/lua/linter/providers/health{/init}.lua`

This plugin healthcheck can now be run by the ex command:
  `:checkhealth linter linter.providers`

Also calling all submodules can be done by:
  `:checkhealth linter*

And "linter" and "linter.provider" would be discovered when:
  `:checkhealth`
2021-10-04 14:28:54 -05:00
83fa8956c3 docs: fix typo 2021-10-04 13:09:32 -06:00
810da1a702 fix(mouse): correct dragged position in composed layout 2021-10-04 21:00:42 +02:00
253a012469 Merge pull request #15901 from bfredl/apiorg
refactor(api): re-organanize public and private API functions
2021-10-04 20:06:41 +02:00
22e4a2a286 refactor(api): move window config related functions to own file 2021-10-04 19:23:00 +02:00
c4d581deae refactor: inline unnecessary macros #15890 2021-10-04 08:35:18 -07:00
c7a63f35db feat(startup): load builtin plugins with --clean #15893
Closes #15605
2021-10-04 07:01:49 -07:00
44f7b46199 refactor: remove redundant char casts #15888 2021-10-04 06:40:43 -07:00
b4c54ffa22 Merge pull request #15894 from gpanders/hardcode-diagnostic-highlights
refactor: define diagnostic highlights in syntax.c
2021-10-04 10:52:05 +02:00
088026205f refactor: define diagnostic highlights in syntax.c 2021-10-03 20:06:06 -06:00
8a9f292991 Merge #15218 from gpanders/split-trimempty
feat(lua): add "noempty" param to vim.split()
2021-10-03 17:33:12 -07:00
a0bf28cd54 vim-patch:8.2.3469: some files with json syntax are not recognized (#15891)
Problem:    Some files with json syntax are not recognized.
Solution:   Add a few file patterns. (Emiliano Ruiz Carletti, closes vim/vim#8947)
50c5689342
2021-10-03 16:50:51 -06:00
a8504638cd feat(eval/method): partially port v8.1.1987
Cannot be fully ported as the remote_*() functions from +clientserver
are not yet ported. Include the test changes anyway.

line()'s optional winid argument was already ported. (Wasn't added in
this patch; this just adds documentation)
2021-10-03 20:12:20 +01:00
c5583df3c0 vim-patch:8.1.1984: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
3f4f3d8e7e

test_prompt_buffer.vim already had all the changes, except
Test_prompt_garbage_collect().
2021-10-03 20:12:20 +01:00
d23d37b212 vim-patch:8.1.1961: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.  Add a test for
            mapcheck().
a144983633

mzeval() (if_mzscheme) is N/A.
2021-10-03 20:12:20 +01:00
86593beaa4 feat(eval/method): partially port v8.1.1954
Does not include listener_*() functions.

js_*() functions are N/A.

json_encode() and json_decode() didn't include tests; add some anyway
(to json_functions_spec.lua).

test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
2021-10-03 20:06:33 +01:00
59c8a1fd51 feat(eval/method): partially port v8.1.1953
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- index(): requires Blobs from v8.1.0735.
           Note that index() was already added as a method in v8.1.1803;
           this patch only adds a test.

- iconv(): requires v8.1.1136 for test_termcodes.vim.

Nvim deprecated inputdialog(), so it no longer has an eval.txt entry.

Keep the test for hlexists() commented-out, just like previously. (Nvim
always defines the Number group, so it always returns 1 instead)

Cannot include both changes to test_syn_attr.vim as Nvim doesn't support
":hi term=..."; however, both test the same ->hlID() syntax anyway.
2021-10-03 20:06:32 +01:00
8b7615c735 vim-patch:8.1.1952: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Allow more functions to be used as a method.
5d69fdb7c4
2021-10-03 20:06:32 +01:00
3137c7d635 feat(eval/method): partially port v8.1.1925
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291.

Note that the method call tests for getreg() and getregtype() were
removed in v8.2.1547, which has already been ported, but doesn't seem to
have been replaced with a new test...

This patch also makes getchangelist()'s argument optional (defaults to
the current buffer).

eval.txt includes a typo for gettabwinvar(), which is fixed in
v8.1.1952.
2021-10-03 20:06:32 +01:00
6110480c29 feat(eval/method): partially port v8.1.1921
Adds method call support for all functions in the patch, but it cannot
be fully ported due to missing tests for:

- filereadable(): requires v8.1.1378 for Test_delete_rf(), but there
                  appears to have been some trouble porting it. (#12784)

- confirm(): requires v8.1.0832 for Test_confirm() and v8.1.0815 for
             feedkeys()'s "L" flag.

             (I did attempt to port the test using nvim_input() instead,
             but seems that input handling for confirm() doesn't work in
             --headless mode?)

             Note that confirm() was actually added as a method in
             v8.1.1915.

Uncomment use of method call syntax in Test_Executable() previously
included instead from v8.2.2259.
2021-10-03 20:06:31 +01:00
0193b3a391 vim-patch:8.1.1336: some eval functionality is not covered by tests
Problem:    Some eval functionality is not covered by tests.
Solution:   Add a few more test cases. (Masato Nishihata, closes vim/vim#4374)
17aca707f9

Test_expand() changes are required for v8.1.1921.
Test_call() and Test_cindent_func() are already ported.
2021-10-03 20:06:31 +01:00
7ba11e06c0 vim-patch:8.2.3466: completion submode not indicated for virtual replace (#15886)
Problem:    Completion submode not indicated for virtual replace.
Solution:   Add submode to "Rv". (closes vim/vim#8945)
cc8cd44533
2021-10-03 15:04:51 -04:00
04b59ebd85 vim-patch:8.2.3465: cannot detect insert scroll mode (#15885)
Problem:    Cannot detect insert scroll mode.
Solution:   Add "scroll" to complete_info(). (closes vim/vim#8943)
27fef59dd1
2021-10-03 14:53:58 -04:00
310d53e5d0 refactor(api): make export of functions opt-in, not opt-out 2021-10-03 16:14:47 +02:00
3beea1fe1b Merge pull request #15516 from bfredl/keyset
refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
2021-10-03 14:31:53 +02:00
9fe704f88e vim-patch:8.2.3464: nginx files are not recognized (#15883)
Problem:    nginx files are not recognized.
Solution:   Add several file patterns. (Chris Aumann, closes vim/vim#8922)
8b8c0ed657
2021-10-03 13:40:59 +02:00
32565922ef refactor(api): handle option dicts properly
Do not copy a lot of lua strings (dict keys) to just strequal() them
Just compare them directly to a dedicated hash function.

feat(generators): HASHY McHASHFACE
2021-10-03 10:46:57 +02:00
23d13aa4cc Merge pull request #15786 from gpanders/diagnostic-signs-unique-severity 2021-10-02 21:01:40 -06:00
0f554ef6f8 refactor(diagnostics): always make 'set' go through 'show'
Always make calls to `vim.diagnostic.set` call `vim.diagnostic.show`.
This creates an easier to reason about code path and is also less
surprising when users wish to override override `vim.diagnostic.show`
with custom behavior and `vim.diagnostic.set` is called with empty
diagnostics.

Functionally, the end result is the same: when `show` is called with an
empty diagnostics list, it just calls `hide` and then returns, which is
exactly what `reset` does right now.
2021-10-02 20:37:09 -06:00
1124439954 docs(diagnostic): add blurb on how to replace builtin handlers 2021-10-02 20:37:09 -06:00
c319c800cf test(diagnostic): add test case for signs 2021-10-02 20:37:09 -06:00
0c06da1f0a fix(nvim_open_win): crash if autocmds delete buffer/window #15549
win_set_buf can trigger autocmds if noautocmd=false. If they close the window,
code afterwards will dereference the freed win_T* wp pointer.

This interaction became possible after commit 1def3d1542.

The reason deleting curbuf crashes, and not the buf passed to
`nvim_open_win`, is because the float initially edits curbuf (`win_init`)
until it's later set to edit buf (windows from `:new` and `:split <buf>`
behave similiarly: approx. `:split`, then `:buffer <buf>`).

`do_buffer` closes windows when their edited buffer is deleted (unless
it's the only window; N/A for floats), so the float closes when curbuf
is deleted, so we need to check `win_valid` after `win_set_buf` too.

Closes #15548
2021-10-02 19:10:59 -07:00
ad1c42a97d vim-patch:8.2.3460: some type casts are not needed #15868
Problem:    Some type casts are not needed.
Solution:   Remove unnecessary type casts. (closes vim/vim#8934)
dfa5e464d4
2021-10-02 18:04:21 -07:00
4449297d12 docs(lsp): clarify parameters of some util functions (#15851)
`pad_left` and `pad_right` are unused
List used keys of `opts` in `make_floating_popup_options`
2021-10-02 17:55:54 -07:00
b3e815094b fix(float)!: always anchor to corner of window including border #15832
N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the
window (including border). This line may also need change in this case (change
0 to -1):

This is most consistent and easiest to reason about, especially with GUIs whose
border do not need to have width/height of 1/1 in cell units.

Fix #15789
2021-10-02 17:36:24 -07:00
c5e8c39102 Merge #15803 fix(lsp_spec): tests depend on previous session 2021-10-02 16:50:20 -07:00
8c74c895b3 refactor: format with uncrustify #15872
* refactor: format with uncrustify
* refactor: fix function parameter comments
2021-10-02 14:41:50 -07:00
09307e64df fix(docs): uncrustify.cfg location #15817 2021-10-02 14:32:18 -07:00
ac973d5532 docs: remove obsolete text on language #15875 2021-10-02 14:30:13 -07:00
c4857b695f fix(input): resolve isolated (non-ALT/META) mappings #13109
Problem:
Since 2f06413dfb #13042, "ESC+c" sequence is treated as "ESC c"
instead of "M-c" (ALT/META+c) when not mapped, aka "fallthrough"
behavior. But "isolated" (non-ALT/META) mappings to ESC and c were not
resolved. This behavior is especially confusing for the TUI.

Solution:
Resolve isolated ESC, c mappings when there is no M-c mapping.
Change ins_char_typebuf() to escape CSI, K_SPECIAL.

fixes #13086
fixes #15869
2021-10-02 14:27:37 -07:00
79fb9ed080 Merge pull request #15867 from bfredl/starpack
fix(runtime): add compressed {&packpath}/start/*/pack/*[/after] representation to &rtp

by suggestion by at-tpope

Summary:

We can add XDG_DATA_DIR/nvim/site/pack/*/start/* (et al) as an unexpanded wildchar to &rtp which keeps it both short and explicit and still supporting globpath(&rtp, ...).

ref #15101
2021-10-02 17:47:55 +02:00
069d1de184 fix(lsp_spec): tests depended on previous session
- fix tests which accidentally depended on previous session
2021-10-02 08:26:57 -07:00
c74a706869 fix(release.sh): ignore failed "rm" 2021-10-02 08:26:57 -07:00
9c268263b1 refactor: format with uncrustify #15842
* refactor: format with uncrustify
* refactor: convert function comments to doxygen
2021-10-02 07:59:41 -07:00
9df7e022b4 fix(runtime): add packages as "/pack/*/start/*" patterns to &rtp
This makes `globpath(&rtp, ...)` work again for start packages
2021-10-02 16:45:19 +02:00
898f91f0f3 refactor: convert char_u to char #15824 2021-10-02 06:53:48 -07:00
a3b5b4a31e feat(vim-patch.sh): better detection of remote name #15846 2021-10-02 06:15:01 -07:00
724ffe7095 feat(diagnostics): add vim.diagnostic.get_namespaces (#15866)
Many vim.diagnostic functions expect the user to pass in a namespace id.

This PR allows the user to list active diagnostic namespaces:

```lua
:lua print(vim.inspect(vim.diagnostic.get_namespaces()))

{
  [7] = {
    name = "vim.lsp.client-1",
    opts = {},
    sign_group = "vim.diagnostic.vim.lsp.client-1"
  }
}
```
2021-10-01 22:50:28 -07:00
36408146ad docs(diagnostics): add "priority" option to signs table (#15860)
This feature was added in #15785, but the docs for
vim.diagnostic.config() weren't updated.
2021-10-01 19:07:55 -06:00
dc4670038e Merge pull request #15864 from jamessan/gitattributes
fix: include ci/ in exported tarball
2021-10-01 19:55:01 -04:00
a940952fe2 Merge pull request #15861 from dundargoc/refactor/xdiff
refactor: update path to xdiff in comments
2021-10-01 17:53:27 -04:00
1efbd4980f Merge pull request #15862 from dundargoc/refactor/xdiff-pvs
refactor: remove PVS comment on top of files
2021-10-01 17:52:50 -04:00
d9b3e41a63 Merge pull request #15863 from dundargoc/docs/contributing/commit-message
docs: update preferred commit message style for the static analyzer PRs
2021-10-01 17:52:13 -04:00
38b0306591 docs: update preferred commit message style for the static analyzer PRs 2021-10-01 21:22:32 +02:00
3134ef3d9f refactor: remove PVS comment on top of files
The xdiff directory is excluded from the PVS report so the comment isn't
required.
2021-10-01 21:08:53 +02:00
19ab0f22cc refactor: update path to xdiff in comments 2021-10-01 21:07:02 +02:00
458f2aad5c fix(treesitter): run predicates more often in iter_matches
Superseedes #15126, and fixes the issue.
2021-10-01 09:20:35 +02:00
9337fff8aa Merge pull request #15852 from bfredl/afteragain
fix(runtime): fix ordering of "after" packages
2021-09-30 22:32:02 +02:00
251ce9ddd1 fix(runtime): fix ordering of "after" packages
they must come after ordinary runtime dirs which are not "after"
2021-09-30 22:03:18 +02:00
7152353ade ci: add type and scope from PR title as labels #15850
This only works if the label exists in the first place of course.
2021-09-30 08:08:36 -07:00
270cc1d70f Merge pull request #14937 from dstein64/vim-8.1.2304
vim-patch:8.1.2304,8.1.2309,8.1.2319,8.1.2321
2021-09-29 20:59:53 -04:00
d90fb1c0bf Refactor/uncrustify (#15790)
* refactor: format with uncrustify

* fixup(dundar): fix functions comments

* fixup(dundar): remove space between variable and ++/--

* fixup(dundar): better workaround for macro attributes

This is done to be able to better use uncrustify rules for macros

* fixup(justin): make preprocessors follow neovim style guide
2021-09-29 19:48:50 +02:00
88442c2fa6 docs: add 'plus one' to correct getmousepos docs
This change was applied to Vim as part of 90df4b9.
90df4b9d42
2021-09-29 11:13:49 -04:00
096309037b chore: remove empty line
This update was part of vim-patch:4c29502.
4c295027a4
The other parts of that patch were applied to Neovim in ad6bb38.
2021-09-29 11:13:49 -04:00
ae97f25e9d test: add a test for getmousepos() 2021-09-29 11:13:49 -04:00
c423ee584a vim-patch:8.1.2321: cannot select all text with the mouse
Problem: Cannot select all text with the mouse. (John Marriott)
Solution: Move limiting the mouse column to f_getmousepos().
          (closes https://github.com/vim/vim/issues/5242)
0a5aa7b28a
2021-09-29 11:13:49 -04:00
037ec8f208 vim-patch:8.1.2319: compiler warning for int size
Problem: Compiler warning for int size.
Solution: Add typecast. (Mike Williams)
07a63d8633
2021-09-29 11:13:49 -04:00
95bf86c2bf vim-patch:8.1.2309: compiler warning for argument type
Problem: Compiler warning for argument type.
Solution: Use linenr_T and cast to varnumber_T. (John Marriott)
abe12a1a4f
2021-09-29 11:13:49 -04:00
3b9e75b366 vim-patch:8.1.2304: cannot get the mouse position when getting a mouse click
Problem:    Cannot get the mouse position when getting a mouse click.
Solution:   Add getmousepos().
db3a205147
2021-09-29 11:13:49 -04:00
ec4731d982 feat(lsp): add codeAction/resolve support (#15818)
Closes https://github.com/neovim/neovim/issues/15339 and https://github.com/neovim/neovim/issues/15828
2021-09-28 14:04:01 -07:00
3507d58dfb Merge pull request #15812 from bfredl/taba
fix(runtime): make a copy of runtime_search_path when iterating
2021-09-28 19:12:39 +02:00
19a77cd5a7 feat(lsp): add client command support to codelens (#15820)
Also adds a check against the server capabilities to fix
https://github.com/neovim/neovim/issues/15183
2021-09-28 09:19:19 -07:00
ff18a8bcc4 refactor(lsp): remove json encode/decode wrappers (#15826) 2021-09-28 09:13:44 -07:00
9ca7b6b71a fix(ui): s/format_entry/format_item to match docs (#15819)
Follow up to https://github.com/neovim/neovim/pull/15771
2021-09-27 16:12:03 -07:00
63fde086d9 feat(ui): add vim.ui.select and use in code actions (#15771)
Continuation of https://github.com/neovim/neovim/pull/15202

A plugin like telescope could override it with a fancy implementation
and then users would get the telescope-ui within each plugin that
utilizes the vim.ui.select function.

There are some plugins which override the `textDocument/codeAction`
handler solely to provide a different UI. With custom client commands and
soon codeAction resolve support, it becomes more difficult to implement
the handler right - so having a dedicated way to override the picking
function will be useful.
2021-09-27 21:57:28 +02:00
a0ec8597e3 fix(runtime): make a copy of runtime_search_path when iterating
This is to prevent concurrent modification, just like save_rtp
in the vim 8 implementation
2021-09-27 21:17:53 +02:00
6736ee8be5 chore: remove unused script finddeclarations.pl #15814 2021-09-27 09:02:42 -07:00
96614f84ab fix(lsp): avoid serializing boolean as key (#15810)
In vim.lsp.buf.references, the key vim.type_idx (which evaluates to a
boolean) was set to equal vim.types.dictionary. This resulted in a
boolean key in json which is not allowed by the json spec, and which
lua-cjson fails to serialize.
2021-09-27 00:32:30 -07:00
bec7f47cee docs: document dependencies in MAINTAIN.md #15801
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2021-09-26 17:24:20 -07:00
187e3a3b7e refactor(diagnostic): use sign priority for severity_sort #15785
Rather than relying on the order in which signs are placed to dictate
the order in which they are displayed, explicitly set the priority of
the sign according to the severity of the diagnostic and the value of
severity_sort. If severity_sort is false or unset then all signs use the
same priority.
2021-09-26 16:02:18 -07:00
cb51a1b615 docs: add lua-cjson to third-party licenses #15800 2021-09-26 14:57:57 -07:00
73280a7987 feat(lsp): allow subset of CodeActionContext as arg to code_action methods (#15793)
This makes it easier to filter the code actions. For example:

    vim.lsp.buf.code_action { only = 'refactor' }
2021-09-26 23:40:28 +02:00
c217766f7c feat(lsp): use cjson for lsp rpc (#15759) 2021-09-26 22:53:04 +02:00
68c65b7732 Merge pull request #14871 from mjlbach/feature/lua-cjson-embedded
feat(lua): expose lua-cjson as vim.json
2021-09-26 12:23:46 -07:00
3246bf5f4e ci(lintcommit.lua): replace third-party commitlint #15747 2021-09-26 12:13:59 -07:00
9c31f3b026 test: add tests for vim.json 2021-09-26 11:52:17 -07:00
9686c21237 Merge pull request #15797 from smolck/ui-stuff
fix(ui_bridge): set bridge width and height on attach
2021-09-26 20:16:39 +02:00
08ee03cb16 fix(ui_bridge): set bridge width and height on attach 2021-09-26 11:00:40 -05:00
44145847dc fix(tui): remove obsolete $NVIM detection #15791
Initially, we planned to set the NVIM environment variable to detect that
neovim is running in the neovim built-in terminal. At the time this code
was written, there was no way for a parent to set environment variables
for a program running in an embedded terminal. Later it was implemented in
 #12937, but the code to set the NVIM was not added. #11390 now uses ConPTY
instead of winpty when possible, so it is no longer necessary to force the
use of win32con even when running inside an embedded terminal. Therefore,
we now do not need this code.
2021-09-26 08:27:18 -07:00
d4fa1649fb Merge pull request #15351 from bfredl/virt_line
feat(screen): virtual lines
2021-09-26 16:56:19 +02:00
c273eb3100 refactor: replace sprintf with snprintf #15794 2021-09-26 07:53:51 -07:00
68d6ff8802 Merge pull request #15721 from bfredl/electricboogalo
fix(runtime): some ordering issues (and start work on cache mechanism)
2021-09-26 16:20:23 +02:00
ac3288d556 fix(runtime): ordering of loading packages with user config
site packages must be sourced before user config

NOTE: we only consider dirs exactly matching "after" to be an AFTER dir.
vim8 considers all dirs like "foo/bar_after", "Xafter" etc, as an
"after" dir in SOME codepaths not not in ALL codepaths.
2021-09-26 15:44:40 +02:00
392c658d4d feat(decorations): support virtual lines (for now: only one block at a time) 2021-09-26 12:19:54 +02:00
30fed27241 feat(lua): expose lua-cjson as vim.json
* add vim.json.encode and vim.json.decode
* use vim.NIL instead of cjson.null
* resolve strict-prototypes warnings

* The following benchmark shows an approximately 2.5x (750 ms vs 300 ms) improvement in deserialization performance over
  vim.fn.json_decode on a medium package.json

  ```lua
  local uv = vim.loop
  local function readfile(path)
    return
  end

  local json_url = "https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/b24c8d5c89ee93d1172b4127564f5da3b0c88dad/editors/code/package.json"
  io.popen(string.format('curl -v -f -L -O %q &> /dev/null', json_url))

  local json_string = io.open('package.json'):read '*a'

  uv.update_time()
  local start = uv.hrtime()

  for i = 1,1000 do
    vim.fn.json_decode(json_string)
  end

  uv.update_time()
  print(string.format("Deserialization time vim.fn.json_decode: %s ms", (uv.hrtime() - start) * (1e-6)))

  uv.update_time()
  local start = uv.hrtime()

  for i = 1,1000 do
    vim.json.decode(json_string)
  end
  uv.update_time()
  print(string.format("Deserialization time vim.json.decode: %s ms", (uv.hrtime() - start) * (1e-6)))
  ```

Co-Authored-By: Björn Linse <bjorn.linse@gmail.com>
2021-09-26 00:35:55 -07:00
8decc9f52d feat(lua): add lua-cjson as vendored dependency
Derived from the openresty lua-cjson fork at commit 3d93d29709
2021-09-26 00:35:47 -07:00
84f66909e4 refactor: use kwargs parameter in vim.split 2021-09-25 20:11:32 -06:00
5fa26e2c2f feat: add trimempty optional parameter to vim.split
The `split()` VimL function trims empty items from the returned list by
default, so that, e.g.

  split("\nhello\nworld\n\n", "\n")

returns

  ["hello", "world"]

The Lua implementation of vim.split does not do this. For example,

  vim.split("\nhello\nworld\n\n", "\n")

returns

  {'', 'hello', 'world', '', ''}

Add an optional parameter to the vim.split function that, when true,
trims these empty elements from the front and back of the returned
table. This is only possible for vim.split and not vim.gsplit; because
vim.gsplit is an iterator, there is no way for it to know if the current
item is the last non-empty item.

Note that in order to preserve backward compatibility, the parameter for
the Lua vim.split function is `trimempty`, while the VimL function uses
`keepempty` (i.e. they are opposites). This means there is a disconnect
between these two functions that may surprise users.
2021-09-25 20:11:30 -06:00
b3b02eb529 docs(CONTRIBUTING.md): how to use uncrustify #15780
close #15780
2021-09-25 18:38:51 -07:00
8b0e6cc05d fix(api): fix crash after set_option_value_for() #15390
Problem:
This crashes Nvim:
    tabedit
    call nvim_win_set_option(1000, 'statusline', 'status')
    split
    wincmd J
    wincmd j

Solution:
- Change `no_display` parameter value to be the same as in matching
  `restore_win_noblock` call. In case of different values `topframe`
  isn't restored to `curtab->tp_topframe`.
- Call `restore_win_noblock` if `switch_win_noblock` returns `FAIL`
  (`switch_win` must always have matching `restore_win`)
- Change `switch_win`/`restore_win` to `_noblock` versions to allow
  autocommands.

fixes #14097
fixes #13577
2021-09-25 17:48:06 -07:00
2f9b9e61d7 refactor: format with uncrustify #15778
* fixup: force exactly one whitespace between type and variable
2021-09-25 17:16:04 -07:00
05d685be52 Merge pull request #15776 from jamessan/macos-11-ci
Add macos-11 CI
2021-09-25 09:43:57 -04:00
7cb34a341d test(normal): CA_COMMAND_BUSY in visual select mode #15292
Fix was already applied in 5f144efefa #15688,
but this commit adds another dimension to the test.

Test correctly fails after reverting 5f144efefa.

ref #15288
2021-09-24 09:59:36 -07:00
64a5eddc89 ci: use runner, instead of os, for job name and cache key 2021-09-24 09:01:50 -04:00
e0cf32c6de ci: add macOS 11 build 2021-09-24 09:01:30 -04:00
bc570b0064 Merge #15774 fix(pvs): fix warnings, script 2021-09-24 05:13:55 -07:00
55d1e630b4 Merge #15731 vim-patch:7.4.725,8.2.{0597,0598,0924,1035}
fixes #14581
2021-09-24 05:11:19 -07:00
7a26eb8a56 refactor: format with uncrustify #15755 2021-09-24 05:03:15 -07:00
03ed72642d fix(pvs): Exclude xdiff from analysis
ref 088161a945
ref fbe88ef8f5
2021-09-24 03:26:31 -07:00
508fcdadb7 fix(PVS): disable "typo" warnings V1051, V1074
PVS is worried about typos. Now we need it to stop worrying...
Disable these checks entirely, they are all false positives.

tui.c:1873        V1074   Boundary between escape sequence and string is unclear. The escape sequence ends with a letter and the next character is also a letter. Check for typos.
tui.c:1983        V1074   Boundary between escape sequence and string is unclear. The escape sequence ends with a letter and the next character is also a letter. Check for typos.

regexp_nfa.c:6189 V1051   Consider checking for misprints. It's possible that the 'pim->result' should be checked here.
screen.c:2928     V1051   Consider checking for misprints. It's possible that the 'vcol_sbr' should be checked here.
screen.c:3187     V1051   Consider checking for misprints. It's possible that the 'line_attr' should be checked here.
screen.c:3267     V1051   Consider checking for misprints. It's possible that the 'multi_attr' should be checked here.
screen.c:4747     V1051   Consider checking for misprints. It's possible that the 'redraw_next' should be checked here.
syntax.c:3448     V1051   Consider checking for misprints. It's possible that the 'arg_end' should be checked here.
syntax.c:3625     V1051   Consider checking for misprints. It's possible that the 'arg_end' should be checked here.
tui.c:1836        V1051   Consider checking for misprints. It's possible that the 'data->unibi_ext.set_cursor_style' should be checked here.
tui.c:1863        V1051   Consider checking for misprints. It's possible that the 'data->unibi_ext.set_cursor_style' should be checked here.
tui.c:1882        V1051   Consider checking for misprints. It's possible that the 'data->unibi_ext.set_cursor_style' should be checked here.
2021-09-24 03:22:26 -07:00
3c7cef7b08 fix(PVS V681): function call order is undefined
https://pvs-studio.com/en/docs/warnings/v681/
2021-09-24 02:49:59 -07:00
fefd1652e7 fix(PVS V576): false positive
`lower`, `upper` are `varnumber_T`, correctly matched to `PRIdVARNUMBER`
format.
2021-09-24 02:43:37 -07:00
0d59c01a64 fix(PVS V576): wrong fprintf() format
https://pvs-studio.com/en/docs/warnings/v576/

Before 1bffe66508 this was originally
"%ld" but that looks like a mistake. At least now, w_height_inner and
w_width_inner are just `int`.
2021-09-24 02:29:49 -07:00
d15defeb2f fix(PVS V507): false positive
https://pvs-studio.com/en/docs/warnings/v507/

"Pointer to local array 'sourcing_name_buf' is stored outside the scope
of this array. Such a pointer will become invalid."

False positive: `sourcing_name = save_sourcing_name` before returning
from this scope.
2021-09-24 02:09:52 -07:00
433bda405e fix(lsp): guard textDocument/codeAction command logic #15769
Problem:

    Error executing vim.schedule lua callback: ...ovim/HEAD-aba3979/share/nvim/runtime/lua/vim/lsp/buf.lua:502: command: expected string, got
     nil
    stack traceback:
            ...ovim/HEAD-aba3979/share/nvim/runtime/lua/vim/lsp/buf.lua:502: in function 'execute_command'
            ...HEAD-aba3979/share/nvim/runtime/lua/vim/lsp/handlers.lua:151: in function <...HEAD-aba3979/share/nvim/runtime/lua/vim/lsp/handlers.lua:113>
            ...ovim/HEAD-aba3979/share/nvim/runtime/lua/vim/lsp/buf.lua:465: in function 'callback'
            ...r/neovim/HEAD-aba3979/share/nvim/runtime/lua/vim/lsp.lua:1325: in function 'handler'
            ...r/neovim/HEAD-aba3979/share/nvim/runtime/lua/vim/lsp.lua:899: in function 'cb'
            vim.lua:281: in function <vim.lua:281>


Solution:

This is a follow-up to the work done in
6c03601e3a.
There are valid situations where a `textDocument/codeAction` is returned
without a command, since a command in optional. For example from Metals,
the Scala language server when you get a code action to add a missing
import, it looks like this:

```json
Result: [
  {
    "title": "Import \u0027Instant\u0027 from package \u0027java.time\u0027",
    "kind": "quickfix",
    "diagnostics": [
      {
        "range": {
          "start": {
            "line": 6,
            "character": 10
          },
          "end": {
            "line": 6,
            "character": 17
          }
        },
        "severity": 1,
        "source": "bloop",
        "message": "not found: value Instant"
      }
    ],
    "edit": {
      "changes": {
        "file:///Users/ckipp/Documents/scala-workspace/sanity/src/main/scala/Thing.scala": [
          {
            "range": {
              "start": {
                "line": 6,
                "character": 10
              },
              "end": {
                "line": 6,
                "character": 17
              }
            },
            "newText": "Instant"
          },
          {
            "range": {
              "start": {
                "line": 1,
                "character": 0
              },
              "end": {
                "line": 1,
                "character": 0
              }
            },
            "newText": "\nimport java.time.Instant\n"
          }
        ]
      }
    }
  }
]
```

This change just wraps the logic that grabs the command in a conditional
to skip it if there is no command.
2021-09-23 18:20:10 -07:00
be93821647 fix: move contrib/uncrustify.cfg -> src/uncrustify.cfg #15768
If uncrustify is now the (partial) authority on code style, it is no
longer "contrib".
2021-09-23 14:56:58 -07:00
9cde1e5891 fix(diagnostic): check for nil in show_diagnostics (#15772) 2021-09-23 09:52:21 -07:00
057606e845 fix(diagnostic): don't return nil when callers expect a table (#15765)
diagnostic_lines() returns a table, so make the early exit condition an
empty table rather than 'nil'. This way, functions that use the input
from diagnostic_lines don't have to do a bunch of defensive nil checking
and can always assume they're operating on a table.
2021-09-23 08:23:57 -07:00
abf13258cf Merge #14979 doc: convert Nvim style guide XML to vim :help 2021-09-23 07:02:43 -07:00
c05b10748c doc(dev_style.txt): misc updates 2021-09-23 06:59:30 -07:00
5f49d0efee doc: convert neovim style guide to vim doc. 2021-09-23 06:59:30 -07:00
f1bf70c2f9 vim-patch:8.2.1035: setreg() does not always clear the register
Problem:    setreg() does not always clear the register.
Solution:   Clear the register if the dict argument is empty. (Andy Massimino,
            closes vim/vim#3370)
7633fe595e

Do not getdigits for block_len strictly. For example, a user could
previously abort Nvim using:

:call setreg("0", "abort!", "\<C-V>999999999999999999")

or, after v8.2.0924's port:

:call setreg("0", #{regcontents: ["abort!"],
                  \ regtype: "\<C-V>999999999999999999"})

Instead, default to 0 so block_len is -1, which acts like the selection
width was omitted (defaults to length of longest line).
2021-09-23 02:07:21 +01:00
f8241f825a vim-patch:7.4.725
Problem:    ":call setreg('"', [])" reports an internal error.
Solution:   Make the register empty. (Yasuhiro Matsumoto)
659c94d483

Required for v8.2.1035.

Note that setreg('"', []) didn't cause an internal error for us, but
didn't clear the register properly either...
2021-09-23 02:04:16 +01:00
f9779facca vim-patch:8.2.0924: cannot save and restore a register properly
Problem:    Cannot save and restore a register properly.
Solution:   Add getreginfo() and make setreg() accept a dictionary. (Andy
            Massimino, closes vim/vim#3370)
bb861e293e

Cherry-pick eval.txt changes for getreginfo() from:
6aa57295cf
207f009326
2021-09-23 02:04:11 +01:00
74ddd14241 vim-patch:8.2.0598: test_eval_stuff fails in normal terminal
Problem:    Test_eval_stuff fails in normal terminal.
Solution:   Close the new window.
61fbb3371e

Required for v8.2.0598 to work.
2021-09-22 23:53:13 +01:00
3b2be8f3de vim-patch:8.2.0597: test_eval is old style
Problem:    Test_eval is old style.
Solution:   Change some tests to a new style test.
90455cfa87

Cherry-pick Test_setreg_basic changes from v8.2.0610.

Note that the old-style version of the tests (and the cherry-picked
changes) exist in legacy/eval_spec.lua; keep them as they've already
been Lua'd.

Required for v8.2.0924.
2021-09-22 23:53:13 +01:00
aba397991b build(deps): bump luarocks to 3.7.0 #15740
Besides bugfixes, this brings `XDG_*` compliance and improved
robustness, especially for network errors.

See https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md

- fixup: set LIBUV_LIBDIR to workaround 83126ba324
    - https://github.com/luarocks/luarocks/issues/1214
    - https://github.com/luarocks/luarocks/pull/1355
2021-09-22 12:26:01 -07:00
d999c96cf3 feat(diagnostic): allow customized diagnostic messages (#15742)
Provide a 'format' option for virtual text and floating window previews
that allows the displayed text of a diagnostic to be customized.
2021-09-22 12:20:15 -07:00
80e3f0eb34 Merge pull request #15739 from clason/luv-bump 2021-09-22 15:11:10 -04:00
248974a4c6 Merge pull request #14115 from mfussenegger/lsp-commands
lsp: Add a registry for client side code action commands
2021-09-22 11:42:56 -07:00
ec447b8798 docs: .git-blame-ignore-revs #15653 2021-09-22 06:36:53 -07:00
48e67b2294 refactor: format with uncrustify #15741 2021-09-22 06:25:38 -07:00
fb6f27e86f vim-patch:34cc7d8c034f #15753
Update runtime files
34cc7d8c03
2021-09-22 06:12:06 -07:00
e8fb0728e2 Merge pull request #15717 from gpanders/diagnostic-include-source
feat(diagnostic): add option to include diagnostic source
2021-09-21 18:32:32 -07:00
bc652f148f refactor(diagnostic): remove get_virt_text_chunks()
This function isn't compatible with including diagnostic sources when
"source" is "if_many" since it only has access to diagnostics for a
single line. Rather than having an inconsistent or incomplete interface,
make this function private. It is still exported as part of the module
for backward compatibility with vim.lsp.diagnostics, but it can
eventually be made into a local function.
2021-09-21 18:54:28 -06:00
d43151ea0b feat(diagnostic): add option to include diagnostic source
Add an option to virtual text display and floating window previews to
include diagnostic source in the diagnostic message.
2021-09-21 18:54:26 -06:00
17b7968f02 fix(diagnostic): preserve fields from LSP diagnostics via user_data (#15735)
* preserve fields from LSP diagnostics via adding a user_data table to the diagnostic, which can hold arbitrary data in addition to the lsp diagnostic information.
2021-09-21 15:27:12 -07:00
8164adc144 fix(lsp): update lsp-handler signature in call_hierarchy (#15738)
This fixes the handler signature and also prevents n+1 requests firing
if there are multiple clients.

(The first `prepareCallHierarchy` handler is called once per client,
each invocation used `buf_request` to make more requests using *all*
clients)
2021-09-21 15:05:49 -07:00
a65d8c34e6 ci(PVS): PVS/V009: add required header #15751 2021-09-21 09:02:43 -07:00
c76cddf3e0 fix(startup): init.lua: set $MYVIMRC to absolute path #15748
- main.c: remove os_setenv("MYVIMRC",…), it is already done by
  do_source().
  - This also sets $MYVIMRC to a full (absolute) path.
- code cleanup.
2021-09-21 08:47:46 -07:00
c208993026 Merge pull request #15745 from e-kwsm/Makefile
build: enhance Makefile
2021-09-21 08:22:08 -04:00
f446ab3aa3 fix(build): call find_package(Threads) before using its variables 2021-09-21 06:56:59 -04:00
9cbebcb247 chore(deps): bump libuv and luv to 1.42.0 2021-09-21 10:17:05 +02:00
7014731035 build: enhance Makefile
- fix regression where `-j` is not passed to ninja
  (39c886551b, #15708)
- enable to pass `-l` (load) to ninja as well
- s/BUILD_TYPE/CMAKE_GENERATOR/
2021-09-21 15:54:14 +09:00
21f7555277 Merge pull request #15743 from jamessan/libuv-threads
build: Add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
2021-09-20 21:56:49 -04:00
2435cf77d1 build: add ${CMAKE_THREAD_LIBS_INIT} to LIBUV_LIBRARIES
This is a workaround for not yet having fully correct Find* cmake
modules for static builds.

https://github.com/Tronic/cmake-modules/issues/3#issuecomment-624469020
2021-09-20 21:19:52 -04:00
6c03601e3a feat(lsp): add a registry for client side code action commands
This builds on https://github.com/neovim/neovim/pull/14112 and closes
https://github.com/neovim/neovim/issues/12326
2021-09-20 22:26:00 +02:00
187579fe19 feat(lsp): include original request params in handler ctx
This is mostly motivated by https://github.com/neovim/neovim/issues/12326

Client side commands might need to access the original request
parameters.

Currently this is already possible by using closures with
`vim.lsp.buf_request`, but the global handlers so far couldn't access
the request parameters.
2021-09-20 22:06:54 +02:00
0216aed20c fix(diagnostic): clamp line numbers in display layer (#15729)
Some parts of LSP need to use cached diagnostics as sent from the LSP
server unmodified. Rather than fixing invalid line numbers when
diagnostics are first set, fix them when they are displayed to the user
(e.g. in show() or one of the get_next/get_prev family of functions).
2021-09-20 11:32:21 -07:00
f4ca3a29dd refactor: reformat with uncrustify #15736
* fix function parameter comments
* remove space after star in function names
2021-09-20 09:35:41 -07:00
1f8c91bf72 fix(inccommand): ignore trailing commands only for *previewed* command #15638
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.

fix #8796, update #7494
2021-09-20 07:33:10 -07:00
30fefee684 refactor: format with uncrustify #15726 2021-09-20 06:53:38 -07:00
12bccc7dd1 test: close timers in vim_spec.lua functional test
Close the timer started during tests before closing the session. This
fixes the uv_loop_close hangs happening in the functional tests.

Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
2021-09-20 18:10:40 +05:30
73d12a8b71 test: fix running functional tests under gdbserver
It was not possible to run the tests under the gdbserver because we were
not closing the old session before starting a new one. This caused the
server to not to be able to bind to the given address and crashing the
tests.

This commit closes the session before starting a new one.

Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
2021-09-20 18:10:40 +05:30
490e09c6d8 Merge #15727 build(lint): check scripts/*.lua 2021-09-19 16:56:57 -07:00
41da72ffb6 build(lint): commit linter 2021-09-19 16:39:34 -07:00
736299bf22 build(lint): check scripts/*.lua 2021-09-19 16:36:08 -07:00
39c886551b refactor(Makefile): use built-in make commands #15708
Changes to the main Makefile:
- add `MAKEFILE_PATH` and `MAKEFILE_DIR` that are set with native commands
- add `NVIM_PRG`
- rename `BUILD_TYPE` to `CMAKE_GENERATOR` to align with CMake naming
- remove the misleading `BUILD_CMD` and use `BUILD_TOOL` instead

Add the following phony target to quickly test the changes

```make
debug-print:
	@echo makefile path: $(MAKEFILE_PATH)
	@echo makefile dir: $(MAKEFILE_DIR)
	@echo build dir: $(BUILD_DIR)
	@echo cmake generator tool: $(CMAKE_GENERATOR)
	@echo build-tool: $(BUILD_TOOL)
	@echo nvim-prg: $(NVIM_PRG)
```
2021-09-19 15:53:48 -07:00
e61ea7772e feat(diagnostic): match(), tolist(), fromlist() #15704
* feat(diagnostic): add vim.diagnostic.match()
  Provide vim.diagnostic.match() to generate a diagnostic from a string and
  a Lua pattern.
* feat(diagnostic): add tolist() and fromlist()
2021-09-19 15:13:23 -07:00
853346a94d refactor: format with uncrustify #15722 2021-09-19 13:07:42 -07:00
6565adcbff build(lint): commit linter #15725
Example test failure:

    $ nvim -es +"lua require('scripts.lintcommit')._test()"
    [ FAIL ]: expected=true, got=false
        input: ":no type before colon 1"
    [ FAIL ]: expected=true, got=false
        input: "ci: tab after colon"

Example main({trace=true}) output:

    $ nvim -es +"lua require('scripts.lintcommit').main()"
    run: { "git", "branch", "--show-current" }
    run: { "git", "merge-base", "origin/master", "master" }
    run: { "git", "merge-base", "upstream/master", "master" }
    run: { "git", "rev-list", "89db07556dbdce97c0c150ed7e47d80e1ddacad3..master" }
    run: { "git", "show", "-s", "--format=%s", "d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc" }
    Invalid commit message: "buildlint): commit linter #15620"
        Commit: d2e6d2f5fc93b6da3c6153229135ba2f0b24f8cc
        Invalid commit type "buildlint)". Allowed types are:
        { "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "test", "chore", "vim-patch" }
        See also:
            https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages
            https://www.conventionalcommits.org/en/v1.0.0/
2021-09-19 12:57:57 -07:00
89db07556d Merge pull request #15630 from zeertzjq/vim-8.2.3424
vim-patch:8.1.{1071,1078,1079,1110},8.2.{2640,3424,3425,3437}
2021-09-19 14:31:10 -04:00
2aa662568a build(lint): commit linter #15620 2021-09-19 11:06:47 -07:00
65572c719a build(lint): commit linter #15620 2021-09-19 09:27:08 -07:00
2afbce7651 refactor(tests): remove redir_exec #15718
Problem
- `redir_exec` is obsolete, but it keeps getting used in new tests
  because people copy existing tests.
- Disadvantages of `redir_exec`:
  - Captures extra junk before the actual error/message that we _want_ to test.
  - Does not fail on error, unlike e.g. `command()`.

Solution
- Use new functions like `nvim_exec` and `pcall_err`.
2021-09-19 02:29:37 -07:00
f4ce4c1677 vim-patch:8.2.3437: compiler warnings for 32/64 bit usage
Problem:    Compiler warnings for 32/64 bit usage.
Solution:   Add type casts. (Mike Williams, closes vim/vim#8870)
f5785cf059
2021-09-19 13:13:44 +08:00
a348c666a3 vim-patch:8.2.3425: warning for using uninitialized variable
Problem:    Warning for using uninitialized variable.
Solution:   Initialize it. (John Marriott)
56e14698b4
2021-09-19 13:13:44 +08:00
51567db4b6 vim-patch:8.2.3424: a sequence of spaces is hard to see in list mode
Problem:    A sequence of spaces is hard to see in list mode.
Solution:   Add the "multispace" option to 'listchars'. (closes vim/vim#8834)
f14b8ba137
2021-09-19 13:13:44 +08:00
177e87525a vim-patch:8.2.2640: screenstring() returns non-existing composing characters
Problem:    screenstring() returns non-existing composing characters.
Solution:   Only use composing characters if there is a base character.
f1387285e2
2021-09-19 13:13:44 +08:00
59e80c4dfc vim-patch:8.1.1110: composing chars on space wrong when 'listchars' is set
Problem:    Composing chars on space wrong when 'listchars' is set.
Solution:   Do not use "space" and "nbsp" entries of 'listchars' when there is
            a composing character.  (Yee Cheng Chin, closes vim/vim#4197)
e5e4e22c1c
2021-09-19 13:13:44 +08:00
c14dc616bf vim-patch:8.1.1079: no need for a separate ScreenLinesUtf8() test function
Problem:    No need for a separate ScreenLinesUtf8() test function.
Solution:   Get the composing characters with ScreenLines().
48aed0824e
2021-09-19 13:13:44 +08:00
32663b0f7e vim-patch:8.1.1078: when 'listchars' is set a composing char on a space is wrong
Problem:    When 'listchars' is set a composing char on a space is wrong.
Solution:   Separate handling a non-breaking space and a space. (Yasuhiro
            Matsumoto, closes vim/vim#4046)
5f8069bbf5
2021-09-19 13:13:44 +08:00
963474321b vim-patch:8.1.1071: cannot get composing characters from the screen
Problem:    Cannot get composing characters from the screen.
Solution:   Add screenchars() and screenstring(). (partly by Ozaki Kiichi,
            closes vim/vim#4059)
2912abb3a2
2021-09-19 13:13:44 +08:00
924e8e4f2d fix(diagnostic): only update decorations for loaded buffers (#15715)
When vim.diagnostic.config() is called, the decorations for diagnostics
are re-displayed to use the new configuration. This should only be done
for loaded buffers.
2021-09-18 14:01:03 -07:00
77399184d7 ci(labeler): diagnostic 2021-09-18 13:29:56 -07:00
41cfba63cd feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)
- Fix the cursor position after applying TextEdits
- Support reversed range of TextEdit
- Invoke nvim_buf_set_text one by one
2021-09-18 13:19:21 -07:00
340f77e78e Merge pull request #15710 from gpanders/show_line_diagnostics
fix(diagnostic): resolve nil bufnr in show_line_diagnostics
2021-09-18 10:31:40 -07:00
de406f651c vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)
Problem:    Filler lines are wrong when changing text in diff mode.
Solution:   Don't change the filler lines on every change.  Check
            scrollbinding when updating the filler lines. (closes vim/vim#8809)
04626c243c
2021-09-18 12:38:58 -04:00
51a98aa0c2 refactor: format #15702 2021-09-18 09:34:23 -07:00
752d2d2081 test: add test case for show_line_diagnostics 2021-09-18 10:07:54 -06:00
ef52433847 fix(diagnostic): resolve nil bufnr in show_line_diagnostics 2021-09-18 09:44:30 -06:00
6cad86fffd Merge pull request #15632 from bfredl/rtptest
runtime: always use DIP_START and remove duplication of start packages in &rtp
2021-09-18 17:14:25 +02:00
a860f7880f refactor(runtime): handle pack/foo/start/bar/after dirs properly
The order should be:
XDG_CONFIG_HOME/nvim
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/
XDG_CONFIG_HOME/nvim/after
XDG_DATA_HOME/nvim/site/pack/foo/start/bar/after
2021-09-18 13:59:19 +02:00
396280d303 refactor(runtime): always use DIP_START when searching for runtime files
Now remove the addition of "start/*" packages in 'packpath' as
explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming
very long when using a lot of plugins as packages.

To get the effective search path as a list, use |nvim_list_runtime_paths()|
2021-09-18 13:53:50 +02:00
8ef2b56cac fix(diagnostic): change default severity_sort order 2021-09-18 13:21:54 +02:00
0dcf4ab27b fix(diagnostic): remove check on nil return value
vim.diagnostic._set_signs doesn't return anything, so checking the
return value will always fail.
2021-09-17 21:10:10 -06:00
445ef41314 refactor(diagnostic): combine config() and set() calls 2021-09-17 21:07:24 -06:00
15d501ff7a refactor(diagnostic): group local functions together 2021-09-17 21:07:24 -06:00
1f49268c46 refactor: convert TRUE/FALSE to true/false (#15660) 2021-09-18 00:24:39 +02:00
938ed458e2 fix(diagnostic): change default severity_sort order
When severity_sort is true, higher severities should be displayed before
lower severities (e.g. ERROR is displayed over WARN).

Also improved the test case for this.
2021-09-17 14:59:30 -06:00
ede5695eb1 Merge pull request #15696 from gpanders/diagnostic-sign-fix
Diagnostic hot fixes
2021-09-17 11:31:56 -07:00
4d7dcbe49f fix(termdebug): replace mapset with nvim_set_keymap (#15699)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2021-09-17 19:29:27 +02:00
d9f93e5642 fix(typo): overriden -> overridden (RE: PR #14159) (#15360) 2021-09-17 13:07:00 -04:00
32c0631183 fix(diagnostic): support severity_sort 2021-09-17 10:50:25 -06:00
d8de4eb685 test: reorg #15698
Problem:
Subdirectories like "visual", "insert", "normal" encourage people to
separate *related* tests for no good reason.  Typically the _mode_ is
not the relevant topic of a test (and when it is, _then_ create
an appropriate describe() or it()).

Solution:
- Delete the various `test/functional/<mode>/` subdirectories, move
  their tests to more meaningful topics.
- Rename `…/normal/` to `…/editor/`.
  - Move or merge `…/visual/*` and `…/insert/*` tests into here where
    appropriate.
- Rename `…/eval/` to `…/vimscript/`.
  - Move `…/viml/*` into here also.

* test(reorg): insert/* => editor/mode_insert_spec.lua
* test(reorg): cmdline/* => editor/mode_cmdline_spec.lua
* test(reorg): eval core tests => eval_spec.lua
2021-09-17 09:16:40 -07:00
f87779a24d fix(diagnostic): correctly handle folder level diagnostics 2021-09-17 09:28:11 -06:00
15fbc9b69e docs(diagnostics): fix typos 2021-09-17 08:57:51 -06:00
3fd145007c fix(diagnostic): fix wrong data type in setqflist() 2021-09-17 08:53:08 -06:00
d56002f7b7 Merge pull request #15364 from seandewar/vim-8.2.3337
vim-patch:8.2.{3286,3289,3293,3298,3313,3321,3328,3330,3331,3337,3354,3355,3357,3360,3369,3375}
2021-09-17 10:47:17 -04:00
71e0e6cc63 fix(diagnostic): don't overwrite existing sign definitions 2021-09-17 08:44:52 -06:00
867e888599 refactor(style): switch-case formatting, "uncrustify:indent-off" #15669
* refactor: disable formatting for attribute in macro
* fixup: disable/enable uncrustify with uncrustify:indent-off/on
* fixup: stop indenting contents inside braces in case
* fixup: remove case brace if no variable declaration
2021-09-17 07:38:16 -07:00
1ec3d37192 Merge pull request #15580 from seandewar/vim-8.2.3378
vim-patch:8.2.{3378,3379,3384,3386,3398,3400}
2021-09-17 09:39:36 -04:00
5f144efefa fix: prevent K_EVENT from stopping Select mode CTRL-O #15688
When using Goneovim, Select mode `CTRL-O` returns back to Select mode
immediately (even with `--clean`). Neovim TUI (with some plugins) also randomly
returns to Select mode even if no keys are pressed when using `CTRL-O` in Select
mode.
2021-09-17 06:17:51 -07:00
c4b7744704 Merge #15693 fix(diagnostics)
fix(diagnostics): fixup for `show_line_diagnostics` and `lsp.diagnostics.get`
2021-09-17 04:58:31 -07:00
22d146760e fix(diagnostic): don't convert diagnostic table twice
The recursive implementation of vim.lsp.diagnostic.get() applied
`diagnostic_vim_to_lsp` twice, and the second time gave wrong
results because of the unexpected format.

Fixes https://github.com/neovim/neovim/issues/15689
2021-09-17 13:35:57 +02:00
3e230da90b fix(diagnostic): show_line_diagnostic with empty lnum
The documentation claims to default to the current line number if
the argument `lnum` is nil, but that was never actually done.

Fixes https://github.com/neovim/neovim/issues/15690
2021-09-17 13:33:54 +02:00
4881456e83 fix(diagnostic): nvim_echo takes three args (#15687)
Fixup for https://github.com/neovim/neovim/pull/15585
Closes https://github.com/neovim/neovim/issues/15686
2021-09-17 09:21:17 +02:00
c13242cf47 fix(diagnostic): remove useless highlight links (#15683)
These links were actually defined backwards: the highlight groups
actually being used for display are the new "Diagnostic*" groups, so
linking the old "LspDiagnostics*" groups to these does absolutely
nothing, since there is nothing actually being highlighted with the
LspDiagnostics* groups.

These links were made in an attempt to preserve backward compatibility
with existing colorschemes. We could reverse the links to maintain this
preservation, but then that disallows us from actually defining default
values for the new highlight groups.

Instead, just remove the links and be done with the old LspDiagnostics*
highlight groups.

This is not technically a breaking change: the breaking change already
happened in #15585, but this PR just makes that explicit.
2021-09-17 08:17:54 +02:00
1e0d563967 vim-patch:8.2.3375: using uninitialized memory
Problem:    Using uninitialized memory.
Solution:   Initialize textprop_save_len.
df9070e300

textprop_save_len is N/A.
2021-09-17 02:10:45 +01:00
d78f06852e vim-patch:8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Problem:    Auto formatting after "cw" leaves cursor in wrong spot.
Solution:   Do not auto-format after the delete. (closes vim/vim#8789)
6b36d2a16d
2021-09-17 02:10:45 +01:00
ebd035f08b vim-patch:8.2.3360: user function completion fails with dict function
Problem:    User function completion fails with dict function.
Solution:   Do not stop sequencing through the list if user functions when
            encountering an empty name. (Naohiro Ono, closes vim/vim#8765,
            closes vim/vim#8774)
5aec755b67
2021-09-17 02:10:44 +01:00
26b7faf1f2 vim-patch:8.2.3357: crash when 'virtualedit' is set and window is narrow
Problem:    Crash when 'virtualedit' is set and window is narrow. ()
Solution:   Check that width is not zero. (closes vim/vim#8767)
02f8694a6b
2021-09-17 02:10:44 +01:00
2ddfd6b999 vim-patch:8.2.3337: completing "call g:" returns entries with just "g:"
Problem:    Completing "call g:" returns entries with just "g:". (Naohiro Ono)
Solution:   Skip empty strings returned by get_user_func_name(). (closes vim/vim#8753)
069f90852f
2021-09-17 02:10:44 +01:00
b24c377c8a vim-patch:8.2.3330: Coverity reports using uninitialized field
Problem:    Coverity reports using uninitialized field.
Solution:   Initialize the field early.
7deb4115ef
2021-09-17 02:10:43 +01:00
17f377b6f9 vim-patch:8.2.3328: Coverity error for not checking return value
Problem:    Coverity error for not checking return value.
Solution:   Check value is not negative.
b85d3627d9
2021-09-17 02:10:43 +01:00
2cbbab28d2 vim-patch:8.2.3321: some code is not tested
Problem:    Some code is not tested.
Solution:   Add some more tests. (Dominique Pellé, closes vim/vim#8735)
bd9e796125

Include Test_confirm_write_partial_file() anyway, even though it will
not be run.
2021-09-17 02:10:43 +01:00
e9ddff9d8a vim-patch:8.2.3313: unused code in win_exchange() and frame_remove()
Problem:    Unused code in win_exchange() and frame_remove().
Solution:   Remove the code. (closes vim/vim#8728)
9e2fa4bb9e
2021-09-17 02:10:42 +01:00
423150dfa0 vim-patch:8.2.3293: finding completions may cause an endless loop
Problem:    Finding completions may cause an endless loop.
Solution:   Use a better way to check coming back where the search started.
            (Andy Gozas, closes vim/vim#8672, closes vim/vim#8671)
6a230c6b32
2021-09-17 02:10:39 +01:00
7ff5f02821 vim-patch:8.2.3286: win_enter_ext() has too many boolean arguments
Problem:    win_enter_ext() has too many boolean arguments.
Solution:   use one flags argument with defined values.
d61f2f772a

Include some style changes to appease the linter.

N/A patches for version.c:

vim-patch:8.2.3289: compiler warning for unused variable with small features

Problem:    Compiler warning for unused variable with small features.
Solution:   Rearrange #ifdefs.
f18e8a969a

vim-patch:8.2.3298: build failure with small features

Problem:    Build failure with small features.
Solution:   Add #ifdef.
6f6d58c380

vim-patch:8.2.3331: Coverity warns for using value without boundary check

Problem:    Coverity warns for using value without boundary check.
Solution:   Add a boundary check.
ed7cb2df35

vim-patch:8.2.3354: build failure with +byte_offset but without +textprop

Problem:    Build failure with +byte_offset but without +textprop. (John
            Marriott)
Solution:   Adjust the #ifdef.
92755bba30

vim-patch:8.2.3355: MS-Windows: compiler warning for 64-32 bit conversion

Problem:    MS-Windows: compiler warning for 64-32 bit conversion.
Solution:   Add type casts.
434df7a401
2021-09-17 01:46:24 +01:00
c2a65921d7 fix(diagnostic): don't override existing highlight groups #15682
Use the 'default' keyword to prevent overriding existing highlight groups.

ref #15585
2021-09-16 14:51:29 -07:00
0c66289cba Merge pull request #15668 from bfredl/logmenu
fix(tests): don't attempt to call ui functions in free_all_mem()
2021-09-16 23:36:53 +02:00
2e8103475e Merge #15585 refactor: move vim.lsp.diagnostic to vim.diagnostic
## Overview

- Move vim.lsp.diagnostic to vim.diagnostic
- Refactor client ids to diagnostic namespaces
- Update tests
- Write/update documentation and function signatures

Currently, non-LSP diagnostics in Neovim must hook into the LSP subsystem. This
is what e.g. null-ls and nvim-lint do. This is necessary because none of the
diagnostic API is exposed separately from the LSP subsystem.

This commit addresses this by generalizing the diagnostic subsystem beyond the
scope of LSP. The `vim.lsp.diagnostic` module is now simply a specific
diagnostic producer and primarily maintains the interface between LSP clients
and the broader diagnostic API.

The current diagnostic API uses "client ids" which only makes sense in the
context of LSP. We replace "client ids" with standard API namespaces generated
from `nvim_create_namespace`.

This PR is *mostly* backward compatible (so long as plugins are only using the
publicly documented API): LSP diagnostics will continue to work as usual, as
will pseudo-LSP clients like null-ls and nvim-lint. However, the latter can now
use the new interface, which looks something like this:

```lua
-- The namespace *must* be given a name. Anonymous namespaces will not work with diagnostics
local ns = vim.api.nvim_create_namespace("foo")

-- Generate diagnostics
local diagnostics = generate_diagnostics()

-- Set diagnostics for the current buffer
vim.diagnostic.set(ns, diagnostics, bufnr)
```

Some public facing API utility methods were removed and internalized directly in `vim.diagnostic`:

* `vim.lsp.util.diagnostics_to_items`

## API Design

`vim.diagnostic` contains most of the same API as `vim.lsp.diagnostic` with
`client_id` simply replaced with `namespace`, with some differences:

* Generally speaking, functions that modify or add diagnostics require a namespace as their first argument, e.g.

  ```lua
  vim.diagnostic.set({namespace}, {bufnr}, {diagnostics}[, {opts}])
  ```

   while functions that read or query diagnostics do not (although in many cases one may be supplied optionally):

   ```lua
   vim.diagnostic.get({bufnr}[, {namespace}])
   ```

* We use our own severity levels to decouple `vim.diagnostic` from LSP. These
  are designed similarly to `vim.log.levels` and currently include:

  ```lua
  vim.diagnostic.severity.ERROR
  vim.diagnostic.severity.WARN
  vim.diagnostic.severity.INFO
  vim.diagnostic.severity.HINT
  ```

  In practice, these match the LSP diagnostic severity levels exactly, but we
  should treat this as an interface and not assume that they are the same. The
  "translation" between the two severity types is handled transparently in
  `vim.lsp.diagnostic`.

* The actual "diagnostic" data structure is: (**EDIT:** Updated 2021-09-09):

  ```lua
  {
    lnum = <number>,
    col = <number>,
    end_lnum = <number>,
    end_col = <number>,
    severity = <vim.diagnostic.severity>,
    message = <string>
  }
  ```

This differs from the LSP definition of a diagnostic, so we transform them in
the handler functions in vim.lsp.diagnostic.

## Configuration

The `vim.lsp.with` paradigm still works for configuring how LSP diagnostics are
displayed, but this is a specific use-case for the `publishDiagnostics` handler.
Configuration with `vim.diagnostic` is instead done with the
`vim.diagnostic.config` function:

```lua
vim.diagnostic.config({
    virtual_text = true,
    signs = false,
    underline = true,
    update_in_insert = true,
    severity_sort = false,
}[, namespace])
```

(or alternatively passed directly to `set()` or `show()`.)

When the `namespace` argument is `nil`, settings are set globally (i.e. for
*all* diagnostic namespaces). This is what user's will typically use for their
local configuration. Diagnostic producers can also set configuration options for
their specific namespace, although this is generally discouraged in order to
respect the user's global settings. All of the values in the table passed to
`vim.diagnostic.config()` are resolved in the same way that they are in
`on_publish_diagnostics`; that is, the value can be a boolean, a table, or
a function:

```lua
vim.diagnostic.config({
    virtual_text = function(namespace, bufnr)
        -- Only enable virtual text in buffer 3
        return bufnr == 3
    end,
})
```

## Misc Notes

* `vim.diagnostic` currently depends on `vim.lsp.util` for floating window
  previews. I think this is okay for now, although ideally we'd want to decouple
  these completely.
2021-09-16 14:23:42 -07:00
4fca63dbf7 fix(lint): remove unused parameters from deprecated functions 2021-09-16 15:01:09 -06:00
888a6ec6ce fix(lint): remove unused function from diagnostic spec 2021-09-16 14:40:13 -06:00
7d21b95869 Merge pull request #15211 from seandewar/blob-port
Port VimL's Blob type - vim-patch:8.1.{0735,0736,0738,0741,0742,0755,0756,0757,0765,0793,0797,0798,0802,1022,1023,1671},8.2.{0121,0184,0404,0521,0829,1473,1866,2712}
2021-09-16 16:31:41 -04:00
2d81f19279 Merge #15680 fix(eval): add the vimscript-1 feature to has() 2021-09-16 13:25:26 -07:00
89f7f7a991 vim-patch:8.2.1866: Vim9: appending to pushed blob gives wrong result
Problem:    Vim9: appending to pushed blob gives wrong result.
Solution:   Set ga_maxlen when copying a blob.
66fa5fd54f

Vim9script is N/A.
2021-09-16 20:20:43 +01:00
26d728fe7c test(oldtest): re-order test_eval_stuff tests to match Vim 2021-09-16 20:09:56 +01:00
18b32fca67 fix(eval): add the vimscript-1 feature to has()
Include Test_string_concat_scriptversion1 to test that
has('vimscript-1') works (excluding the :scriptversion 1 bit).
2021-09-16 19:50:13 +01:00
9d5d72c388 fix(test runner): handle nil in no-colors output handler #15679
Problem:
13748512f6 #15610 The no-colors codepath of the nvim.lua test output
handler does not handle nil, leading to weird symptoms if e.g. a test
has a syntax error:

    test/busted/outputHandlers/nvim.lua:105: attempt to concatenate a nil value

Solution:
Coerce to string in no-colors handler.
2021-09-16 11:42:00 -07:00
d140d3bd33 fix(docs): ignore _*.lua files from auto doc generation #15678 2021-09-16 10:49:11 -07:00
0c86bf563c refactor: remove UTF to byte col conversion 2021-09-16 11:26:45 -06:00
29bc648d2b fix(man.vim): ensure buftype=nofile after :tag or :stag #15675
Problem:
`buftype=help` occasionally propagates from help to man buffer. As a result the
next time you open help it opens in the man window, replacing the manpage.

Test case:
    nvim -u NORC
    :Man man
    :set bt?            " should print `buftype=nofile`
    :help
    <C-W><C-W><C-W>c    " go back to :Man window and close it
    :help               " focus help window
    :Man man            " open window with manpage again
    :set bt?            " prints `buftype=help`

Solution:
- call s:set_options()
    - man#read_page() (called by autocmd BufReadCmd man://*) should already do
      this. But BufReadCmd doesn't fire for already-existing man:// buffers.

Fix #15650
2021-09-16 06:51:26 -07:00
4fa3865588 test: add test case for severity ranges 2021-09-15 19:09:21 -06:00
10283915d6 doc(eval): include latest relevant Blob changes
Also includes some small relevant nearby non-Blob changes and typo
fixes.

Changes are included from:
- v8.1.0815
- v8.1.0846
- v8.1.1084
- v8.1.2326
- v8.2.1969
- d89682477c
- d09091d495
- 53f7fccc94
2021-09-16 00:14:48 +01:00
6eb41e5c8d test(oldtest): unskip existing tests that use Blobs 2021-09-16 00:14:48 +01:00
e53b71627f feat(f_msgpackparse): support parsing from Blob
Note that it is not possible for msgpack_unpack_next() and
msgpack_unpacker_next() to return MSGPACK_UNPACK_EXTRA_BYTES, so it
should be fine to abort() on that.

Lua 5.1 doesn't support string hex escapes (\xXX) like VimL does (though
LuaJIT does), so convert them to decimal escapes (\DDD) in tests.
2021-09-16 00:14:47 +01:00
ddaa0cc9be fix(test/dumplog): tostring(rv) before formatting as string
For example, implicitly converting a table to a string works in LuaJIT,
but needs to be done explicitly with tostring() in Lua 5.1.

This can cause issues when testing a non-JIT build if eq(), for example,
fails with a table argument. E.g: eq({}, {1}) will not print the details
of the assertion failure, but will instead print a less helpful "string
expected, got table" error.
2021-09-16 00:14:47 +01:00
5fdf741f77 feat(f_msgpackdump): support dumping to Blob 2021-09-16 00:14:47 +01:00
7e9ea08321 feat(f_chansend): support Blob data argument 2021-09-16 00:14:47 +01:00
e88961943b fix(eval): partially port v8.2.3284
These were issues that I found while porting that I fixed upstream. :^)

Very little of the patch can be exactly ported as we're a bit behind on
dependant patches (we also can't use the exact :for emsg, as we don't
support iterating over Strings yet), so just translate the fixes as best
as we can for now.

Include latest relevant doc changes from:
- v8.1.0815
- v8.2.2658
2021-09-16 00:14:46 +01:00
3d6bb8b3fb fix(f_remove): partially port v8.2.2779
Fixes remove() copying one extra byte after the end of a Blob's buffer.

Can't be fully ported as the change is from blob_remove(), which hasn't
been ported yet.
2021-09-16 00:14:46 +01:00
ecb54238e0 vim-patch:8.2.2712: memory leak when adding to a blob fails
Problem:    Memory leak when adding to a blob fails.
Solution:   Clear the second typval before returning.
f2dd9cb995
2021-09-16 00:14:46 +01:00
9e38c4a79f vim-patch:8.2.1473: items in a list given to :const can still be modified
Problem:    Items in a list given to :const can still be modified.
Solution:   Work like ":lockvar! name" but don't lock referenced items.
            Make locking a blob work.
021bda5671
2021-09-16 00:13:41 +01:00
ffaf881b42 vim-patch:8.2.0829: filter() may give misleading error message
Problem:    filter() may give misleading error message.
Solution:   Also mention Blob as an allowed argument.
fcb0b61d15

Rename Test_map_fails() to Test_map_filter_fails() from v8.2.0610 and
include the modeline.
2021-09-15 22:57:55 +01:00
19232593ba fix(f_insert): partially port v8.2.0634
Fixes a crash in f_insert() when inserting into a NULL blob.
Include blob-related test changes and some other simple changes.
2021-09-15 22:57:54 +01:00
9b5c9dbfa7 vim-patch:8.2.0521: crash when reading a blob fails
Problem:    Crash when reading a blob fails.
Solution:   Avoid keeping a pointer to a freed blob object. (Dominique Pelle,
            closes vim/vim#5890)  Adjust error messages.
15352dc6ec
2021-09-15 22:57:54 +01:00
ba34afb378 vim-patch:8.2.0404: writefile() error does not give a hint
Problem:    Writefile() error does not give a hint.
Solution:   Add remark about first argument.
18a2b87ca2
2021-09-15 22:57:54 +01:00
53f28f024c vim-patch:8.2.0184: blob test fails
Problem:    Blob test fails.
Solution:   Check for different error when float feature is missing.
92be6e3f46

Nvim always has the float feature, but include the changes to the test
anyway.
2021-09-15 22:57:53 +01:00
ef76238548 vim-patch:8.2.0121: filter() and map() on blob don't work
Problem:    filter() and map() on blob don't work.
Solution:   Correct the code. (closes vim/vim#5483)
49c57ce500
2021-09-15 22:57:53 +01:00
726b255288 vim-patch:8.1.1671: copying a blob may result in it being locked
Problem:    Copying a blob may result in it being locked.
Solution:   Reset v_lock. (Ken Takata, closes vim/vim#4648)
b7b9efbccf
2021-09-15 22:57:53 +01:00
e7772c051f vim-patch:8.1.1023: may use NULL pointer when indexing a blob
Problem:    May use NULL pointer when indexing a blob. (Coverity)
Solution:   Break out of loop after using index on blob
61be376337
2021-09-15 22:57:52 +01:00
bd9c787b4f vim-patch:8.1.0802: negative index doesn't work for Blob
Problem:    Negative index doesn't work for Blob.
Solution:   Make it work, add a test. (closes vim/vim#3856)
a5be9b6248

Leave tv_blob_get()'s return type untouched.
2021-09-15 22:57:47 +01:00
23f5999d28 vim-patch:8.1.0798: changing a blob while iterating over it works strangely
Problem:    Changing a blob while iterating over it works strangely.
Solution:   Make a copy of the Blob before iterating.
dd29ea1805
2021-09-15 22:30:31 +01:00
e140eec441 vim-patch:8.1.0797: error E898 is used twice
Problem:    Error E898 is used twice.
Solution:   Rename the Blob error to E899. (closes vim/vim#3853)
bf821bccf1
2021-09-15 22:30:31 +01:00
c57132ec2a vim-patch:8.1.0793: incorrect error messages for functions that take a Blob
Problem:    Incorrect error messages for functions that now take a Blob
            argument.
Solution:   Adjust the error messages. (Dominique Pelle, closes vim/vim#3846)
0d17f0d1c0
2021-09-15 22:30:31 +01:00
6a02ccc222 vim-patch:8.1.0765: string format of a Blob can't be parsed back
Problem:    String format of a Blob can't be parsed back.
Solution:   Use 0z format.
4131fd5509
2021-09-15 22:30:30 +01:00
0eadd7e5fd vim-patch:8.1.0757: not enough documentation for Blobs
Problem:    Not enough documentation for Blobs.
Solution:   Add a section about Blobs.
d89682477c

Include doc changes for empty() from v7.4.1274.
Include some minor typo fixes.
2021-09-15 22:30:20 +01:00
2b98bdd75b vim-patch:8.1.0756: copy() does not make a copy of a Blob
Problem:    copy() does not make a copy of a Blob.
Solution:   Make a copy.
3d28b58c51

Replace vim_memsave() with xmemdup().
2021-09-15 21:54:00 +01:00
c1b8731ece vim-patch:8.1.0755: error message for get() on a Blob with invalid index
Problem:    Error message for get() on a Blob with invalid index.
Solution:   Return an empty Blob, like get() on a List does.
2ea773b468
2021-09-15 21:54:00 +01:00
d346ac536f vim-patch:8.1.0742: not all Blob operations are tested
Problem:    Not all Blob operations are tested.
Solution:   Add more testing for Blob.
05500ece62

Test_readfile_binary is already ported.
2021-09-15 21:53:38 +01:00
7200454ee6 vim-patch:8.1.0738: using freed memory, for loop over blob leaks memory
Problem:    Using freed memory, for loop over blob leaks memory.
Solution:   Clear pointer after freeing memory.  Decrement reference count
            after for loop over blob.
ecc8bc482b
2021-09-15 21:19:31 +01:00
de9df825d5 feat(decode_string): decode binary string with NULs to Blob
Strings that previously decoded into a msgpack special for representing
BINs with NULs now convert to Blobs. It shouldn't be possible to decode
into this special anymore after this change?

Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
2021-09-15 21:19:30 +01:00
ef729fb15b feat(shada): restore Blob globals properly
As Strings and Blobs are encoded as msgpack BINs, the current ShaDa
implementation will restore global Blob variables as Strings (or msgpack
special dicts if they contain NULs).

Encode an additional element with Blob globals to differentiate them
from Strings so that we can restore them with the correct type.

Adjust variables_spec.lua's autotest() to also check for proper type.
2021-09-15 21:19:30 +01:00
af6f454f5c feat(msgpack): convert Blobs to BIN strings 2021-09-15 21:19:30 +01:00
ab82369c8e feat(json): convert Blobs to array of byte values
Similiar to how Vim does it, but to be consistent with how Nvim encodes
lists, add a space after every comma.
2021-09-15 21:19:29 +01:00
312c783d81 feat(api): convert Blobs to API strings
Note that these are not NUL-terminated; the API supports this.
2021-09-15 21:19:29 +01:00
10aa60e806 feat(nlua): convert Blobs to strings 2021-09-15 21:19:29 +01:00
bfeecd0b41 vim-patch:8.1.0736: code for Blob not sufficiently tested
Problem:    Code for Blob not sufficiently tested.
Solution:   Add more tests.  Fix uncovered crash.  Add test_null_blob().
c0f5a78c15

eval0 and ex_echo's emsg-specific changes have already been ported.
These tests uncover another crash that was fixed in v8.1.0738.
2021-09-15 21:19:29 +01:00
9095101743 vim-patch:8.1.0735: cannot handle binary data
Problem:    Cannot handle binary data.
Solution:   Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638)
6e5ea8d2a9

Nvim-specific Blob conversions are implemented in future commits.

Refactor write_blob() to use a FileDescriptor, as f_writefile() was
refactored to use one (does not apply to read_blob()).

Use var_check_lock() in f_add() for Blobs from v8.1.0897.

Add a modeline to test_blob.vim and fix some doc typos.

Include if_perl.txt's VIM::Blob() documentation. Interestingly, this
function already worked before this port, as it just returns a Blob
string literal, not an actual Blob object.

N/A patches for version.c:

vim-patch:8.1.0741: viminfo with Blob is not tested

Problem:    Viminfo with Blob is not tested.
Solution:   Extend the viminfo test.  Fix reading a blob.  Fixed storing a
            special variable value.
8c8b8bb56c

vim-patch:8.1.1022: may use NULL pointer when out of memory

Problem:    May use NULL pointer when out of memory. (Coverity)
Solution:   Check for blob_alloc() returning NULL.
e142a9467a
2021-09-15 21:19:22 +01:00
a5bbb932f9 refactor: move vim.lsp.diagnostic to vim.diagnostic
This generalizes diagnostic handling outside of just the scope of LSP.
LSP clients are now a specific case of a diagnostic producer, but the
diagnostic subsystem is decoupled from the LSP subsystem (or will be,
eventually).

More discussion at [1].

[1]: https://github.com/neovim/neovim/pull/15585
2021-09-15 14:09:47 -06:00
685cf39813 feat(lsp): improve logging (#15636)
* Simplify rpc encode/decode messages to rpc.send/rcp.receive
* Make missing handlers message throw a warning
* Clean up formatting style in log
* Move all non-RPC loop messages to trace instead of debug
* Add format func option to log to allow newlines in per log entry
2021-09-15 11:35:04 -07:00
afdc9e6150 fix(:source): copy curbuf lines to memory before sourcing #15111
It's possible for weirdness to happen if curbuf is modified while
sourcing from it via :source (with no arguments). For example:

- Deleting lines from or wiping curbuf can cause internal error E315 to
  be thrown from ml_get.
- Changing the curbuf to another buffer while sourcing can cause lines
  from the new curbuf to then be sourced instead.
2021-09-15 05:17:07 -07:00
6188926e00 fix(:source, nvim_exec): handle Vimscript line continuations #14809
Problem:
Anonymous :source (no args) and nvim_exec() don't support Vimscript line continuations.

Solution:
Factor out the concat logic into concat_continued_line() and a
CONCAT_CONTINUED_LINES macro for simple concatenations where lines are
fetched individually.

Closes #14807
2021-09-14 16:35:33 -07:00
b86039b104 fix(ui): don't log from UI events during free_all_mem()
Example assertion failure:

   %0 in logmsg neovim/src/nvim/log.c:139:17
   %1 in ui_call_update_menu neovim/build/src/nvim/auto/ui_events_call.generated.h:8:3
   %2 in ex_menu neovim/src/nvim/menu.c:263:3
   %3 in do_one_cmd neovim/src/nvim/ex_docmd.c:1981:5
   %4 in do_cmdline neovim/src/nvim/ex_docmd.c:602:20
   %5 in do_cmdline_cmd neovim/src/nvim/ex_docmd.c:287:10
   %6 in free_all_mem neovim/src/nvim/memory.c:596:3
   %7 in os_exit neovim/src/nvim/main.c:574:3
   %8 in exit_event neovim/src/nvim/msgpack_rpc/channel.c:569:5
2021-09-14 21:01:15 +02:00
9edd17509f Merge #15657 vim-patch:8.1.1195,8.2.{3417,3419} 2021-09-14 10:27:21 -07:00
b63b4777ec docs: third-party licenses, TEST_COLORS, system() #15665 2021-09-14 10:20:33 -07:00
0a83017fe9 refactor: format files with uncrustify #15663 2021-09-14 09:13:34 -07:00
516775e9d8 fix(lsp): correctly parse LSP snippets #15579
Fixes #15522
2021-09-14 04:31:41 -07:00
b8cce77702 fix: "redundant cast to the same type" #15662
Apply "redundant cast to the same type" fix from clangd.
2021-09-14 04:07:08 -07:00
6ed43f8f1c refactor: format tui/input.c with uncrustify (#15661) 2021-09-14 12:21:24 +02:00
0771504488 refactor: format tui.c with uncrustify (#15640) 2021-09-14 10:36:08 +02:00
31ac33bf77 vim-patch:8.2.3419: a failing debug expression may make Vim unusable
Problem:    A failing debug expression may make Vim unusable.
Solution:   Suppress error messages. (closes vim/vim#8848)
0325d3967c
2021-09-13 17:24:07 +01:00
936c4ae151 vim-patch:8.2.3417: Vim9: a failing debug expression aborts script sourcing
Problem:    Vim9: a failing debug expression aborts script sourcing.
Solution:   Do not let expression failure abort script sourcing. (closes vim/vim#8848)
072f1c6888

Vim9script is N/A, exclude Test_Debugger_breakadd_expr.

Move debuggy struct to before generated header inclusion so
eval_expr_restore prototype works.

Add CheckRunVimInTerminal to Test_Debugger_breakadd.
Cherry-pick Test_Debugger_breakadd changes from v8.2.1440, v8.2.1736.
2021-09-13 17:19:24 +01:00
9f3d7dcda2 vim-patch:8.1.1195: Vim script debugger functionality needs cleanup
Problem:    Vim script debugger functionality needs cleanup.
Solution:   Move debugger code to a separate file.  Add more tests. (Yegappan
            Lakshmanan, closes vim/vim#4285)
eead75c5e8

Good to have for eval_expr_restore in v8.2.3417.

Doesn't actually add any tests.
2021-09-13 17:19:15 +01:00
5fd21b8d3e vim-patch:6c391a74fe90 (#15654)
Update runtime files
6c391a74fe

omit autoload/getscript.vim

skip doc/eval.txt (needs 8.2.2468)
skip doc/various.txt (needs 8.2.3400)

(typofixes courtesy of @dundargoc)
2021-09-13 16:33:41 +02:00
1a9d2a4040 vim-patch:89a9c159f23f #15641
Update runtime files
89a9c159f2

Omit:
nsis/lang/turkish.nsi
pixmaps/gen-inline-pixbufs.sh
doc/popup.txt
doc/terminal.txt
tutor/tutor*
src/[g]vimtutor
CONTRIBUTING.md

Skip:
doc/eval.txt (needs 8.1.2342)
doc/testing.txt (needs 8.2.0299)
2021-09-13 06:05:27 -07:00
d5b66e8860 refactor: replace TRUE/FALSE with true/false #15647 2021-09-13 04:57:36 -07:00
b9d57fa107 vim-patch:8.2.3432: octave/Matlab filetype detection does not work properly (#15652)
Problem:    Octave/Matlab filetype detection does not work properly.
Solution:   Update the patterns used for matching. (Doug Kearns)
ca0627df69
2021-09-13 10:00:09 +02:00
643cb8a6ec doc(options): remove vim9script reference (#15645)
[skip ci]
2021-09-12 13:51:00 +02:00
5615ea8b6b vim-patch:8.2.3368: not all Racket files are recognized (#15643)
Problem:    Not all Racket files are recognized.
Solution:   Also recognize .rktl and .rktd files. (Doug Kearns)
9cd91a1e88
2021-09-12 13:09:18 +02:00
ae73aa8339 vim-patch:8.2.3374: Pyret files are not recognized (#15642)
Problem:    Pyret files are not recognized.
Solution:   Recognize .arr files as Pyret. (Doug Kearns)
eb05d05f8a
2021-09-12 12:55:34 +02:00
1c5833cb00 Merge pull request #15639 from bfredl/xdata
fix(tests): use isolated XDG_DATA_HOME in startup tests
2021-09-12 11:35:31 +02:00
229effac9f vim-patch:partial 6aa57295cfbe (#15633)
* vim-patch:partial 6aa57295cfbe

Update runtime files
6aa57295cf

omit doc/popup.txt
omit plugin/manpager.vim

partial skip runtime/doc/eval.txt (needs 8.2.{0258,0924,1544,2324,2468,2606})

skip ftplugin/julia.vim, indent/julia.vim, syntax/julia.vim (already
        ported in
        65f32f0f19)
skip syntax/scala.vim (already ported in
        a92e83ac14)
2021-09-12 11:02:33 +02:00
4a7a99ff31 Merge pull request #15550 from jasonccox/vim-8.2.3385
vim-patch:8.2.3385,8.2.3393
2021-09-12 10:55:35 +02:00
8e663e28ee fix(tests): use isolated XDG_DATA_HOME in startup tests
Otherwise the users site packages will be loaded from ~/.local/share/nvim/site
which can cause unexpected error messages and other kinds of mayhem

Simpler alternative: use "--noplugin". Shouldn't be done because:
(1) these tests should test the ordinary startup code path as close as possible
(2) tests that test the loading of site packages will be added here very soon
2021-09-12 09:30:46 +02:00
cd4ec810e9 Merge pull request #14770 from andrew-pa/fix13403
Fix relative float positioning
2021-09-12 09:23:47 +02:00
e2c3bcd52c Merge pull request #15637 from bfredl/colorsss
fix(build): add an env var to re-enable the colors
2021-09-12 08:34:13 +02:00
5087347e3b fix(build): add an env var to re-enable the colors 2021-09-11 23:20:00 +02:00
413e86869e Merge #14611 from seandewar/vim-8.1.1116
vim-patch:8.1.{1116,1188,1190,1355,1722,2035,2036,2038,2043},8.2.{0886,2309}
2021-09-11 12:12:59 -07:00
e31652879e vim-patch:partial 53f7fccc9413 (#15631)
* vim-patch:partial 53f7fccc9413

Update runtime files
53f7fccc94

omit macros/hanoi/hanoi.vim
omit spell/tet/main.aap
omit tools/shtags.1
omit tools/xcmdsrv_client.c

skip doc/pattern.txt (requires 8.2.3110; 8.2.{1665,1872})
skip doc/map.txt (requires 8.2.3228)
2021-09-11 16:47:45 +02:00
7175efb518 fix(get_showbreak_value): remove FUNC_ATTR_UNUSED 2021-09-11 15:36:04 +01:00
26733dd488 vim-patch:8.2.2309: 0o777 not recognized as octal
Problem:    0o777 not recognized as octal.
Solution:   Use vim_isodigit(). (Ken Takata, closes vim/vim#7633, closes vim/vim#7631)
c37b655443

:scriptversion is N/A.
2021-09-11 15:36:04 +01:00
90a4cf92d2 vim-patch:8.2.0886: cannot use octal numbers in scriptversion 4
Problem:    Cannot use octal numbers in scriptversion 4.
Solution:   Add the "0o" notation. (Ken Takata, closes vim/vim#5304)
c17e66c5c0

:scriptversion is N/A.

Cherry-pick latest str2nr() doc changes from v8.1.2035.
Cherry-pick various mentions of the 0o prefix from:
 - v8.2.2324
 - 2346a63784
 - 11e3c5ba82
 - 82be4849ee

Patch used ascii_isbdigit() by mistake, which was fixed in v8.2.2309.

Make STR2NR_OOCT work the same as STR2NR_OCT when forcing.
In Vim, STR2NR_FORCE | STR2NR_OOCT isn't handled, and doesn't actually
force anything. Rather than abort(), make it work as STR2NR_OCT.

This means STR2NR_FORCE | STR2NR_OCT works the same as
STR2NR_FORCE | STR2NR_OOCT and STR2NR_FORCE | STR2NR_OCT | STR2NR_OOCT.
2021-09-11 15:36:03 +01:00
10018958d8 vim-patch:8.1.2043: not sufficient testing for quoted numbers
Problem:    Not sufficient testing for quoted numbers.
Solution:   Add a few more test cases.
ea8dcf8346

:scriptversion is N/A.

Already added more quote tests in the port of v8.1.2036.
2021-09-11 15:35:55 +01:00
b6d9e92805 vim-patch:8.1.2036: the str2nr() tests fail
Problem:    The str2nr() tests fail.
Solution:   Add missing part of patch.
1ac90b4fa6

Add extra tests for quoted numbers in vim_str2nr_spec.lua, as the
included ones in this patch are somewhat lacking.
2021-09-11 15:33:20 +01:00
6617629ad6 vim-patch:8.1.2035: recognizing octal numbers is confusing
Problem:    Recognizing octal numbers is confusing.
Solution:   Introduce scriptversion 4: do not use octal and allow for single
            quote inside numbers.
60a8de28d1

:scriptversion is N/A.

Cherry-pick Test_readfile_binary() from v8.1.0742.

Note that this patch was missing vim_str2nr() changes, and so fails the
tests; this was fixed in v8.1.2036.
2021-09-11 15:33:20 +01:00
dda977f5c4 vim-patch:8.1.1722: error when scriptversion is 2 a making a dictionary access
Problem:    Error when scriptversion is 2 a making a dictionary access.
Solution:   Parse the subscript even when not evaluating the sub-expression.
            (closes vim/vim#4704)
61343f0c44

:scriptversion is N/A.
2021-09-11 15:33:19 +01:00
34cb087955 vim-patch:8.1.1355: obvious mistakes are accepted as valid expressions
Problem:    Obvious mistakes are accepted as valid expressions.
Solution:   Be more strict about parsing numbers. (Yasuhiro Matsumoto,
            closes vim/vim#3981)
16e9b85113

Update vim_str2nr_spec.lua to add more tests that use strict = true.
2021-09-11 15:33:19 +01:00
cd18fe17a8 vim-patch:8.1.1116: cannot enforce a Vim script style
Problem:    Cannot enforce a Vim script style.
Solution:   Add the :scriptversion command. (closes vim/vim#3857)
558ca4ae55

:scriptversion is N/A, but ":let ..=" is relevant.

N/A patches for version.c

vim-patch:8.1.1188: not all Vim variables require the v: prefix

Problem:    Not all Vim variables require the v: prefix.
Solution:   When scriptversion is 3 all Vim variables can only be used with
            the v: prefix.  (Ken Takata, closes vim/vim#4274)
d2e716e6df

vim-patch:8.1.1190: has('vimscript-3') does not work

Problem:    has('vimscript-3') does not work.
Solution:   Add "vimscript-3" to the list of features.
93a4879c20

vim-patch:8.1.2038: has('vimscript-4') is always 0

Problem:    has('vimscript-4') is always 0.
Solution:   Add "vimscript-4" to the feature table. (Naruhiko Nishino,
            closes vim/vim#4941)
af91438338
2021-09-11 15:33:06 +01:00
e7d2102c91 docs: .git-blame-ignore-revs #15535 2021-09-11 07:12:03 -07:00
e8067d1490 refactor(syntax.c): format with uncrustify #15627 2021-09-11 07:07:15 -07:00
521817ee76 Merge pull request #15619 from clason/vim-90df4b9d4234
vim-patch:90df4b9d4234

chore(vim-patch): add doc/vim9.txt to unwanted files
2021-09-11 12:59:30 +02:00
086631cd92 feat(api): win_viewport also sends line_count #15613 2021-09-10 19:19:39 -07:00
09a477737f Merge #15311 docs(extmarks) 2021-09-10 19:13:36 -07:00
915703f2d8 docs: extmarks indexing #15311
ref #11456
2021-09-10 19:10:09 -07:00
f8e406ed30 docs: extmarks indexing #15311
fix #11456
2021-09-10 18:31:11 -07:00
9b553ad28d docs: extmark indexing #12742
Extmarks mostly use api-indexing, except for nvim_buf_get_extmarks(),
which uses api-indexing with inclusive ranges.

ref #11456
2021-09-10 17:59:28 -07:00
9697023a0b vim-patch:8.2.3389: cannot stop insert mode completion without side effects #15538
Problem:    Cannot stop insert mode completion without side effects.
Solution:   Add CTRL-X CTRL-Z. (closes vim/vim#8821)
dca29d9cf4
2021-09-10 17:14:32 -07:00
5e22fdd9cc test: avoid writing ~/.bash_history #15621
Problem:
- If I run 'make test' on Linux (Fedora), a few lines like
  /path/to/neovim/build/bin/shell-test REP 31 line
  /path/to/neovim/build/bin/shell-test REP 41 line
  are written to my ~/.bash_history.
  These comes from from test/functional/terminal/scrollback_spec.lua.
- If $HISTFILE is unset, shell will not write to history file.
  But bash sets $HISTFILE to default value (~/.bash_history) if it is unset.
- Unknown how to set an env var to empty string in CMake. These do NOT work:
  set(HISTFILE "")
  set(ENV{HISTFILE} "")
  unset(ENV{HISTFILE})

Solution:
Set HISTFILE=/dev/null
2021-09-10 11:54:36 -07:00
7525052270 Merge #15626 vim-patch:8.1.{2281,2283},8.2.{2903,3391,3397} 2021-09-10 08:43:45 -07:00
36aff87ab6 vim-patch:8.2.3397: no test for what 8.2.3391 fixes
Problem:    No test for what 8.2.3391 fixes.
Solution:   Add a test. (Yegappan Lakshmanan, closes vim/vim#8828)
03d257998b
2021-09-10 15:52:07 +01:00
6e1c03bd2d vim-patch:8.2.3391: crash with combination of 'linebreak' and other options
Problem:    Crash with combination of 'linebreak' and other options.
Solution:   Avoid n_extra to become negative. (Christian Brabandt,
            closes vim/vim#8817)
20e0c3d27b
2021-09-10 15:52:07 +01:00
b91609a70d vim-patch:8.2.2903: cursor position wrong on wrapped line with 'signcolumn'
Problem:    Cursor position wrong on wrapped line with 'signcolumn'.
Solution:   Don't add space for showbreak twice. (Christian Brabandt,
            closes vim/vim#8262)
a06e345af5

Add a modeline to test_display.vim.

This introduced a regression fixed by v8.2.3391.
2021-09-10 15:52:07 +01:00
fd1dbb103b vim-patch:8.1.2281: 'showbreak' cannot be set for one window
Problem:    'showbreak' cannot be set for one window.
Solution:   Make 'showbreak' global-local.
ee85702c10

Change in oneleft() is N/A as the relevant condition was removed
(has_mbyte is always true for Nvim, so the condition was always false;
see commit 73dc9e9).

Use wp over curwin for curs_columns().

Required for v8.2.2903 (otherwise test fails as it'll leave the global
option set).

N/A patches for version.c:

vim-patch:8.1.2283: missed on use of p_sbr

Problem:    Missed on use of p_sbr.
Solution:   Add missing p_sbr change.
91e22eb6e0

Already ported in commit 43a874a.
2021-09-10 15:50:43 +01:00
f46341fa43 vim-patch:8.2.3400: ":z!" is not supported
Problem:    ":z!" is not supported.
Solution:   Make ":z!" work and add tests. (Dominique Pellé, closes vim/vim#8836)
            Use display height instead of current window height.
7f2dd1e90c
2021-09-10 15:35:19 +01:00
a73b7c2b16 vim-patch:8.2.3398: html text objects are not fully tested
Problem:    Html text objects are not fully tested.
Solution:   Add tests for dbcs encoding and different number of backslashes.
            (Dominique Pellé, closes vim/vim#8831)
af631f61bc

Cherry-pick Test_textobj_quote() and modeline from v8.2.0655.
2021-09-10 15:35:18 +01:00
c23e87d9d1 vim-patch:8.2.3386: using uninitialized memory
Problem:    Using uninitialized memory.
Solution:   Initialize the rm_ic field. (Dominique Pellé, closes vim/vim#8800)
a918712626
2021-09-10 15:35:18 +01:00
b3a97c56b6 vim-patch:8.2.3384: cannot disable modeline for an individual file
Problem:    Cannot disable modeline for an individual file.
Solution:   Recognize "nomodeline" in a modeline. (Hu Jialun, closes vim/vim#8798)
9dcd349ca8

Cherry-pick missing modeline for test_modeline.vim (heh) from v8.2.1432.
2021-09-10 15:35:18 +01:00
e8e2f73c3a vim-patch:8.2.3378: MS-Windows: completing environment variables with % is wrong
Problem:    MS-Windows: completing environment variables with % is wrong.
Solution:   Only complete environment variables with $. (Albert Liu,
            closes vim/vim#8791)
6024c0427c

The change itself in set_one_cmd_context() is N/A (it was never included
in Neovim to begin with).

N/A patches for version.c:

vim-patch:8.2.3379: crash when using NULL job

Problem:    Crash when using NULL job.
Solution:   Copy static string into buffer. (issue vim/vim#8260)
271906bc06
2021-09-10 15:35:15 +01:00
0dcfd0e8d1 fix(mouse.c): fix mouse drag positions on multigrid #12667
Currently, multigrid mouse drag positions are handled incorrectly if the
drag event is not in the top left grid. Fix this by not adjusting the
position of the event in jump_to_mouse.

related: #15091
2021-09-10 07:24:41 -07:00
c58ee4ef7f docs: clarify :runtime START, OPT behavior #15342
By default, the :runtime command searches "pack/*/start" in 'packpath'
along with 'runtimepath'. Update the documentation to reflect this
behavior.
2021-09-10 07:11:50 -07:00
7b822d4b4b Merge branch 'master' into histfile 2021-09-10 07:05:11 -07:00
329047b3db docs #15625
fix #12261
fix #15536
fix #15623
fix #15572
ref #14244
ref #15034

close #15555
close #14957
2021-09-10 06:59:17 -07:00
af6948d271 docs(terminal): clarify CTRL-\ behavior #15171 2021-09-10 06:24:08 -07:00
4b452d4efb perf(lua): optimize vim.deep_equal #15236
By remembering the keys already compared in repeating a comparison is
avoided. Thanks: https://stackoverflow.com/a/32660766
2021-09-10 06:22:40 -07:00
3b3dbcf7b7 refactor: format files with uncrustify #15607 2021-09-10 06:14:15 -07:00
aab3583e74 vim-patch:8.2.3399: Octave files are not recognized (#15622)
Problem:    Octave files are not recognized.
Solution:   Detect Octave files. (Doug Kearns)
deba5eb195
2021-09-10 14:01:13 +02:00
c58a667e57 chore(vim-patch): add doc/vim9.txt to unwanted files 2021-09-10 13:20:11 +02:00
185ed18e6c Merge pull request #15618 from jamessan/test-timeout-config
test: use $TEST_TIMEOUT to specify timeout
2021-09-10 06:27:20 -04:00
c7ccb26260 do not write into user's ~/.bash_history 2021-09-10 18:21:29 +09:00
be557dddf4 vim-patch:90df4b9d4234
Update runtime files
90df4b9d42

omit .github/CODEOWNERS
omit doc/vim9.txt
omit po/it.po

skip ftplugin/jsonc.vim
skip indent/jsonc.vim
skip syntax/jsonc.vim
(already ported in dce50312e1)

partial skip doc/eval.txt (needs 8.1.{2304,2321})
2021-09-10 09:14:56 +02:00
8f0c843c13 vim-patch:4d8f476176ea (#15612)
* vim-patch:4d8f476176ea

Update runtime files
4d8f476176

skip nsis/README.txt
skip doc/vim9.txt
skip src/nvim/po/it.po
2021-09-10 08:48:27 +02:00
a422f2136a docs(gen_vimdoc.py): ignore health.lua files #15614 2021-09-09 18:28:12 -07:00
8d93223f83 test: use $TEST_TIMEOUT to specify timeout 2021-09-09 20:49:26 -04:00
2fe95cb1ad vim-patch:partial 2346a6378483 (#15599)
Update runtime files
2346a63784

omit doc/vim.man
omit doc/vim9.txt
omit doc/vimdiff.txt
omit doc/vimdiff.man

skip doc/eval.txt (missing patch 8.2.2324)
skip doc/help.txt (missing patch 8.2.2344)
2021-09-09 18:59:11 +02:00
d80aac3b2a Merge pull request #15566 from bfredl/mpack
libs: vendor libmpack and libmpack-lua
2021-09-09 18:47:03 +02:00
13748512f6 test(busted): disable colors in test-runner output #15610
Problem
-------

Because test/busted/outputHandlers/nvim.lua doesn't know if it's running
in a terminal (no "isatty" equivalent), it outputs color codes in CI
logs and local tooling that runs the tests in a pipe:

    [1m[ SKIPPED ] 

This is just noise, hard for humans to read.

Solution
--------

Disable the color codes. If we later find a clever way to detect
a terminal in nvim.lua, we might consider re-enabling colors, but that
would still affect the CI build logs...
2021-09-09 09:18:43 -07:00
422198cde6 Merge pull request #15091 from yatli/mouse_drag_fix
fix #15075 (mouse crash in multigrid)
2021-09-09 17:37:59 +02:00
ad8eda3f5b fix(ci): don't enrage the CI Gods by calling a file 'core.*' 2021-09-09 16:06:43 +02:00
0f596665cc feat(lua): make vim.mpack support vim.NIL and vim.empty_dict() 2021-09-09 16:06:43 +02:00
eaf661dacd feat(lua): add vim.mpack for msgpack support in lua 2021-09-09 16:06:43 +02:00
2a08aeff1a fix(build): make vendored libmpack and libmpack-lua build properly 2021-09-09 16:06:43 +02:00
4ef3c2c2c1 build: vendor libmpack/libmpack-lua sources from b593809d93b5299bbee4e1d18e2e2d55f9fa53a6 2021-09-09 16:06:43 +02:00
c8f46480bc build: vendor libmpack source from libmpack/libmpack 22b1fd90285117c995728511f9525d29520a8c82 2021-09-09 16:06:43 +02:00
d8339be691 Merge #15460 feat(lua)!: register_keystroke_callback => on_key 2021-09-09 06:55:35 -07:00
9f3679cbfd docs: naming conventions 2021-09-09 06:28:11 -07:00
69fe427df4 feat(lua)!: register_keystroke_callback => on_key
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.

ref 3ccdbc570d #12536

BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
2021-09-09 06:09:33 -07:00
4eb1ebbcf7 fix(doc): various fixes #15604
In particular:
- jobwait: omitting {timeout} arg is the same as -1.
- sockconnect: omitting {opts} arg is the same as {}.
- jobsend: obsoleted by chansend; don't mention it in job_control.txt.
- menu_get: add to |functions| table.

[skip ci]
2021-09-09 00:37:59 -07:00
ed0c747788 Merge pull request #15602 from clason/vim-8.2.3390
vim-patch:8.2.3390: included xdiff code is outdated

build: move src/nvim/xdiff to src/xdiff
2021-09-09 08:43:20 +02:00
fbe88ef8f5 build: move src/nvim/xdiff to src/xdiff
Closes #11239
2021-09-08 22:34:54 +02:00
69f4438d35 vim-patch:8.2.3390: included xdiff code is outdated
Problem:    Included xdiff code is outdated.
Solution:   Sync with xdiff in git 2.33. (Christian Brabandt, closes vim/vim#8431)
ba02e4720f
2021-09-08 22:33:20 +02:00
9065730680 fix(windowing): positioning of relative floats
Fix relative floating windows so that they open in the correct position
relative to each other. Also make sure that their positions are correct
immediately after creation without a redraw.
2021-09-08 10:31:47 -06:00
c1f573fbc9 feat(lsp): support textDocument/prepareRename (#15514) 2021-09-08 17:00:15 +02:00
11289ad733 fix(termdebug): replace term_getline with getbufline #15598
Correct incomplete runtime file port in
79cbbd5179
2021-09-08 07:35:40 -07:00
79cbbd5179 vim-patch:d2ea7cf10a4d #15571
Update runtime files
d2ea7cf10a

omit `runtime/doc/if_tcl.txt`
omit `runtime/doc/textprop.txt`
omit `runtime/tutor/*`
omit `runtime/syntax/vim.vim` (cherry-picked in 2dd7828511)

manual merge of `runtime/pack/dist/opt/termdebug/plugin/termdebug.vim`
2021-09-08 07:24:12 -07:00
5e5a329ea2 test: timeout at 20 minutes #15597
Set a maximum test run-time of 20 minutes to:
- fail faster
- avoid wasting CI resources
- set a bound on the test time (if tests take longer than 20 minutes we
  need to invest in parallelizing them...)

Timeout looks like:

    -- Tests exited non-zero: Process terminated due to timeout
    -- No output to stderr.
    CMake Error at /…/neovim/cmake/RunTests.cmake:86
    (message):
      functional tests failed with error: Process terminated due to timeout
2021-09-08 07:21:28 -07:00
384a43fe71 chore(lsp): fix formatting in vim.lsp.log (#15596) 2021-09-07 21:48:19 -07:00
257e8a7431 Merge pull request #15595 from mjlbach/feat/add-healthcheck-lsp
* feat(lsp): add lsp healthcheck

* feat(lsp): add warning message for large log size
2021-09-07 21:16:19 -07:00
e6777a7a04 feat(lsp): add warning message for large log size 2021-09-07 20:52:08 -07:00
e26802650d feat(lsp): add lsp healthcheck
Add healthcheck for language server client, currently only checks
logging status.
2021-09-07 20:51:40 -07:00
47f99d6644 Merge pull request #15575 from dundargoc/refactor/uncrustify
refactor: format files with uncrustify
2021-09-07 22:18:46 +02:00
28ac6c00e6 fix(multigrid): #15075 mouse events crash neovim 2021-09-08 01:57:40 +08:00
1e49a1c888 refactor: format files with uncrustify 2021-09-07 19:07:51 +02:00
Jit
db695cc4ca fix(screen): missing search highlights when redrawing from timer #15380
* Revert "vim-patch:8.1.2294: cursor pos wrong with concealing and search causes a scroll"
* Add a test which covers #13074 910bbc3cca
  while reverting the screen.c code changes from there.

Fixes #14064
2021-09-06 15:18:33 -07:00
687a0b3d3e fix(lsp): adapt codelens resolve to handler signature change (#15578)
Follow up to https://github.com/neovim/neovim/pull/15504
2021-09-06 17:30:53 +02:00
3f526feebf fix(lsp): update workspace/applyEdit handler signature (#15573) 2021-09-05 12:48:54 -07:00
23fe6dba13 Merge pull request #15504 from mjlbach/feat/change-handler-signature
feat(lsp)!: change handler signature
2021-09-05 10:27:52 -07:00
f7dabbc115 docs: regenerate 2021-09-05 10:05:38 -07:00
df17d7844e feat(lsp)!: change handler signature
Previously, the handler signature was:

  function(err, method, params, client_id, bufnr, config)

In order to better support external plugins that wish to extend the
protocol, there is other information which would be advantageous to
forward to the client, such as the original params of the request that
generated the callback.

In order to do this, we would need to break symmetry of the handlers, to
add an additional "params" as the 7th argument.

Instead, this PR changes the signature of the handlers to:

  function(err, result, ctx, config)

where ctx (the context) includes params, client_id, and bufnr. This also leaves
flexibility for future use-cases.

BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring
updating handler calls
2021-09-05 10:04:30 -07:00
7a0468e7ad Merge pull request #15569 from bfredl/end_fill
refactor(screen): let win_line() always handle fillers after last line
2021-09-05 17:45:46 +02:00
c9c9422af0 build: fix fpclassify -Wfloat-conversion warning #15570
Work around a glibc bug where it truncates the argument to fpclassify()
from double to float by implementing fpclassify() ourselves.

Correctness test (Note that the FP_SUBNORMAL test depends on an atof() that
knows how to parse subnormals. Glibc does, not sure about other libcs.):

    #include <math.h>
    #include <stdint.h>
    #include <string.h>

    int xfpclassify(double d)
    {
      uint64_t m;
      int e;

      memcpy(&m, &d, sizeof(m));
      e = 0x7ff & (m >> 52);
      m = 0xfffffffffffffULL & m;

      switch (e) {
        default: return FP_NORMAL;
        case 0x000: return m ? FP_SUBNORMAL : FP_ZERO;
        case 0x7ff: return m ? FP_NAN : FP_INFINITE;
      }
    }

    #include <assert.h>
    #include <stdlib.h>

    int main(void)
    {
      assert(FP_ZERO == xfpclassify(atof("0.0")));
      assert(FP_ZERO == xfpclassify(atof("-0.0")));
      assert(FP_NORMAL == xfpclassify(atof("1.0")));
      assert(FP_NORMAL == xfpclassify(atof("-1.0")));
      assert(FP_INFINITE == xfpclassify(atof("inf")));
      assert(FP_INFINITE == xfpclassify(atof("-inf")));
      assert(FP_NAN == xfpclassify(atof("nan")));
      assert(FP_NAN == xfpclassify(atof("-nan")));
      assert(FP_SUBNORMAL == xfpclassify(atof("1.8011670033376514e-308")));
      return 0;
    }
2021-09-05 07:37:25 -07:00
274248c354 refactor(screen): let win_line() always handle fillers after last line 2021-09-05 11:22:45 +02:00
dce50312e1 vim-patch:90df4b9 (#15494)
Add JSONC runtime files

Co-authored-by: Izhak Jakov <izhakjakov>
2021-09-04 19:49:17 +02:00
6117877823 Merge pull request #15563 from dundargoc/refactor/uncrustify
refactor: update uncrustify config and format screen.c
2021-09-04 09:39:30 +02:00
15af08ad17 refactor: update uncrustify config and format screen.c
Also set new option cmt_trailing_single_line_c_to_cpp to true. It
converts trailing, single-line c-comments (/**/) into cpp-comments (//).
2021-09-03 21:23:23 +02:00
d3c6f1ebbb vim-patch:8.2.3393: escaping for fish shell is skipping some characters
Problem:    Escaping for fish shell is skipping some characters.
Solution:   Escape character after backslash if needed. (Jason Cox,
            closes vim/vim#8827)
6631597452
2021-09-02 13:07:29 -06:00
85ba41a4b3 vim-patch:8.2.3385: escaping for fish shell does not work properly
Problem:    Escaping for fish shell does not work properly.
Solution:   Insert a backslash before a backslash. (Jason Cox, closes vim/vim#8810)
6e82351130
2021-09-02 13:07:29 -06:00
5f8518b3f0 fix(defaults): "syntax sync maxlines=1" on CmdwinEnter #15552
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.

ref #15401 622a36b1f1
2021-09-02 10:29:59 -07:00
622a36b1f1 feat(defaults): limit syntax cost on CmdwinEnter #15401
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.

ref #6289 #6399
2021-09-02 04:17:04 -07:00
6751d6254b refactor(tests): use assert_alive() #15546 2021-09-01 09:42:53 -07:00
0603eba6e7 feat(api): nvim_get_chan_info: include "argv" for jobs #15537
ref #15440
2021-09-01 07:29:38 -07:00
5c643dee7b docs(lsp): remove private lsp.diagnostic functions from docs (#15541)
Both `apply_to_diagnostic_items` and `show_diagnostics` are local
functions and cannot be called by users.
2021-09-01 14:28:15 +02:00
684550ff38 docs(lsp): document codelens.get bufnr parameter (#15540)
Alternative to https://github.com/neovim/neovim/pull/15224
2021-09-01 13:29:11 +02:00
284199bc4b Merge #15402 fix(terminal): close without ! if the job is stopped 2021-08-31 07:24:25 -07:00
3c081d0280 fix(jobwait): always drain process event queues #15402
Problem:
jobwait() returns early if the job was stopped, but the job might have
pending callbacks on its event queue which are required to complete its
teardown. State such as term->closed might not be updated yet (by the
pending callbacks), so codepaths such as :bdelete think the job is still
running.

Solution:
Always flush the job's event queue before returning from jobwait().

ref #15349
2021-08-31 06:53:06 -07:00
55defa1a41 fix(terminal): close without ! if the job is stopped
- If the terminal job is still running then ! is still required.

Closes #4683
2021-08-31 06:46:56 -07:00
9695691ee4 Merge pull request #15526 from bfredl/f_meta
fix(lua): make core vim module not dependent on $VIMRUNTIME modules
2021-08-30 18:09:53 +02:00
6f2d0ea311 fix(lua): make core vim module not dependent on $VIMRUNTIME functions
fixes #15524

Note: this is obviously a quickfix. A scalabe solution will
involve being able to specify a _list_ of modules to be
put into packages.preload, without needing to manually copypasta
a blurb of C code. Perhaps even involving bytecode for
static builds (to speedup initialization)
2021-08-30 17:31:44 +02:00
c52ec8f9eb fix(tutor): formatting, layout #15098
* fix(tutor): adjust over-80ch lines and corresponding expect file
* fix(tutor): standardise indentation and formatting, add nowrap modeline

- unifies the formatting/layout, which was a bit inconsistent,
- adds a nowrap modeline

Since the tutor uses a lot of conceals, which are included in the character
count when calculating line wrapping, lines were breaking at what looked like
odd spots, which gives a poor first impression and lowered readability.

I have adjusted some lines to be over 80ch in the source, but once they're
rendered out with conceals, they're actually under 80, so even with nowrap we
don't visually extend past 80.

fix #15088
2021-08-30 05:27:35 -07:00
325fad8983 fix(lsp): resolve bufnr in buf_is_attached (#15523) 2021-08-30 07:46:00 -04:00
3ab73ff81f chore(flake): fix for recent nixpkgs (#15520)
https://github.com/NixOS/nixpkgs/pull/134463 made keepDebugInfo obsolete
for generic packages.
This copies what keepDebugInfo used to do.
2021-08-30 11:55:02 +02:00
215c9b5792 Merge pull request #15498 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-08-30 09:47:39 +02:00
b35de6c525 vim-patch:8.2.2938: after using motion force from feedkeys() it sticks (#15240)
Problem:    After using motion force from feedkeys() it may not be reset.
Solution:   Clear motion_force in clearop(). (closes vim/vim#8323)
21492743e8
2021-08-29 17:08:39 -04:00
119b4daced docs: regenerate 2021-08-29 15:34:51 +00:00
4e66e74fd7 Merge pull request #15304 from bfredl/quantumtheory
fix(lua): preserve argument list ... which has not the same length as #{...}
2021-08-29 17:34:00 +02:00
6896d22b63 fix(lua): preserve argument lists which are not lists 2021-08-29 16:04:50 +02:00
81f4de08bd docs: .git-blame-ignore-revs #15510 2021-08-28 14:00:54 -07:00
636ecd0c3b Merge pull request #15509 from bfredl/miniperf
perf(api): avoid spurious allocations when converting small objects
2021-08-28 18:38:31 +02:00
6fe670878b Merge pull request #15465 from dundargoc/refactor/uncrustify
refactor(codebase): Update uncrustify config and apply it on one file screen.c

The plan is to go through the codebase in batches, and remove the most egregious "make lint"
backlog failures, by applying this config.
2021-08-28 16:59:08 +02:00
705e8f10ac perf(api): avoid spurious allocations when converting small objects
Converter functions use a heap-allocated stack to handle complex
nested objects. However, these are often called with simple,
primitive values like integers or bools wrapped in an Object.
Avoid the memory allocation in this case using kvec_withinit_t
2021-08-28 16:52:01 +02:00
469652d0d5 refactor(lua): rename nlua_msgpack_ => nlua_api_
These functions do not involve msgpack. Initially the nvim api was
sometimes called the "msgpack API", but entry points from vim script
and lua are equally valid (and don't need to reference "msgpack")
2021-08-28 16:50:59 +02:00
2d240024ac refactor: format screen.c with uncrustify 2021-08-28 16:18:36 +02:00
5a66205944 refactor: update uncrustify config file to better fit neovim style guide 2021-08-28 16:17:53 +02:00
04938eed3e fix(lsp): check if buffer is valid in changetracking (#15505) 2021-08-28 11:57:06 +02:00
8af13ed946 fix(process_wait): drain proc.events directly #15501
After a process's refcnt is decremented to zero, it enqueues a
`process_close_event` on its own event queue. In `process_wait`, this
event should be processed immediately so that any process close
callbacks are executed before `process_wait` returns.

Update `process_wait` to always process the process's event queue after
the process is freed, rather than the event queue passed in as an
argument.
2021-08-27 19:17:11 -07:00
ff7f7dd26b Merge #15433 defaults: auto-create backup dir 2021-08-27 18:08:20 -07:00
e5d464d8e0 docs: update 'backupdir' and 'undodir' descriptions 2021-08-27 10:45:25 -06:00
4e516e53bf fix: remove trailing slashes before making directory
Remove the trailing slashes from 'undofile' and 'backupdir' before
creating directories. They cause problems on Windows which doesn't
recognize these slashes as proper path separators.
2021-08-27 10:45:25 -06:00
460019366e feat: defaults: auto-create backup dir
Copy the behavior of 'undodir' and create the last specified directory
in the 'backupdir' option if it doesn't exist.

Use trailing slashes for 'backupdir' as well as 'viewdir' and 'undodir'
by default. Note that 'undodir' always behaves as though it has the
trailing slashes, regardless of whether or not they are present. They
are added to the default option value to minimize surprise.

The '.' value in 'backupdir' is kept because the default behavior for
backups is solely to have a backup if the save of the main file to disk
fails. As soon as that save is completed the backup file is removed, so
generally there is no need to put them in a central location.

Co-authored by: murphy66 <murphy66@gmail.com>
2021-08-27 10:34:44 -06:00
32024787b6 vim-patch:8.1.2229: color number column above/below cursor #15409
Problem:    Cannot color number column above/below cursor differently.
Solution:   Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624)
efae76ab1a
2021-08-27 05:50:37 -07:00
08e223cebb tests(lua/on_yank): assert conditions that fail correctly #15495
The test added in 274a3504a7
does not fail if the code changes are reverted.
2021-08-27 04:54:01 -07:00
f6e662bbe9 feat(lsp): get_border_size(): support repeating border char list #15474 2021-08-27 04:19:17 -07:00
274a3504a7 fix(lua): verify buffer in highlight.on_yank (#15482)
Resolve an issue with deferred clearing of highlight failing if the 
buffer is deleted before the timeout by checking whether the
buffer is valid first.
2021-08-26 16:37:36 +02:00
6ff1e3fa1f fix(man.vim): use -addr=other instead of -range=-1 #15172
-range=-1 requires the current file to have at least <count> lines, whereas -addr=other doesn't.

-addr=other also sets <count> to -1 by default when it is not specified, though this feature seems undocumented.
2021-08-26 04:36:31 -07:00
d8ddd1e425 fix(man.vim): reduce false positives for manReference #14242
Co-authored-by: Anmol Sethi <hi@nhooyr.io>
2021-08-26 04:31:37 -07:00
4c499899b2 Merge #15293 Vimscript "method" syntax
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
2021-08-26 04:26:32 -07:00
2548a9e180 fix(man.vim): filetype=man is too eager #15488
Problem:
"set filetype=man" assumes the user wants :Man features, this does extra
stuff like renaming the buffer as "man://".

Solution:
- old entrypoint was ":set filetype=man", but this is too presumptuous #15487
- make the entrypoints more explicit:
  1. when the ":Man" command is run
  2. when a "man://" buffer is opened
- remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim
- MANPAGER is supported via ":Man!", as documented.

fixes #15487
2021-08-26 02:19:52 -07:00
8d62f5fd58 vim-patch:8.2.3362: buffer overflow when completing long tag name (#15449)
Problem:    Buffer overflow when completing long tag name.
Solution:   Allocate the buffer dynamically. (Gregory Anders, closes vim/vim#8769)
489d60996d
2021-08-25 21:57:18 -04:00
10d7d73b2d Merge pull request #15475 from vigoux/bufupdates-paste
Send correct byte updates on visual paste
2021-08-25 20:56:15 +02:00
14231463a4 fix(bufupdates): send correct updates for visual paste
One step further towards stable tree-sitter.

Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2021-08-25 15:11:39 +02:00
a373ca1d82 Merge pull request #15466 from vigoux/ts-query-auto
feat(ts): add query module in treesitter keys
2021-08-24 17:45:54 +02:00
5d633546bf fix(lsp): enable additional capabilities (#15470)
Declaration, type-definition, and implementation capabilities were
previously disabled if the client received table output from the server
capabilities. The workDoneProgress capability is sent for many servers
for all supported capabilities as part of this table. Default to setting 
capability to table instead of false.
2021-08-23 16:25:15 -04:00
a92e83ac14 vim-patch:6aa5729 (#15463)
Update Scala syntax file
6aa57295cf
2021-08-23 17:58:45 +02:00
5756470a2b build: remove CFLAGS from :version in non-debug builds #15424
A step towards reproducible builds.
2021-08-23 07:57:17 -07:00
8e0963d307 feat(ts): add query module in treesitter keys 2021-08-23 15:34:08 +02:00
c5d76c5b9b fix(doc): example for vim.diff() (#15464) 2021-08-23 13:47:54 +02:00
34b60ec894 Merge pull request #15434 from Dkendal/feature-lua-treesitter-sibling
feat(treesitter): add next, prev sibling method
2021-08-23 09:14:40 +02:00
4b3ffde208 docs: issue templates 2021-08-22 17:37:08 -07:00
fb5db6c7cf docs: issue templates 2021-08-22 16:56:41 -07:00
90b2da16ae fix(window.c): win_close from other tabpage #15454
Fix #15313
2021-08-22 15:27:20 -07:00
da5d023c97 vim-patch:8.2.3358: structurizr files are not recognized (#15417)
Problem:    Structurizr files are not recognized.
Solution:   Recognize the file by contents. (Bastian Venthur, closes vim/vim#8764)
dea561111a
2021-08-22 14:40:59 -07:00
c2a211b8e3 docs: make Lua docstrings consistent #15255
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.

Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
2021-08-22 13:55:28 -07:00
649dbb3b15 Merge pull request #15457 from bfredl/oldmap
refactor(map): remove extra-allocating map_new/map_free functions
2021-08-22 17:29:17 +02:00
de21e6ef3d refactor(map): remove extra-allocating map_new/map_free functions
Note: the reason for removing them is not that there after this refactor
is no use of them, but rather that having them available is an
anti-pattern: they manange an _extra_ heap allocation which has
nothing to do with the functionality of the map itself (khash
manages the real buffers internally). In case there happens to
be a reason to allocate the map structure itself later, this
should be made explicit using xcalloc/xfree calls.
2021-08-22 16:15:38 +02:00
db1b0ee3b3 refactor: replace TRUE/FALSE with true/false #15425 2021-08-22 07:10:57 -07:00
783140c670 fix(doc): move vim.diff doc (#15456)
... to prevent bots from overwriting it
2021-08-22 13:52:56 +02:00
7ebb25cca1 Merge pull request #15451 from bfredl/metamap
perf(map): get rid of unnecessary pointer indirections for maps.
2021-08-22 13:12:58 +02:00
3d3c0c669d feat(api): add lua C bindings for xdiff (#14536)
* feat(api): add lua C bindings for xdiff

* chore: opt.hunk_lines -> opt.result_type

opt.on_hunk now takes precedence over opt.result_type

* chore: fix indents

Fix indents

* chore: change how priv is managed

Assign priv NULL and unconditionally apply XFREE_CLEAR to it when
finished.
2021-08-22 12:22:04 +02:00
c265fd31ab refactor(api): remove unneccesary indirection around handles
These things are just maps to pointers, no need to perform
a huge song and dance around it.
2021-08-22 11:28:47 +02:00
b888018aed refactor(marktree): embed the keymap in the MarkTree struct 2021-08-22 10:46:04 +02:00
b2277a4279 refactor(map): get rid of spurious subsystem_init() functions due to maps 2021-08-22 10:46:04 +02:00
6d23a58b7d refactor(extmark): remove pointer indirection for extmark use of maps 2021-08-22 10:46:01 +02:00
4500253f60 refactor(syntax): don't use pointer indirected maps for no reason 2021-08-22 10:10:15 +02:00
9e651a9d09 perf(map): reduce double pointer indirection to single pointer indirection
the only field of Map(...) was a pointer to a khash_t. make it contain
the struct by value instead.
2021-08-22 09:54:21 +02:00
8331cd13c4 docs #15447
- update ":help 'hidden'" #15410
- update ":help K" #15398
- try to capture some of the debug steps from #12036 (bpftrace, USDT probes)
2021-08-21 18:26:33 -07:00
a90513c24b feat(keywordprg): use :terminal for external commands #15398
Open external 'keywordprg' commands in a :terminal in a new tab. <Esc> is
mapped to stop the job and close the buffer.

Closes #2995
Closes #2761
2021-08-21 17:23:10 -07:00
50b30de200 feat(terminal): TermClose: set exit code in v:event.status #15406
Closes #4713
2021-08-20 10:45:28 -07:00
140084180e feat(treesitter): add next, prev sibling method
Add tsnode methods to change to the next, previous, named or unnamed
nodes.
2021-08-20 11:58:15 -04:00
599af74514 Merge pull request #15295 from gpanders/ftdetect
fix: only source package ftdetect files once
2021-08-20 11:30:43 +02:00
2ae9ff1285 docs: regenerate (#15431)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-08-19 20:28:18 +02:00
69741107e6 Merge pull request #15429 from bfredl/hl_2
perf(treesitter): avoid string lookup of highlight name in hot loop
2021-08-19 19:15:16 +02:00
ff0833cb4e feat(lsp): allow root_dir to be nil (#15430)
According to the protocol definition `rootPath`, `rootUri` and
`workspaceFolders` are allowed to be null.

Some language servers utilize this to provide "single file" support.
If all three are null, they don't attempt to index a directory but
instead only provide capabilities for a single file.
2021-08-19 18:15:18 +02:00
ea39ff5732 feat(lsp): jump to diagnostics by position (#14795) 2021-08-19 11:36:01 -04:00
2460f0a702 perf(treesitter): avoid string lookup of highlight name in hot loop
These numbers are guaranteed to be stable even if you do "highlight
clear" (all attributes disappear, but not the id to name mapping itself)
2021-08-19 16:45:04 +02:00
d088066fa1 Merge pull request #15422 from bfredl/syn_name2id_go_brr
feat(highlights): some improvements and perf fixes
2021-08-19 15:48:22 +02:00
19a0d90bb3 Merge #15410 defaults: 'hidden', 'nojoinspaces'
ref #6289
2021-08-19 06:13:08 -07:00
bb4b4d79a8 perf(highlight): use a hashtable for highlight group names
syn_name2id and syn_check_group go brr.

Note: this has impact mostly when using multiple filetypes,
as the old syn_name2id was optimized to return latest
added groups quickly (which will be the latest filetype)
2021-08-19 15:08:50 +02:00
fca52f5f32 feat(match): allow hl group to be defined after :match command 2021-08-19 15:08:50 +02:00
d8ab8cccd0 test: update tests to work with 'hidden' 2021-08-18 12:17:12 -06:00
a9f563ab62 refactor(highlight): make syn_check_group alloc free for existing group 2021-08-18 14:19:01 +02:00
7bff642169 Merge pull request #15249 from dundargoc/refactor/a-song-of-true-and-false
refactor: replace TRUE/FALSE with true/false
2021-08-18 10:10:42 +02:00
d417e67e59 feat(defaults): set nojoinspaces 2021-08-17 16:39:04 -06:00
f6c72b745c feat(defaults): set hidden 2021-08-17 16:38:39 -06:00
15b736d6e8 Merge pull request #15396 from gpanders/options-no-vi-vim
refactor(options): remove vi/vim default value distinction
2021-08-17 16:46:36 +02:00
8e926a0984 refactor(options): remove vi/vim default value distinction 2021-08-17 08:07:41 -06:00
35c6aef1c9 docs: update pull request workflow #15243
The WIP, RFC and RDY stage workflow is outdated and unnecessary. The new
workflow utilize the draft pull request on GitHub.
2021-08-17 05:58:49 -07:00
2cb8db34e3 feat: defaults: set undo points in <C-U> and <C-W> (#15400) 2021-08-16 18:28:52 -07:00
3954537b9e feat(defaults): remove 'options' from viewoptions #15397
ref #6289
2021-08-16 13:05:24 -07:00
e01b88c799 Merge pull request #15399 from mfussenegger/private-lsp-comments
docs(lsp): Prevent internal comments from showing as vim.lsp.init docs
2021-08-16 21:32:18 +02:00
c1e17866c8 docs(lsp): prevent internal comments from showing as vim.lsp.init docs 2021-08-16 20:27:51 +02:00
4ba74953b5 feat(defaults): switchbuf=uselast #15394 2021-08-16 11:20:46 -07:00
7215d35694 feat: defaults: inccommand=nosplit #15395 2021-08-16 10:39:17 -07:00
0aa8128aaa feat(defaults): map CTRL-L to search highlights, update diffs #15385 2021-08-16 08:31:14 -07:00
7146103be2 ci: increase clint line length limit to 100 characters (#15252) 2021-08-16 15:32:36 +02:00
57fc3d3ed7 Merge pull request #15386 from jamessan/32-bit-revert
Revert "tests: unit: fix preprocess: pass -m32 for 32bit ABI (#11073)"
2021-08-16 07:29:17 -04:00
29712aef60 fix(autocmd.c): fix conditions in block_autocmds, unblock_autocmds #15372
Logic got swapped in 7574918dc7.
We didn't notice it since v:termresponse isn't really used yet. #6279
2021-08-16 00:43:21 -07:00
e9dd640897 vim-patch:8.2.3295: 'cursorline' should not apply to 'breakindent' #15281
Problem:    'cursorline' should not apply to 'breakindent'.
Solution:   Make 'cursorline' apply to 'breakindent' and 'showbreak'
            consistently. (closes vim/vim#8684)
4f33bc20d7
2021-08-16 00:27:04 -07:00
54726e8bb9 fix(defaults): do not map Y in visual-mode #15387
Y in visual-mode is unrelated to the normal-mode behavior.

reverts part of #13268
2021-08-16 00:13:25 -07:00
5a111c1b02 feat(defaults): map Y to y$ #13268
rationale:
- consistent with D and Y
- long recommended by Vim's own ":help Y"

close #13268
close #416
ref #6289
2021-08-15 21:24:59 -07:00
aa07d06bf4 Merge pull request #15363 from dundargoc/ci/squash
ci: ensure all PRs are up to date with master before attempting squash
2021-08-15 11:39:08 -04:00
c6ef95606f fix(ci): re-run GHA for ready_for_review events (#15377)
By default, the pull_request target only runs for the "opened",
"synchronize", and "reopened" events.

Since we've disabled GHA CI for "draft" PRs, the "ready_for_review"
event also needs to be included so CI is automatically run when leaving
draft status.
2021-08-15 15:27:50 +02:00
9367aee62d ci: ensure all PRs are up to date with master before attempting squash
This is to ensure unrelated authors don't get credited.
2021-08-15 12:38:05 +02:00
0f2af87a38 Merge pull request #15320 from neovim/julia
vim-patch:8.2.3283: Julia filetype is not recognized
vim-patch:6aa5729: Add Julia runtime files
2021-08-15 11:22:30 +02:00
65f32f0f19 vim-patch:6aa5729
Add Julia runtime files.
6aa57295cf
2021-08-15 11:02:19 +02:00
0dc4bec69e vim-patch:8.2.3283: Julia filetype is not recognized
Problem: Julia filetype is not recognized
Solution: Add filetype detection. (Christian Clason, closes #8700)

issue: vim/vim#7498
vim-patch: vim/vim@0eec851
2021-08-15 11:02:12 +02:00
d805eb3e05 Merge pull request #15370 from gpanders/cmake-libluv
build: prioritize statically built libluv in search
2021-08-14 21:23:58 -04:00
084b28bec8 Merge pull request #15367 from jamessan/release-fixes
Clean up release handling
2021-08-14 21:22:13 -04:00
bcca62a760 Merge pull request #15368 from jamessan/fragility
test(lsp): disable finicky test when TEST_SKIP_FRAGILE is set
2021-08-14 21:21:50 -04:00
f8eae29d39 build: prioritize statically built libluv in search
When libluv is built statically it appends an '_a' suffix to the library
name. This affects CMake's ability to find the bundled version of libluv
(which is built statically) when there is a dynamic version of the
library also built on the system, which does not have the '_a' suffix.

Prioritize searching for 'libluv_a' first before falling back to
'libluv'. This will ensure the bundled version of libluv is always found
first before any system versions of libluv. In cases where we are not
using bundled libraries, CMake will still safely fall through to finding
'libluv' since package managers do not typically provide static system
libraries.
2021-08-14 06:53:52 -06:00
6f965f41df build: use RelWithDebInfo build for nightlies, Release for releases
Unlike Release build type, RelWithDebInfo does not disable asserts.
This helps get better debug info from people brave enough to use the
nightly builds, but shouldn't be used for official releases.

[skip ci]
2021-08-13 23:32:15 -04:00
f027c5e1e4 build: update appdata.xml version in release commit
Adding the version we just released in the "version bump" commit is
useless, since that means the actual release only reports the old
version.

Closes #15362

[skip ci]
2021-08-13 23:32:10 -04:00
222cd43222 ci: comment from bot is more helpful in case of conflict (#15359)
Also change PR title to follow conventional commits convention.
2021-08-13 15:58:31 +02:00
ce172d8d4a ci: fix typo squasher by changing trigger to "pull_request_target" (#15357)
The "pull_request" trigger only enables read-access for forks,
"pull_request_target" is required if a fork is to be a trigger. Also
changed the python script to reflect this change.
2021-08-13 15:18:15 +02:00
6f0d4ccc43 Merge pull request #15341 from dundargoc/ci/link-to-discourse
chore: link to discourse when choosing issue template
2021-08-13 10:47:44 +02:00
20c1e5757d chore: link to Discourse when choosing issue template for user questions 2021-08-13 10:34:20 +02:00
b2994e35c9 feat(v:lua): support calling v:lua as a method 2021-08-13 01:11:36 +01:00
da9005af79 fix(v:lua): fix emsg when calling v:lua directly
v:lua expressions are represented using vvlua_partial. As v:lua isn't
intended to be called directly, it's given an empty pt_name.

Because of this, calling v:lua directly like "v:lua()" will cause "E117:
Unknown function: ", with an empty name.

Instead, have call_func() show the name "v:lua" in the emsg.
2021-08-12 22:35:25 +01:00
5503d8e28b fix(eval_lambda): cherry-pick leak fix from v8.1.2107
That patch also includes a test using test_refcount() for lambdas, but
such test functions are N/A for Nvim.
2021-08-12 22:35:25 +01:00
5d88349817 feat(eval): partially port v8.1.1915
Cannot be fully ported as chdir() hasn't been ported yet.
2021-08-12 22:35:25 +01:00
56b56a76e8 vim-patch:8.1.1911: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
64b4d73524

Note that the old-style version of Test_byteidx() was already translated
to a Lua test in 069_multibyte_formatting_spec.lua. Keep both versions,
using Test_byteidx() to mainly test the method call syntax for byteidx()
and byteidxcomp().
2021-08-12 22:35:24 +01:00
7925f0b633 vim-patch:8.1.1909: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make a few more functions usable as a method.
e49fbff384
2021-08-12 22:35:24 +01:00
5fbc1a49c7 vim-patch:8.1.1888: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
073e4b92e6

test_popup.vim already has the changes from this patch (they're N/A
anyway).
2021-08-12 22:35:24 +01:00
41dbd3a2e0 vim-patch:8.1.1879: more functions can be used as methods
Problem:    More functions can be used as methods.
Solution:   Make float functions usable as a method.
93cf85f9ef

Fix atan2() doc typo (patch referred to it as atan()).
Adjust Test_fmod() method test to expect "str2float('nan')".
2021-08-12 22:35:23 +01:00
7474db98af vim-patch:8.1.1878: negative float before method not parsed correctly
Problem:    Negative float before method not parsed correctly.
Solution:   Apply "!" and "-" in front of expression before using ->.
9cfe8f6e68
2021-08-12 22:35:23 +01:00
98dfe4adc4 vim-patch:8.1.1863: confusing error when using a builtin function as method
Problem:    Confusing error when using a builtin function as method while it
            does not support that.
Solution:   Add a specific error message.
9174639a82
2021-08-12 22:35:23 +01:00
287a77ef51 vim-patch:8.1.1861: only some assert functions can be used as a method
Problem:    Only some assert functions can be used as a method.
Solution:   Allow using most assert functions as a method.
24278d2407

Port tests to assert_spec.lua.
2021-08-12 22:35:22 +01:00
f03dd22f0d vim-patch:8.1.1835: cannot use printf() as a method
Problem:    Cannot use printf() as a method.
Solution:   Pass the base as the second argument to printf().
fd8ca21b3f
2021-08-12 22:35:22 +01:00
5811390f82 vim-patch:8.1.1834: cannot use a lambda as a method
Problem:    Cannot use a lambda as a method.
Solution:   Implement ->{lambda}(). (closes vim/vim#4768)
22a0c0c4ec

Add an additional lua_funcname argument to call_func_rettv() to maintain
support for v:lua.

A memory leak was introduced with this patch that was fixed in
v8.1.2107.
2021-08-12 22:35:22 +01:00
32589341a4 vim-patch:8.1.1828: not strict enough checking syntax of method invocation
Problem:    Not strict enough checking syntax of method invocation.
Solution:   Check there is no white space inside ->method(.
5184132ec0
2021-08-12 22:35:21 +01:00
daedbd9312 vim-patch:8.1.1821: no test for wrong number of method arguments
Problem:    No test for wrong number of method arguments.
Solution:   Add a test.
f97d46f816
2021-08-12 22:35:21 +01:00
d41b87e070 vim-patch:8.1.1820: using expr->FuncRef() does not work
Problem:    Using expr->FuncRef() does not work.
Solution:   Make FuncRef work as a method.
761fdf01c6
2021-08-12 22:35:21 +01:00
8d1ca37d1f vim-patch:8.1.1816: cannot use a user defined function as a method
Problem:    Cannot use a user defined function as a method.
Solution:   Pass the base as the first argument to the user defined function
            after "->". (partly by FUJIWARA Takuya)
fcfe1a9b89
2021-08-12 22:35:20 +01:00
aa2dc8b7b4 vim-patch:8.1.1809: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Add has_key(), split(), str2list(), etc.
a74e4946de
2021-08-12 22:35:20 +01:00
003c8acc8a vim-patch:8.1.1807: more functions can be used as a method
Problem:    More functions can be used as a method.
Solution:   Add append(), appendbufline(), assert_equal(), etc.
            Also add the :eval command.
25e42231d3

:eval is already ported.
2021-08-12 22:35:20 +01:00
e6be6c307a vim-patch:8.1.1803: all builtin functions are global
Problem:    All builtin functions are global.
Solution:   Add the method call operator ->.  Implemented for a limited number
            of functions.
ac92e25a33

- Note that to *exactly* port hunk @@ -7376,18 +7444,19 from
  handle_subscript(), we need the :scriptversion patches (I have an open
  PR for those, but this patch works fine without them anyway).
- Port call_internal_func() from v7.4.2058.
- Adjust some error messages in tests, as they rely on the Blob patches.
- Add a modeline to test_method.vim.

Ignore the global_functions and base_method tables and prefer the
current GPerf implementation. Instead, add an extra base_arg field to
VimLFuncDef that holds the number of the argument to use as the base
(1-indexed, so that 0 may be used to refer to functions that cannot be
used as methods).

This also means we support using any argument as a base from the get-go,
rather than just the first (Vim includes this ability in future patches,
however).

To mark a function as usable as a method, use the "base" key as
described in eval.lua.
2021-08-12 22:35:19 +01:00
4042ae5a2b vim-patch:8.1.1800: function call functions have too many arguments
Problem:    Function call functions have too many arguments.
Solution:   Pass values in a funcexe_T struct.
c6538bcc1c

Use FUNCEXE_INIT to initialize funcexe_T instances.

call_callback() and other Vim listener related stuff is N/A.
2021-08-12 22:31:18 +01:00
60dd76c7e2 vim-patch:8.1.1638: running tests leaves some files behind
Problem:    Running tests leaves some files behind.
Solution:   Delete the files. (Ozaki Kiichi, closes vim/vim#4617)
3940ec6d41

Required for v8.1.1888.

N/A patches for version.c:

vim-patch:8.1.1912: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make channel and job functions usable as a method.
vim/vim@570497a
2021-08-12 17:16:34 +01:00
1918638c67 test(oldtest): cherry-pick needed test functions from v8.1.1336
Cherry-pick Test_call() and Test_cindent_func().

Required for v8.1.1911 and v8.1.1915.
2021-08-12 17:16:34 +01:00
e0bdc9b89c fix(eval): cherry-pick emsg changes from v8.1.0736
v8.1.0736 made some changes for making some emsgs more specific.
Includes the change for Test_lambda_fails() in test_lambda.vim.
Adjust relevant functionaltests to expect the new emsgs.

This patch has been fully ported in my Blob port PR, but it hasn't been
merged yet, so just use what we need from it for now.

Required for v8.1.1821.
2021-08-12 17:16:33 +01:00
c0767bd4f3 refactor: replace TRUE/FALSE with true/false 2021-08-12 10:37:40 +02:00
7d2233fad0 Merge pull request #15336 from bfredl/plines
refactor(plines): move "plines" (size of printed lines) family of function to own file
2021-08-11 17:38:36 +02:00
167514fe83 fix: only source package ftdetect files once
ftdetect files in start packages are sourced once from the :runtime
command in filetype.vim and once when packages are loaded. Change the
package loading logic to only source ftdetect files for opt packages to
avoid this duplication.
2021-08-11 09:35:21 -06:00
28b5c73bf8 refactor(plines): move horizontal size functions to plines.c
fix style.
2021-08-11 17:10:52 +02:00
2c60f7c991 Merge pull request #15335 from muniter/set_extmark_error_cleanup
refactor(api): remove redundant api_set_error
2021-08-11 10:38:21 +02:00
8bf318dcde refactor(plines): what is basic compiler optimizations? 2021-08-10 23:22:25 +02:00
ac56a27a10 refactor(plines): remove implicit curwin chartabsize() function 2021-08-10 23:18:12 +02:00
b506643dfc refactor(plines): style of new plines.c file 2021-08-10 23:06:48 +02:00
7f71e8a6b3 refactor(plines): move out plines related code from misc1.c 2021-08-10 22:59:29 +02:00
d475955ed3 refactor(api): remove redundant api_set_error
This error is already handled by 'find_buffer_by_handle'
2021-08-10 15:55:03 -05:00
0465341e16 refactor(plines): remove implicit curwin plines_nofill() function 2021-08-10 22:39:04 +02:00
a177c7df09 refactor(plines): remove implicit curwin plines() function 2021-08-10 22:32:08 +02:00
c479b90359 Merge pull request #15253 from spywhere/float-win-scl-fix
Fix sign column auto with minimum break floating window minimal style
2021-08-10 22:14:52 +02:00
adebbebdd7 fix(lsp): properly handle nil lines when trimming empty lines (#15325) 2021-08-10 20:52:30 +02:00
c5baba065c Merge pull request #15329 from dundargoc/github/bug-template/make-behavior-mandatory
ci: make all questions mandatory in bug template
2021-08-10 14:35:36 +02:00
f43a8f0eda ci: make all questions mandatory in bug template 2021-08-10 12:18:55 +02:00
1a10acb997 fix(lsp): floating popup should take offset_x into account when positioning (#15297) 2021-08-09 23:56:58 +02:00
33b4513b89 doc: Document -complete=lua option (#15102) 2021-08-09 21:21:14 +02:00
3cacd108d0 docs: regenerate (#15324)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-08-09 20:54:28 +02:00
0e9d97896a Merge pull request #15307 from muniter/update-help.txt
docs(help.txt): Add a tag to the neovim api.
2021-08-09 19:51:47 +02:00
a3d5f391cf docs: Add some references to LSP specification (#15321) 2021-08-09 19:45:00 +02:00
cad5f01cf3 docs: elaborate on commitlint rules (#15322)
linter requires lowercase at start and no period at end of description
2021-08-09 18:46:33 +02:00
109a417e21 docs(help.txt): add treesitter to the main help file 2021-08-09 09:17:02 -05:00
4667bfb732 docs(help.txt): add a tag to the neovim api 2021-08-09 09:16:56 -05:00
7dbbd5d8b1 ci: create GitHub Action that squashes all typo PRs into a single PR (#15041)
The action adds all pull-request authors (and Marvim) as a co-author to the
newly created PR and also links to the closed PRs.
2021-08-09 15:21:50 +02:00
9ef7003c38 Merge pull request #15312 from janlazo/vim-8.2.2639
vim-patch:8.1.{1818},8.2.{1464,2639,2814,2947,2976,2986,3114,3141,3160,3198}
2021-08-09 08:28:36 -04:00
0a43b4d51e refactor(sign): include longer sign column option 2021-08-09 11:09:22 +07:00
c8f57f6ded fix(sign): reset auto sign column with minimum in float win minimal style 2021-08-09 11:09:22 +07:00
292148b08b vim-patch:8.2.3141: no error when using :complete for :command without -nargs
Problem:    No error when using :complete for :command without -nargs.
Solution:   Give an error. (Martin Tournoij, closes vim/vim#8544, closes vim/vim#8541)
de69a7353e

N/A patches for version.c:

vim-patch:8.1.1801: cannot build without the +eval feature

Problem:    Cannot build without the +eval feature.
Solution:   Always define funcexe_T.
505e43a20e

vim-patch:8.1.1818: unused variable

Problem:    Unused variable.
Solution:   Remove the variable. (Mike Williams)
b4a88a0441

vim-patch:8.2.1464: Vim9: build warning for unused variable

Problem:    Vim9: build warning for unused variable.
Solution:   Delete the variable declaration.
829ac868b7

vim-patch:8.2.2639: build failure when fsync() is not available

Problem:    Build failure when fsync() is not available.
Solution:   Add #ifdef.
5ea79a2599

vim-patch:8.2.2814: Vim9: unused variable

Problem:    Vim9: unused variable. (John Marriott)
Solution:   Adjust #ifdef.
b06b50dfa0

vim-patch:8.2.2947: build failure without the channel feature

Problem:    Build failure without the channel feature.
Solution:   Add back #ifdef. (John Marriott)
f5bfa8faa7

vim-patch:8.2.2976: build failure without the +eval feature

Problem:    Build failure without the +eval feature.
Solution:   Add #ifdefs.
8de901e1f1

vim-patch:8.2.2986: build failure without the profile feature

Problem:    Build failure without the profile feature.
Solution:   Add #ifdef.
d9f31c13d2

vim-patch:8.2.3114: Amiga-like systems: build error using stat()

Problem:    Amiga-like systems: build error using stat().
Solution:   Only build swapfile_process_running() on systems where it is
            actually used. (Ola Söder, closes vim/vim#8519)
599a6e5b36
2021-08-08 22:29:55 -04:00
43a874ab74 vim-patch:8.2.3198: cannot use 'formatlistpat' for breakindent
Problem:    Cannot use 'formatlistpat' for breakindent.
Solution:   Use a negative list indent. (Maxim Kim, closes vim/vim#8594)
f674b358fc

Port get_showbreak_value() from patch v8.1.2281
to avoid breaking changes when porting older patches.
2021-08-08 22:22:34 -04:00
f89a275e32 vim-patch:8.2.3160: 'breakindent' does not work well for bulleted lists
Problem:    'breakindent' does not work well for bulleted and numbered lists.
Solution:   Add the "list" entry to 'breakindentopt'. (Christian Brabandt,
            closes vim/vim#8564, closes vim/vim#1661)
4a0b85ad01
2021-08-08 22:22:34 -04:00
68f61b167e vim-patch:8.2.3285: scdoc filetype is not recognized (#15294)
Problem:    Scdoc filetype is not recognized.
Solution:   Add filetype detection. (Gregory Anders, closes vim/vim#8701)
dd097bdc13
2021-08-08 18:27:34 -04:00
cdbd54972b option: pvs/v557 (#14740)
Replace STRCAT with STRLCAT() to always NUL-terminate "errbuf" array.
2021-08-08 17:27:50 -04:00
a2909aa35f ci(labeler): apply label tests if only files under test have changed (#15305) 2021-08-08 11:03:55 +02:00
35041432bf ci(forms): fix "vim" description in bug template
Make clear that the version should be specified in any case, including patch level
2021-08-07 18:14:03 +02:00
c9131ef9b5 docs: fix paragraph for BufEnter in the documentation (#15301) 2021-08-07 12:18:40 +02:00
faa3007927 Merge pull request #14767 from theHamsta/no-treesitter-mapping-to-non-existent
fix(treesitter): do not map hl_group when no mapping is set
2021-08-07 11:44:41 +02:00
a1cc146405 ci(labeler): apply documentation label only for changes exclusively in runtime/doc/* (#15298) 2021-08-07 10:36:15 +02:00
e7bde44d6d fix(lsp): prevent duplicate lines seperated by newlines (#15284) 2021-08-06 17:15:49 -04:00
912152d635 chore: remove reference to nvim-treesitter in comment 2021-08-06 22:08:45 +02:00
f489d98653 fix(treesitter): do not map hl_group when no mapping is set
This changes the behavior of the hl_cache to the old one.

- when the capture exists as a hlgroup -> use it
- when hl_map contains a mapping -> use it
- else do nothing (before: map capture to non-existing capture)

Before also captures `@foo.bar` would intend to use the hlgroup `foo.bar`
which results in a confusing error since hlgroups can't contain dots.
2021-08-06 22:04:28 +02:00
f22326ef09 ci(labeler): add "tests" and "ci" labels to the labeler action (#15287)
Also added "CONTRIBUTING.md" file under the "documentation" label since
it gets changed fairly often.
2021-08-06 13:15:29 +02:00
22072b11e8 ci(labeler): fix syntax so changes under src/nvim/lua are registered (#15285)
The labeler action requires a glob (*) to denote files under a
directory.
2021-08-06 12:16:24 +02:00
41912bf777 Merge pull request #15283 from jamessan/pending-c-parsers
test(treesitter): skip all parsers tests if parsers aren't installed
2021-08-06 10:53:18 +02:00
8336488ce1 test(treesitter): skip all parsers tests if parsers aren't installed 2021-08-05 21:41:55 -04:00
5130bc071e ci(tests): skip "stale events on channel close" (#15278)
This test sporadically hangs CI (cf. #14083); skip until the actual code is fixed.
2021-08-05 15:07:26 +02:00
3d18359672 Merge pull request #15257 from gpanders/remove-set_virtual_text
refactor: remove remaining references to nvim_buf_set_virtual_text
2021-08-04 09:28:38 +02:00
545e05d2fe chore(vim-patch.sh): replace hub with gh (#15162) 2021-08-03 19:52:48 +02:00
2093b12b82 refactor: remove remaining references to nvim_buf_set_virtual_text 2021-08-03 11:39:46 -06:00
8baf7bce2b Merge pull request #15226 from zeertzjq/vim-8.1.2029
vim-patch:8.1.2029,8.1.2117,8.1.2214,8.2.3204
2021-08-02 19:23:57 -04:00
93443d59a9 Merge pull request #15233 from baahrens/doc-treesitter-fix-typos
doc(treesitter): Fix typos
2021-08-02 15:18:37 +02:00
3f9a838454 ci: disable false "footer-leading-blank" warning from commitlint (#15238) 2021-08-02 11:22:43 +02:00
141f0038db docs: fixed link to label "good-first-issue" (#15239) 2021-08-02 11:01:28 +02:00
535c762ff7 Merge pull request #15129 from dundargoc/action/commitlint
ci: add commit linter to GitHub Actions.
2021-08-02 00:08:31 +02:00
c24daf5a10 vim-patch:8.2.3204: display garbled when 'cursorline' is set and lines wrap
Problem:    Display garbled when 'cursorline' is set and lines wrap. (Gabriel
            Dupras)
Solution:   Avoid inserting lines twice.
c9e7e344ed
2021-08-02 05:41:17 +08:00
68f0670dfc vim-patch:8.1.2214: too much is redrawn when 'cursorline' is set
Problem:    Too much is redrawn when 'cursorline' is set.
Solution:   Don't do a complete redraw. (closes vim/vim#5079)
11a58af66f
2021-08-02 05:41:17 +08:00
56b437a6c7 vim-patch:8.1.2117: CursorLine highlight used while 'cursorline' is off
Problem:    CursorLine highlight used while 'cursorline' is off.
Solution:   Check 'cursorline' is set. (cloes vim/vim#5017)
49474ca122
2021-08-02 05:41:17 +08:00
1666fe9dfe vim-patch:8.1.2029: cannot control 'cursorline' highlighting well
Problem:    Cannot control 'cursorline' highlighting well.
Solution:   Add "screenline". (Christian Brabandt, closes vim/vim#4933)
017ba07fa2
2021-08-02 05:41:17 +08:00
337b1b31ac Merge pull request #15234 from janlazo/vim-8.2.3164
vim-patch:8.2.{3164,3167,3192,3208,3213,3214,3225,3231,3243,3246,3247,3250,3253,3256,3260}
2021-08-01 12:17:39 -04:00
de74fcc74c fixup! remove DYNAMIC_ICONV
Code for "DYNAMIC_ICONV" macro was dead since v0.3.0.
d87e5d7016
2021-08-01 11:27:11 -04:00
e98eba9086 vim-patch:8.2.3256: executable test may fail on new Ubuntu system
Problem:    Executable test may fail on new Ubuntu system.
Solution:   Consider /usr/bin/cat and /bin/cat the same.
bf634a0a8b
2021-08-01 11:27:11 -04:00
20fc0519af vim-patch:8.2.3246: memory use after free
Problem:    Memory use after free.
Solution:   When clearing a string option set the pointer to "empty_option".
77111e2bfc
2021-08-01 11:27:11 -04:00
5e4fcc8b36 vim-patch:8.2.3225: incsearch highlighting is attempted halfway a mapping
Problem:    Incsearch highlighting is attempted halfway a mapping.
Solution:   Only do incsearch highlighting if keys were typed or there is no
            more typeahead.
ccb148ac63
2021-08-01 11:26:54 -04:00
d95e28f5ce vim-patch:8.2.3213: NOCOMPOUNDSUGS entry in spell file not tested
Problem:    NOCOMPOUNDSUGS entry in spell file not tested.
Solution:   Add a test. (Dominique Pellé, closes vim/vim#8624)
9c9472ff49
2021-08-01 11:26:54 -04:00
34f3c5cc96 vim-patch:8.2.3167: get E12 in a job callback when searching for tags
Problem:    Get E12 in a job callback when searching for tags. (Andy Stewart)
Solution:   Use the sandbox only for executing a command, not for searching.
            (closes vim/vim#8511)
547f94f330

N/A patches for version.c:

vim-patch:8.2.3164: MS-Windows: reported version lacks patchlevel

Problem:    MS-Windows: reported version lacks patchlevel, causing some update
            tools to update too often. (Klaus Frank)
Solution:   Add the patchlevel to the version. (Christian Brabandt)
0894e0d808

vim-patch:8.2.3192: build failure with small version

Problem:    Build failure with small version (Tony Mechelynck).
Solution:   Remove stray #ifdef.
11d7e62f1d

vim-patch:8.2.3208: dynamic library load error does not mention why it failed

Problem:    Dynamic library load error does not mention why it failed.
Solution:   Add the error message. (Martin Tournoij, closes vim/vim#8621)
1a3e5747b7

vim-patch:8.2.3214: MS-Windows: passing /D does not set the install location

Problem:    MS-Windows: passing /D does not set the install location.
Solution:   Adjust how the installer uses $VIM. Update the documentation.
            (Christian Brabandt, closes vim/vim#8605)
7d60384a00

vim-patch:8.2.3231: build failure with small features

Problem:    Build failure with small features.
Solution:   Adjust #ifdef.
9088784972

vim-patch:8.2.3243: MS-Windows: "edit with multiple Vim" choice is less useful

Problem:    MS-Windows: the "edit with multiple Vim" choice is not that
            useful.
Solution:   Change it to "Edit with multiple tabs". (Michael Soyka,
            closes vim/vim#8645)
83cd0156e0

vim-patch:8.2.3247: using uninitialized memory when checking for crypt method

Problem:    Using uninitialized memory when checking for crypt method.
Solution:   Check the header length before using the salt and seed.
77ab4e28a2

vim-patch:8.2.3250: MS-Windows: cannot build with libsodium

Problem:    MS-Windows: cannot build with libsodium.
Solution:   Change FEAT_SODIUM into HAVE_SODIUM. (Christian Brabandt,
            closes vim/vim#8668, closes vim/vim#8663)
1790be6cb6

vim-patch:8.2.3253: channel test fails randomly

Problem:    Channel test fails randomly.
Solution:   Add a sleep after sending the "echoerr" command. (Michael Soyka)
890ee4e2be

vim-patch:8.2.3260: build failure with small features

Problem:    Build failure with small features.
Solution:   Add #ifdef.
335c8c7b20
2021-08-01 11:26:53 -04:00
4c605ec78a doc(treesitter): Fix typos 2021-08-01 17:09:19 +02:00
f54340d488 docs: add description of each type 2021-08-01 14:29:29 +02:00
5f3f4263b4 ci: add commit linter to GitHub Actions 2021-08-01 12:45:17 +02:00
51251e1dc7 Merge pull request #15217 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-08-01 11:26:00 +02:00
a5c25e4f3e Merge pull request #15228 from janlazo/vim-8.2.3002
vim-patch:8.2.{3002,3019,3025,3030,3032,3044,3046,3063,3101,3115,3119,3120,3131,3136,3140,3157,3163,3218,3245,3254}
2021-07-31 19:15:36 -04:00
927383f212 vim-patch:8.2.3136: no test for E187 and "No swap file"
Problem:    No test for E187 and "No swap file".
Solution:   Add a test. (Dominique Pellé, closes vim/vim#8540)
fe3418abe0
2021-07-31 18:32:01 -04:00
18b12bcee1 vim-patch:8.2.3115: Coverity complains about free_wininfo() use
Problem:    Coverity complains about free_wininfo() use.
Solution:   Add a condition that "wip2" is not equal to "wip". (Neovim vim/vim#14996)
b5098060f4

This fix came from https://github.com/neovim/neovim/pull/14996.
This commit adds only a comment to be in sync with Vim.

N/A patches for version.c:

vim-patch:8.2.3063: crash when switching 'cryptmethod' to xchaha20 with undo file

Problem:    Crash when switching 'cryptmethod' to xchaha20 with an existing
            undo file. (Martin Tournoij)
Solution:   Disable reading undo file when decoding can't be done inplace.
            (issue vim/vim#8467)
65aee0b714

vim-patch:8.2.3101: missing function prototype for vim_round()

Problem:    Missing function prototype for vim_round().
Solution:   Add the prototype.
67b17a6fc6

vim-patch:8.2.3119: compiler warning for unused argument

Problem:    Compiler warning for unused argument.
Solution:   Add UNUSED.
6a9e5c69cf

vim-patch:8.2.3120: crypt with sodium test fails on MS-Windows

Problem:    Crypt with sodium test fails on MS-Windows.
Solution:   Make the tests pass. (closes vim/vim#8428)
db86472770

vim-patch:8.2.3131: MS-Windows: ipv6 channel test is very flaky in the GUI

Problem:    MS-Windows: ipv6 channel test is very flaky in the GUI.
Solution:   Skip the test.
981217c11f

vim-patch:8.2.3140: MS-Windows: ipv6 channel test is very flaky also without GUI

Problem:    MS-Windows: ipv6 channel test is very flaky also without the GUI.
Solution:   Skip the test also without the GUI.
482d2f37a5

vim-patch:8.2.3157: crypt test may fail on MS-Windows

Problem:    Crypt test may fail on MS-Windows.
Solution:   Ignore "[unix]" in the file message. (Christian Brabandt,
            closes vim/vim#8561)
16e26a3116

vim-patch:8.2.3218: when using xchaha20 crypt undo file is not removed

Problem:    When using xchaha20 crypt undo file is not removed.
Solution:   Reset 'undofile' and delete the file. (Christian Brabandt,
            closes vim/vim#8630, closes vim/vim#8467)
8a4c812ede

vim-patch:8.2.3245: the crypt key may appear in a swap partition

Problem:    The crypt key may appear in a swap partition.
Solution:   When using xchaha20 use sodium_mlock(). (Christian Brabandt,
            closes vim/vim#8657)
131530a54d
2021-07-31 18:31:41 -04:00
5cead86975 fixup! vim-patch:8.2.3019: location list only has the start position. 2021-07-31 16:58:10 -04:00
0c93525340 docs: regenerate 2021-07-31 20:26:57 +00:00
24f2b9ef1c fix(lsp): Include client name in handler error messages (#15227)
Makes it easier to tell with language server caused an error.
2021-07-31 22:26:02 +02:00
e4fedf5156 vim-patch:8.2.3254: win_gettype() does not recognize a quickfix window
Problem:    win_gettype() does not recognize a quickfix window.
Solution:   Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes vim/vim#8676)
28d8421bfb
2021-07-31 15:10:51 -04:00
8738ce8c41 vim-patch:8.2.3163: location list window may open a wrong file
Problem:    Location list window may open a wrong file.
Solution:   Also update the qf_ptr field. (Wei-Chung Wen, closes vim/vim#8565,
            closes vim/vim#8566)
1557b16dad
2021-07-31 15:10:50 -04:00
64ad770fbe vim-patch:8.2.3025: not enough tests for quickfix end_col and end_lnum
Problem:    Not enough tests for quickfix end_col and end_lnum.
Solution:   Add a few more test cases. (Shane-XB-Qian, closes vim/vim#8409)
0d5e1ec37f
2021-07-31 15:10:50 -04:00
59e96717d2 vim-patch:8.2.3019: location list only has the start position.
Problem:    Location list only has the start position.
Solution:   Make it possible to add an end position. (Shane-XB-Qian,
            closes vim/vim#8393)
6864efa596

N/A patches for version.c:

vim-patch:8.2.3002: Vim doesn't abort on a fatal Tcl error

Problem:    Vim doesn't abort on a fatal Tcl error.
Solution:   Change emsg() to iemsg(). (Dominique Pellé, closes vim/vim#8383)
affd0bc626

vim-patch:8.2.3030: Coverity reports a memory leak

Problem:    Coverity reports a memory leak.
Solution:   Fix the leak and a few typos. (Dominique Pellé, closes vim/vim#8418)
cb54bc6562

Patch v8.2.3022 is mostly N/A but cannot be included here
because of new feature check for "has()".

vim-patch:8.2.3032: build problems with MSVC, other crypt issues with libsodium

Problem:    Build problems with MSVC, other crypt issues with libsodium.
Solution:   Adjust MSVC makefile. Disable swap file only when 'key' is set.
            Adjust error message used when key is wrong.  Fix Coverity issues.
            (Christian Brabandt, closes vim/vim#8420, closes vim/vim#8411)
226b28b961

vim-patch:8.2.3044: Amiga MorphOS and AROS: process ID is not valid

Problem:    Amiga MorphOS and AROS: process ID is not valid.
Solution:   Use FindTask to return something which is unique to all processes.
            (Ola Söder, closes vim/vim#8444)
3a62b14077

vim-patch:8.2.3046: Amiga MorphOS: Term mode is set using DOS packets

Problem:    Amiga MorphOS: Term mode is set using DOS packets.
Solution:   Use the same way of setting term mdoe on all next gen Amiga-like
            systems.  (Ola Söder, closes vim/vim#8445)
b420ac9d20
2021-07-31 15:10:23 -04:00
5f01714b25 vim-patch:8.1.2019: 'cursorline' always highlights the whole line (#15161)
Problem:    'cursorline' always highlights the whole line.
Solution:   Add 'cursorlineopt' to specify what is highlighted.
            (closes vim/vim#4693)
410e98a70b
2021-07-30 21:51:26 -04:00
15698eb5a1 Merge pull request #15206 from dundargoc/refactor/a-song-of-true-and-false/global-variables-2
refactor: replace TRUE/FALSE with true/false
2021-07-30 17:53:07 +02:00
7b627ece8d Merge pull request #15222 from dundargoc/PVS/V501
refactor: PVS/V501: removed duplicate sub-expression 'chunk.size > 2'
2021-07-30 15:41:27 +02:00
ca3071ea93 Merge pull request #15062 from seandewar/vim-8.1.0829
vim-patch:8.1.0829: when 'hidden' is set session creates extra buffers
2021-07-30 09:19:44 -04:00
74a38c03c0 Merge pull request #14744 from janlazo/vim-8.2.2957
vim-patch:8.2.2957: using getchar() in Vim9 script is problematic
2021-07-30 09:01:35 -04:00
518f0d3d47 refactor: PVS/V501: removed duplicate sub-expression 'chunk.size > 2' 2021-07-30 14:29:54 +02:00
94120d2fd5 refactor: replace TRUE/FALSE with true/false 2021-07-30 12:29:32 +02:00
870c43c023 fixup! fix(highlight): remove syncolor.vim
Fix lint errors from lines with 80+ characters.
2021-07-29 23:01:24 -04:00
3865b43205 vim-patch:8.2.2957: using getchar() in Vim9 script is problematic
Problem:    Using getchar() in Vim9 script is problematic.
Solution:   Add getcharstr(). (closes vim/vim#8343)
3a7503c34c

Cherry-pick Test_getchar() changes from patch v8.1.2304
to sync with upstream.

Port f_getcharstr() to src/nvim/eval/funcs.c, not src/nvim/getchar.c.
Patch v8.1.2042 is not ported yet.
2021-07-29 21:51:39 -04:00
d628e4250f Merge pull request #15207 from gpanders/bye-syncolor
fix(highlight): remove syncolor.vim
2021-07-29 23:31:57 +02:00
b73e733d52 Merge pull request #15184 from bfredl/sunjonhl
feat(decorations): allow more than one stacked highlight in a virt_text
2021-07-29 22:25:43 +02:00
25a879dfa2 feat(decorations): deprecate nvim_buf_set_virtual_text
Full virt_text functionality is provided by nvim_buf_set_extmark
2021-07-29 20:36:12 +02:00
a4d81a8002 refactor(decorations): merge the two different code paths for virt_text
test(bufhl): CHANGE of tested behaviour (inb4 a proper priority mechanism)
test(decoration): change of test; previous behavior was buggy (ghost
buffer text)
2021-07-29 20:34:42 +02:00
1495d36d63 feat(decorations): allow more than one stacked highlight in a virt_text 2021-07-29 20:34:20 +02:00
3521bf7672 feat(lsp): implement vim.lsp.diagnostic.redraw() (#15203)
Add a new function to redraw diagnostics from the current diagnostic
cache, without receiving a "publishDiagnostics" message from the server.
This is already being done in two places in the Lua stdlib, so this
function unifies that functionality in addition to providing it to third
party plugins.

An example use case for this could be a command or key-binding for
toggling diagnostics virtual text. The virtual text configuration option
can be toggled using `vim.lsp.with` followed by
`vim.lsp.diagnostic.redraw()` to immediately redraw the diagnostics
with the updated setting.
2021-07-29 09:02:17 -07:00
3b6d95b5f6 Merge pull request #15213 from zeertzjq/vim-8.2.3236
vim-patch:8.2.3236: mode() does not indicate using CTRL-O in Select mode
2021-07-29 17:03:12 +02:00
143a920de9 chore: fix lsp bug issue template
correct description for expected behavior
2021-07-29 16:35:02 +02:00
1d3aaae15c chore: fix bug issue template form
description for "expected behavior" was wrongly attached to "actual behavior"
2021-07-29 16:17:58 +02:00
98c4b2cf62 Merge pull request #15215 from bfredl/fix_15212
fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
2021-07-29 14:25:02 +02:00
cd353aa824 fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
fixes #15212
2021-07-29 12:59:56 +02:00
04ba81ddba vim-patch:8.2.3236: mode() does not indicate using CTRL-O in Select mode
Problem:    mode() does not indicate using CTRL-O in Select mode.
Solution:   Use "vs" and similar. (closes vim/vim#8640)
eaf3f36168
2021-07-29 07:47:17 +08:00
ac5139eae4 ci(labeler): adapt to new label names 2021-07-28 17:29:27 +02:00
cab90f2ef1 fixup! fix(highlight): remove syncolor.vim 2021-07-28 09:11:07 -06:00
6c08af083d ci: label PRs only the first time they're opened (#15209)
instead of on every change -- including removing erroneous labels
2021-07-28 11:30:08 +02:00
701c21480e ci(labeler): update label format 2021-07-28 10:10:45 +02:00
9190addf1f fixup! fix(highlight): remove syncolor.vim 2021-07-27 16:00:53 -06:00
d3bc61b31d fixup! fix(highlight): remove syncolor.vim 2021-07-27 14:14:42 -06:00
9afa0d25a6 fix(highlight): remove syncolor.vim
Remove syncolor.vim in favor of defining the default highlight groups
directly in `init_highlight`. This approach provides a number of
advantages:

1. The highlights are always defined, regardless of whether or not the
   syntax regex engine is enabled.
2. Redundant sourcing of syntax files is eliminated (syncolor.vim was
   often sourced multiple times based on how the user's colorscheme file
   was written).
3. The syntax highlighting regex engine and the highlight groups
   themselves are more fully decoupled.
4. Removal of the confusing `:syntax on` / `:syntax enable` dichotomy
   (they now both do the same thing).

This approach also correctly solves a number of bugs related to
highlighting (#15176, #12573, #15205).
2021-07-27 14:14:30 -06:00
c642f3ac27 Merge pull request #15142 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-27 11:28:04 +02:00
86baf582b8 docs: regenerate 2021-07-26 18:48:46 +00:00
c818d8df34 Merge pull request #15197 from dundargoc/refactor/a-song-of-true-and-false/global-variables
refactor: replace TRUE/FALSE with true/false
2021-07-26 20:41:54 +02:00
3e00d4f01c feat(lsp): make list handlers configurable (#15199)
The handlers for textDocument/references, textDocument/documentSymbol,
and workspace/symbol open their results in the quickfix list by default
and are not configurable. They are also incompatible with `vim.lsp.with`
as they do not accept a configuration parameter.

Add a `config` parameter to the handler for these three messages which
allows them to be configured with `vim.lsp.with`. Additionally, add a
new configuration option 'loclist' that, when true, causes these
handlers to open their results in the location list rather than the
quickfix list.
2021-07-26 11:39:50 -07:00
b8813bacfe Merge pull request #15090 from kraftwerk28/master
docs: fix typo in treesitter.txt
2021-07-26 20:38:11 +02:00
ec7881bbfd Merge pull request #15180 from gpanders/xcalloc
fix: fix incorrect call sites of xcalloc
2021-07-26 20:30:10 +02:00
0e22a40b6d Merge pull request #15191 from vigoux/ts-docs
docs(ts): add documentation for listing fns
2021-07-26 18:48:15 +02:00
1637622db9 chore: remove checkbox from issue template
Checkboxes trigger "task lists", which add noise.
2021-07-26 17:31:27 +02:00
dfd9d861dc refactor: replace TRUE/FALSE with true/false
Focus is on global variables.
2021-07-26 17:12:35 +02:00
7b520cca3a Merge pull request #15151 from dundargoc/refactor/true-and-false-macro
refactor: replace TRUE/FALSE macros with C99 true/false
2021-07-26 10:25:08 +02:00
11dcf15682 refactor: replace TRUE/FALSE macros with C99 true/false 2021-07-25 21:51:50 +02:00
5c42e2a87f docs(ts): add documentation for listing fns 2021-07-25 20:52:05 +02:00
192adfe99f Merge pull request #14311 from matveyt/nomode_ce
refactor(state): Remove EXMODE_NORMAL
2021-07-25 19:35:23 +02:00
f15c745502 chore: PVS/V751: ignore warning #15153
There's already an ignore directive but it's placed on the wrong line.
This commit should correct it.
2021-07-25 10:19:56 -07:00
53f70bb183 chore: added ccls-cache in .gitignore (#15175) 2021-07-25 19:12:07 +02:00
3a34f59ae8 Merge pull request #14347 from theHamsta/list_directives
treesitter: add query.list_directives
2021-07-25 16:49:22 +02:00
bebca7bbeb chore: update LSP bug report with Github issue forms (#15159) 2021-07-25 16:07:20 +02:00
1aef6297b3 chore: update feature request template by using Github issue forms. (#15158) 2021-07-25 16:06:19 +02:00
e5f3abfd17 chore: update bug report template by using Github's new issue forms (#15152) 2021-07-25 16:05:11 +02:00
a8f00e39ba Merge pull request #15178 from gpanders/master
fix: source syncolors.vim after startup scripts
2021-07-25 15:36:04 +02:00
3fd4f2f611 fix: fix incorrect call sites of xcalloc
The number of elements comes first and the size of each element second.
2021-07-24 15:52:14 -06:00
289c153d1f doc: group documentation of predicates and directives 2021-07-24 20:57:45 +02:00
b2a9afef6d treesitter: add query.list_directives 2021-07-24 20:57:45 +02:00
860aedd06b fix: source syncolors.vim after startup scripts
This fixes an issue introduced in #14771 (fix: source syncolors.vim
before startup scripts) that affected highlights for users who set
'background' to light in their startup script. Because syncolor.vim
checks for the value of &background, it was always setting up the 'dark'
background colors, which looked wrong for users using light backgrounds.

The primary benefit of #14771 is that it decoupled highlighting from the
syntax engine. This is useful for e.g. treesitter, which still makes use
of highlights even if the syntax engine is disabled. For this reason, it
is still worthwhile to source syncolor.vim separately from synload.vim,
which #14771 accomplishes. However, we should still source syncolor.vim
after the user startup scripts, to ensure that we are respecting the
options the user sets.

Another corollary benefit is that this reduces some redundancy in
highlight definitions, since we now only source syncolors.vim if the
user did not already enable a colorscheme.
2021-07-24 10:28:16 -06:00
46009499af Merge pull request #15169 from bfredl/freebsdfail
fix(ci): disable broken test on openbsd also on freebsd
2021-07-24 13:18:38 +02:00
13db912e51 fix(ci): lower timeout to 45 minutes (from default 360 mins) 2021-07-24 10:23:15 +02:00
a3e2636afd fix(ci): disable broken test on openbsd on all CI due to resource constraints 2021-07-23 19:35:32 +02:00
8ce0929418 Remove EXMODE_NORMAL 2021-07-23 18:08:40 +02:00
754ac5a834 Merge pull request #15114 from theHamsta/treesitter-hl-priority
feat(treesitter): allow to set highlight priority for queries
2021-07-23 17:56:16 +02:00
5ea6cc1d75 docs(tree-sitter): document highlight priority 2021-07-22 21:38:57 +02:00
242608e669 feat(treesitter): allow to set highlight priority for queries 2021-07-22 21:38:57 +02:00
a8c3d50fad lsp: add vim.lsp.diagnostic.set_qflist() function (#14831)
* Add vim.lsp.diagnostic.set_qflist() function
* replaces opts.open_loclist with unified opts.open
2021-07-22 08:48:28 -07:00
ea35584bac Merge pull request #14771 from gpanders/colorscheme
fix: source syncolors.vim before startup scripts
2021-07-22 14:10:56 +02:00
6f48c018b5 Revert "fix(ci): remove mongodb from brew to avoid brew upgrade error (#15115)" (#15141)
This reverts commit 5377b2b00a.

(Fix no longer needed.)
2021-07-20 23:30:32 +02:00
sim
710b9ed1c7 lsp(start_client): Allow passing custom workspaceFolders to the LSP (#15132)
Some language servers *cough*rust-analyzer*cough* need an empty/custom
workspaceFolders for certain usecases. For example, rust-analyzer
needs an empty workspaceFolders table for standalone file support
(See https://github.com/rust-analyzer/rust-analyzer/pull/8955).

This can also be useful for other languages that need to commonly
open a certain directory (like flutter or lua), which would help
prevent spinning up a new language server altogether.

In case no workspaceFolders are passed, we fallback to what we had
before.
2021-07-20 22:00:38 +02:00
2475161def Merge pull request #15135 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-19 23:35:35 +02:00
823412eda9 docs: regenerate 2021-07-19 21:24:46 +00:00
9358aa04c4 docs: made can_merge private (#15138) 2021-07-19 14:23:28 -07:00
4ed2d4fd66 fix(lsp): allow diagnostic.clear to accept nil bufnr (#15137)
Passing `nil` is equivalent to passing 0, i.e. it simply uses the
current buffer number.

This fixes a bug when vim.lsp.diagnostic.disable() is called without
arguments.
2021-07-19 14:23:12 -07:00
223c355040 Merge pull request #15127 from bfredl/nlua_init
refactor(lua): initialize lua state at startup instead of dynamically
2021-07-19 22:27:55 +02:00
1aeb945553 feat(lsp): allow diagnostics to be disabled for a buffer (#15134)
Add two new methods to allow diagnostics to be disabled (and re-enabled)
in the current buffer. When diagnostics are disabled they are simply not
displayed to the user, but they are still sent by the server and
processed by the client.

Disabling diagnostics can be helpful in a number of scenarios. For
example, if one is working on a buffer with an overwhelming amount of
diagnostic warnings it can be helpful to simply disable diagnostics
without disabling the LSP client entirely. This also allows users more
flexibility on when and how they may want diagnostic information to be
displayed. For example, some users may not want to display diagnostic
information until after the buffer is first written.
2021-07-19 11:49:55 -07:00
c487a73fa2 feat(lsp): allow configuring zindex for floating windows (#15086) 2021-07-19 09:03:59 -07:00
526fc609b8 fix(shared): do not treat empty tables as list in deep extend (#15094)
An empty table was previously always treated as a list, which means that
while merging tables, whenever an empty table was encountered it would
  always truncate any table on the left.

`vim.tbl_deep_extend("force", { b = { a = 1 } }, { b = {} })`

Before: `{ b = {} }`
After: `{ b = { a = 1 } }`
2021-07-19 08:52:44 -07:00
3b2a85ff76 Merge pull request #15070 from dundargoc/PVS/V768
[RDY] chore(PVS/V768): don't use enum as bool.
2021-07-19 11:29:09 -04:00
e877eccafd refactor(lua): initialize lua state at startup instead of dynamically
lua is used as part of implementation for more core features. As an
example, every user keypress will invoke a lua function to check for
keypress handlers (regardless if they are registered or not). Thus not
starting lua until it is first used doesn't make much sense anymore.

nlua_enter was also needed due to the earlier stateful &rtp
translation, which by now have been made stateless.
2021-07-19 16:12:39 +02:00
192c21ccde chore(PVS/V768): don't use enum as bool. 2021-07-19 14:42:39 +02:00
bfb04812d5 Merge pull request #15073 from dundargoc/PVS/V751
[RDY] chore(PVS/V751): tui.c, Parameter is not used
2021-07-18 13:39:20 -04:00
d9be6ba796 Merge pull request #15110 from dundargoc/PVS/V1042
[RDY] chore: PVS/V1042 - ignore warning globally.
2021-07-18 13:36:23 -04:00
6f9e219f60 chore(PVS/V751): tui.c, Parameter is not used
False positive. Documentation for grid_scroll says "`cols` is always
zero, reserved for future use".
2021-07-18 11:47:09 +02:00
c36df20aef feat: aggregate code actions from all clients (#15121) 2021-07-18 01:58:35 -07:00
9f6989d551 chore: PVS/V1042 - ignore warning globally.
V1042 is a warning that a file has a copyleft license, which is an
irrelevant warning to open-source projects.
2021-07-17 17:27:17 +02:00
96a6b9b52d vim-patch:8.1.0829: when 'hidden' is set session creates extra buffers
Problem:    When 'hidden' is set session creates extra buffers.
Solution:   Move :badd commands to the end. (Jason Franklin)
d39e275b57

Adjust some tests in ex_cmds/mksession_spec.lua:

- 'restores same :terminal buf in splits': Buffers aren't always :badded
  in the same order as they're :edited, :balted, etc, so the order of
  buffers in the buffer list may change slightly now that :badd happens
  afterwards.
- 'restores buffers with tab-local CWD': This is explained in a comment.
2021-07-17 16:12:49 +01:00
5377b2b00a fix(ci): remove mongodb from brew to avoid brew upgrade error (#15115)
macOS CI was failing because:

- brew upgrade fails because,
- mongodb-community cant upgrade because,
- some symlinks are owned by ...  mongodb-community...

We don't use mogodb, so we can just remove it wholesale.
2021-07-17 16:59:39 +02:00
d8f5f4d090 doc(lsp): various small fixes (#15113)
- remove incorrect usage of docstrings
- fix make_formatting_params return type documentation to 'DocumentFormattingParams'
- make progress_handler private
- fix links
2021-07-17 11:15:57 +02:00
0bcf96bf0b fix: source syncolors.vim before startup scripts
This fixes an issue (#12573) where colorscheme files are sourced twice
upon startup. This occurs when the startup script calls `:colorscheme`,
which sets the `g:colors_name` global variable. When syntax highlighting
is enabled in `syn_maybe_enable()` the `syntax.vim` script is sourced
which in turn sources `synload.vim`. This script checks to see if
`g:colors_name` is set and, if so, runs

    exe "colors " . colors_name

This is done to ensure that highlight groups are defined before enabling
the syntax highlighting engine.

Instead, source syncolors.vim before the startup scripts which sets up
default highlights and only load the full syntax engine after
the startup scripts or when the user runs `:syntax on`. Add a guard
variable `did_syncolor` to prevent syncolor.vim from being sourced
twice and remove the line mentioned above from synload.vim so that
the colorscheme file is not re-sourced when the syntax engine is loaded.
2021-07-14 20:51:36 -06:00
682247b52e Merge pull request #15078 from bfredl/p_vim_vi
refactor(options): remove obsolete distinction of "vi" vs "vim" defaults
2021-07-14 22:21:57 +02:00
f0cc3a9480 refactor(options): remove obsolete distinction of "vi" vs "vim" defaults
It might come as a schocking surprise, but the defaults we support
are the NEOVIM defaults.
2021-07-14 21:54:19 +02:00
19a2e59f7e Merge pull request #15017 from donbex/local-file-uri
fix(lsp): accept file URIs without a hostname
2021-07-14 12:20:13 -07:00
fc869da6dc refactor(options): delet unused P_VIM flag 2021-07-14 21:06:07 +02:00
ceaef6bf3f docs: fix typo in treesitter.txt 2021-07-14 21:41:53 +03:00
c31bc6ea73 fix(lsp): pass bufnr for async formatting (#15084)
the `textDocument/rangeFormatting` nad `textDocument/formatting` did not
pass bufnr to apply_text_edits, meaning edits were applied to
the user's currently active buffer. This could result in text being
applied to the wrong buffer.
2021-07-14 09:15:43 -07:00
02bf251bb3 Merge pull request #14812 from gpanders/stdin_closed
feat(job): add parameter to close stdin
2021-07-13 20:51:46 +02:00
f83763b261 Add test case for 'null' stdin mode 2021-07-12 13:22:56 -06:00
d7382475b3 Fix line length clint error 2021-07-12 12:17:44 -06:00
35e13df3c8 Rename stdin to stdin_mode
stdin is a macro in Windows builds.
2021-07-12 12:17:44 -06:00
eb7f24b4ae feat(job): add parameter to close stdin
Some programs behave differently when they detect that stdin is being
piped. This can be problematic when these programs are used with the job
control API where stdin is attached, but not typically used. It is
possible to run the job using a PTY which circumvents this problem, but
that includes a lot of overhead when simply closing the stdin pipe would
suffice.

To enable this behavior, add a new parameter to the jobstart options
dict called "stdin" with two valid values: "pipe" (the default)
implements the existing behavior of opening a channel for stdin and
"null" which disconnects stdin (or, if you prefer, connects it to
/dev/null). This is extensible so that other modes can be added in the
future.
2021-07-12 15:17:10 +02:00
eece0735fe fix(lsp): avoid ipairs on non-sequential tables (#15059)
ipairs terminates on the first nil index when iterating over table keys:

for i,k in ipairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test

Instead, use pairs which continues iterating over the entire table:

for i,k in pairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test
3 test
2021-07-11 11:34:26 -07:00
e5b75d41db chore(clang): Fix 'Array subscript is undefined' #15057 2021-07-11 07:59:23 -07:00
22b5381396 fixup(clipboard): Fix error not properly handled #14984
fixes #14967
2021-07-11 06:19:54 -07:00
c21a6972a0 fix(lsp): Ensure human readable errors are printed
`return err_message(tostring(err))` caused errors to be printed as
`table: 0x123456789` instead of showing the error code and error
message.

This also removes some `if err` blocks that never got called because at
the end of `handlers.lua` all the handlers are wrapped with logic that
adds generic error handling.
2021-07-11 11:22:35 +02:00
256570a7a6 fix(lsp): Ensure users get feedback on references/symbols errors or empty results
Relates to https://github.com/neovim/neovim/issues/15050

Users should get some indication if there was an error or an empty
result.
2021-07-11 10:57:00 +02:00
79fe9dedcf window.c: address Coverity failure #14996
Check that `wip2` does not point to the same address as `wip`, to address the
Coverity test failure from PR #14884.

Based on the `if` clauses, `free_wininfo(wip2, ...)` is only called when
`wip2->wi_win == NULL` and `wip->wi_win == wp`. I think `wip2` would only point
to the same address as `wip` in scenarios where `wp` were `NULL`, which can be
assumed otherwise based on the earlier code.
2021-07-10 21:32:37 -07:00
936f3a4ddc test/memory_usage_spec: skip on MacOS #15043
Memory compression could complicate the measurements.
2021-07-10 20:15:38 -07:00
7c61d9c3bf fix(lsp): Add separator between codelens in virttext (#15049)
Before:

  Lens1Lens2

After:

  Lens1 | Lens2

Fixes https://github.com/neovim/neovim/issues/15048
2021-07-10 21:35:38 +02:00
0b64d5ecd1 fix(lsp): correctly check for windows in lsp logger (#14954) 2021-07-10 11:11:33 -07:00
1dab9357de feat(vim.uri): Allow URI schemes other than file: without authority 2021-07-10 18:27:37 +01:00
82a443e1f3 test(lsp): file URIs do not allow relative paths 2021-07-10 18:27:37 +01:00
ce5f4228aa test(lsp): file URIs without a hostname 2021-07-10 18:27:37 +01:00
a2c2a08652 fix(lsp): accept file URIs without a hostname
RFC 8089, which defines the file URI scheme, also allows URIs without a
hostname, i.e. of the form file:/path/to/file. These are returned by
some language servers and accepted by other LSP implementations, such as
VSCode's, so it is reasonable for us to accept them as well.
2021-07-10 18:27:37 +01:00
3de7017d9d Merge pull request #15047 from teto/flake-tests
flake update
2021-07-10 18:37:07 +02:00
389cbe63bf chore: add log hander to gen_vimdoc
so it actually dumps output.
Plus a description of what it does in the argparser.
2021-07-10 17:55:45 +02:00
de909bf48b chore(flake): update inputs
Updated inputs so no need to add tree-sitter ourselves anymore.

Added checks:
- for pylint/shlint
- distinguish the devolpment shell from the ASAN build (closure for ASAN
  version is smaller). While in the devShell, functionaltests would fail
because bin/nvim could not load
outputs/out/share/nvim/syntax/syntax.vim
So we touch the file.
2021-07-10 17:52:15 +02:00
e43dbfdd05 feat(lsp): Make line diagnostics display prettier
Adds indentation that matches the number prefix to ensure diagnostic
messages spawning multiple lines align.

Before:

    Diagnostics:
    1. • Variable not in scope: red :: t0 -> t
    • Perhaps you meant one of these:
        ‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
        ‘pred’ (imported from Prelude)
    2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
    • Perhaps you meant ‘replaceDoubleColon’ (line 32)

After:

    Diagnostics:
    1. • Variable not in scope: red :: t0 -> t
       • Perhaps you meant one of these:
           ‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
           ‘pred’ (imported from Prelude)
    2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
       • Perhaps you meant ‘replaceDoubleColon’ (line 32)
2021-07-09 20:36:08 +02:00
37af69285a Merge pull request #15036 from vigoux/decurbuf-2
refactor(undo): don't assume curbuf in u_compute_hash
2021-07-09 18:52:26 +02:00
ff53c5585f refactor(undo): don't assume curbuf in u_compute_hash 2021-07-09 15:36:07 +02:00
191d3e6af7 Merge pull request #15035 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-09 14:40:19 +02:00
832e1708c2 docs: regenerate 2021-07-09 10:39:24 +00:00
9132b76da6 fix(lsp): support duplicate params in signature help (#15032) 2021-07-09 03:38:29 -07:00
1c41689287 Merge pull request #12971 from vigoux/decurbuf
Decrease reliance on curbuf in BUFEMPTY and `undo.c`
2021-07-09 10:15:18 +02:00
27118c6eb3 Merge pull request #14908 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-07-08 22:50:18 -04:00
9c93e6461c refactor(undo): remove last occurence of save_curbuf 2021-07-08 23:08:42 +02:00
b35fefc57f refactor: remove all mentions to curbuf_lock 2021-07-08 23:08:27 +02:00
9c7e04eb3b build(cmake): skip download if target file exists #14844) 2021-07-08 11:16:13 -07:00
980d50d90e vim-patch:8.2.3125: variables are set but not used #15028
Problem:    Variables are set but not used.
Solution:   Move the declarations to the block where they are used.
            (closes vim/vim#8527)
09f688c33a
2021-07-08 11:04:46 -07:00
4339f528db vim-patch:8.2.3089: garbage collection has useless code #15027
Problem:    Garbage collection has useless code.
Solution:   Bail out when aborting. (closes vim/vim#8504)
20cc528320
2021-07-08 11:03:33 -07:00
6b313d68d0 docs: regenerate 2021-07-08 15:42:31 +00:00
03d15d9e09 fix(lsp): restore diagnostics extmarks that were moved to the last edit line (#15023) 2021-07-08 08:40:41 -07:00
af263711a3 feat(lsp): highlight active parameter in signature help (#15018) 2021-07-07 23:04:35 -07:00
f2205b83c5 doc: "--remote" is not supported #14936
There are plans to support the --remote-xx stuff (or something like it): #1750 #8326
But we don't need this doc meanwhile.
2021-07-07 19:04:49 -07:00
bd7a0b46a9 doc: remove mentions of compile-time flags #14935
Nvim always compiles everything in so those are useless at best and
confusing at worst.
2021-07-07 18:51:40 -07:00
4547137aaf chore: use codespell to spell check #15016 2021-07-07 15:28:44 -07:00
e2bc7e321b clang/'Dead initialization': don't assign unused value to variable "string" #15015 2021-07-07 14:25:27 -07:00
77b33e4b9f fix(lsp): restore diagnostics extmarks on buffer changes (#15011) 2021-07-07 22:31:39 +02:00
0fd3f9130d clang/'Dead nested assignment': don't assign unused value to precision #15012 2021-07-07 13:17:03 -07:00
3de777d259 chore(deps): bump LibLUV to 1.40.0-0 (#14997)
Adds several threading, async, and gc fixes and allows building with older gcc (4.x). Minimum required version remains 1.30.1.
2021-07-07 08:24:08 +02:00
f8ed13c0dc style(undo): remove unnecessary comment 2021-07-06 19:52:26 +02:00
e5804d46fd fix(qf): use correct buffer field 2021-07-06 19:51:59 +02:00
7970631fa0 buffer: move BUFEMPTY to a function 2021-07-06 19:12:15 +02:00
763c852812 undo: reduce reliance on curbuf 2021-07-06 19:08:32 +02:00
55a2c513aa buffer: don't rely on curbuf in BUFEMPTY 2021-07-06 19:07:11 +02:00
df33f30e88 clang/'Dead assignment': ignore warning #15000
This assignment is informative/documenting though technically unnecessary.
https://github.com/neovim/neovim/pull/11900#discussion_r381860165 .
2021-07-05 18:59:27 -07:00
a6cdfa27d5 chore(deps): bump LibLUV to 1.34.1 and lua-compat-53 to 0.9 (#14985)
This bumps the bundled LibLUV to 1.34.1 in order to make the newly introduced `uv.fs_mkstemp` available in the official builds. (The minimum required version remains at 1.30.1.)

The bump of lua-compat-53 to 0.9 is needed to build with the updated LibLUV.
2021-07-05 14:30:50 +02:00
f515baedc1 Merge pull request #14989 from folke/lsp_convert_input_markdown
fix(lsp): prevent double <text> for cached plaintext markup
2021-07-04 20:06:37 -07:00
910967e5af fix(lsp): prevent double <text> for cached plaintext markup 2021-07-05 00:39:46 +02:00
c6226bd6c9 Merge pull request #14391 from lewis6991/signs
signs: Change b_signcols_max -> b_signcols_valid
2021-07-04 23:16:49 +02:00
65b0918c24 signs: Change b_signcols_max -> b_signcols_valid
b_signcols_max isn't used to store the max value, it is use to
invalidate b_signcols.
2021-07-04 21:50:27 +01:00
18bfcfe77f Merge pull request #14981 from janlazo/vim-8.2.3081
vim-patch:8.2.{3081,3082,3085,3087,3088,3093,3094,3097,3098}
2021-07-04 11:00:48 -04:00
0d75b0d8d4 vim-patch:8.2.3097: crash when using "quit" at recovery prompt
Problem:    Crash when using "quit" at recovery prompt and autocommands are
            triggered.
Solution:   Block autocommands when creating an empty buffer to use as the
            current buffer. (closes vim/vim#8506)
1d97efce0c
2021-07-04 09:22:50 -04:00
ce4d424bfc vim-patch:8.2.3093: tablabel_tooltip test fails with Athena
Problem:    tablabel_tooltip test fails with Athena. (Dominique Pellé)
Solution:   Skip the test when using Athena. (closes vim/vim#8508)
fb773a3e0a
2021-07-04 09:22:50 -04:00
37959e8865 vim-patch:8.2.3088: with 'virtualedit' set to "block" Visual highlight is wrong
Problem:    With 'virtualedit' set to "block" Visual highlight is wrong after
            using "$".  (Marco Trosi)
Solution:   Do not set w_old_cursor_lcol to MAXCOL. (closes vim/vim#8495)
9cee4a1c9c
2021-07-04 09:22:50 -04:00
c2a7e445ce vim-patch:8.2.3087: Gemtext files are not recognized
Problem:    Gemtext files are not recognized.
Solution:   Recognize .gmi and .gemini files. (closes vim/vim#8427)
fcde67c99f
2021-07-04 09:22:49 -04:00
d7060183b8 vim-patch:8.2.3085: JSONC files are not recognized
Problem:    JSONC files are not recognized.
Solution:   Recognize .jsonc files. (Izhak Jakov, closes vim/vim#8500)
acbb4b5720

N/A patches for version.c:

vim-patch:8.2.3081: cannot catch errors in a channel command

Problem:    Cannot catch errors in a channel command.
Solution:   Instead of skipping the error make it silent. (closes vim/vim#8477)
11a632d60b

vim-patch:8.2.3082: a channel command "echoerr" does not show anything

Problem:    A channel command "echoerr" does not show anything.
Solution:   Do not use silent errors when using an "echoerr" command.
            (closes vim/vim#8494)
b836f631db

vim-patch:8.2.3094: Test_popup_atcursor_pos() fails without the conceal feature

Problem:    Test_popup_atcursor_pos() fails without the conceal feature.
Solution:   Add a check for the conceal feature. (Dominique Pellé,
            closes vim/vim#8505)
c60e959cba

vim-patch:8.2.3098: popup window test is flaky on MS-Windows with GUI

Problem:    Popup window test is flaky on MS-Windows with GUI.
Solution:   Skip the check in this situation.
999db2346b
2021-07-04 09:22:45 -04:00
490615612e fix(vim.opt): vimL map string values not trimmed (#14982)
Options formatted as a list of comma-separated key-value pairs may have
values that contain leading and trailing whitespace characters. For
example, the `listchars` option has a default value of
`"tab:> ,trail:-,nbsp:+"`. When converting this value to a lua table,
leading and trailing whitespace should not be trimmed.

Co-authored-by: Robert Hrusecky <robert.hrusecky@utexas.edu>
2021-07-04 00:14:39 -07:00
75f758b993 fix(clint): fix link to style guide. (#14975) 2021-07-03 09:09:02 -07:00
ee2c7095c4 refactor(memfile_test): replace long_u type with size_t. #14974
long_u was a custom integer type that is no longer used.
More information can be found in https://github.com/neovim/neovim/issues/459.
2021-07-03 08:23:15 -07:00
70223babb0 PVS/V1051: Ignore "modulo by 1" warning for ARRAY_SIZE. (#14943)
The warning is triggered by the second division when arr is a char array
since sizeof(char) is 1. A modulo by 1 may normally indicate a logic
error, but in this case it's intended.
2021-07-03 07:50:05 -07:00
05330ba508 doc/startup: cleanup; assign ENN to "conflicing configs" msg (#14971) 2021-07-03 06:31:00 -07:00
7918072f99 doc/readme: mention void linux (#14969) 2021-07-03 05:52:33 -07:00
d791274a9d fixup(clipboard): Use case matching #14962
Context: https://github.com/neovim/neovim/pull/14848#discussion_r663203173
2021-07-02 17:47:18 -07:00
94583483f9 deps(curl): v7.77.0 (#14961)
https://github.com/neovim/neovim/issues/14078#issuecomment-870882357
d66e306abf
2021-07-02 17:44:05 -07:00
62d67de598 version bump 2021-07-02 18:12:11 +02:00
1805 changed files with 315782 additions and 187044 deletions

View File

@ -1,44 +0,0 @@
image: freebsd/12.x
packages:
- cmake
- gmake
- ninja
- libtool
- sha
- automake
- pkgconf
- unzip
- wget
- gettext
- python
- libffi
sources:
- https://github.com/neovim/neovim
environment:
SOURCEHUT: 1
LANG: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
cd neovim
gmake deps
- build: |
cd neovim
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
- functionaltest: |
cd neovim
gmake functionaltest
- unittest: |
cd neovim
gmake unittest
# Unfortunately, oldtest is tanking hard on sourcehut's FreeBSD instance
# and not producing any logs as a result. So don't do this task for now.
# Ref: https://github.com/neovim/neovim/pull/11477#discussion_r352095005.
# - test-oldtest: |
# cd neovim
# gmake oldtest

View File

@ -1,43 +0,0 @@
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
image: openbsd/6.9
packages:
- autoconf-2.71
- automake-1.16.3
- cmake
- gettext-runtime-0.21p1
- gettext-tools-0.21p1
- gmake
- libtool
- ninja-1.10.2p0
- unzip-6.0p14
sources:
- https://github.com/neovim/neovim
environment:
SOURCEHUT: 1
LC_CTYPE: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
mkdir neovim/.deps
cd neovim/.deps
cmake -G Ninja ../third-party/
cmake --build . --config RelWithDebInfo
- build: |
mkdir neovim/build
cd neovim/build
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
cmake --build . --config RelWithDebInfo
./bin/nvim --version
- functionaltest: |
cd neovim/build
cmake --build . --config RelWithDebInfo --target functionaltest
- oldtest: |
cd neovim
gmake oldtest

29
.cirrus.yml Normal file
View File

@ -0,0 +1,29 @@
env:
CIRRUS_CLONE_DEPTH: '2'
LANG: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
freebsd_task:
name: FreeBSD
only_if: $BRANCH != "master"
freebsd_instance:
image_family: freebsd-13-1
timeout_in: 30m
install_script:
- pkg update -f
- pkg install -y cmake gmake ninja libtool automake pkgconf unzip wget gettext python libffi git
build_deps_script:
- gmake deps
build_script:
- gmake CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
workaround_script:
# Run tests as user "cirrus" instead of root. This is required for the
# permission-related tests to work correctly.
- pw useradd cirrus -m
- chown -R cirrus:cirrus .
functionaltest_script:
- sudo -u cirrus gmake functionaltest
unittest_script:
- sudo -u cirrus gmake unittest
oldtest_script:
- sudo -u cirrus gmake oldtest

View File

@ -1,11 +1,11 @@
BasedOnStyle: Google
Language: Cpp
ColumnLimit: 80
ColumnLimit: 100
IndentWidth: 2
TabWidth: 2
TabWidth: 8
UseTab: Never
IndentCaseLabels: true
BreakBeforeBraces: Linux
IndentCaseLabels: false
BreakBeforeBraces: Custom
AlignEscapedNewlinesLeft: false
AllowShortFunctionsOnASingleLine: false
AlignTrailingComments: true
@ -17,4 +17,51 @@ AllowShortLoopsOnASingleLine: false
BinPackParameters: false
BreakBeforeBinaryOperators: true
BreakBeforeTernaryOperators: true
ContinuationIndentWidth: 4
ContinuationIndentWidth: 2
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: No
AlwaysBreakTemplateDeclarations: No
AlignEscapedNewlines: DontAlign
BinPackArguments: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
PointerAlignment: Right
SortIncludes: true
Cpp11BracedListStyle: false
IncludeCategories:
- Regex: '<[/[:alnum:].]+>'
Priority: 0
- Regex: '^"(nvim|vim)/'
Priority: 1
SortPriority: 1
CaseSensitive: false
AlignConsecutiveMacros: AcrossEmptyLines
IndentPPDirectives: AfterHash
SpaceBeforeParens: ControlStatementsExceptControlMacros
PPIndentWidth: 1
ForEachMacros:
- FOR_ALL_AUEVENTS
- FOR_ALL_AUPATS_IN_EVENT
- FOR_ALL_BUFFERS
- FOR_ALL_BUFFERS_BACKWARDS
- FOR_ALL_FRAMES
- FOR_ALL_QFL_ITEMS
- FOR_ALL_SIGNS_IN_BUF
- FOR_ALL_TABS
- FOR_ALL_TAB_WINDOWS
- FOR_ALL_WINDOWS_IN_TAB
- RBUFFER_EACH
- RBUFFER_EACH_REVERSE
- RBUFFER_UNTIL_EMPTY
- RBUFFER_UNTIL_FULL
- kl_iter

View File

@ -6,7 +6,9 @@ indent_size = 2
tab_width = 8
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.{c,h,in,lua}]
max_line_length = 100
[{Makefile,**/Makefile,runtime/doc/*.txt}]
indent_style = tab

View File

@ -1,2 +0,0 @@
[flake8]
max-line-length = 88

62
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,62 @@
# To use this file (requires git 2.23):
# git config blame.ignoreRevsFile .git-blame-ignore-revs
# eval.c: factor out eval/funcs.c #11828
# - This is a move/rename. git 2.33 doesn't know how to ignore it.
# It is here anyway, (1) in case git improves later, and (2) to
# save you the trouble of attempting this.
6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b
# symbol renames
6186df3562e33e92f04ed8c850204ceabc4746e1
# style (uncrustify, etc.)
2d240024acbd68c2d3f82bc72cb12b1a4928c6bf
61178778230e609d68b271ffd53ffd993cd23c42
15af08ad176339d1f269ce264bb0efea283c9536
47f99d66440ae8be26b34531989ac61edc1ad9fe
1e49a1c888a3d9a581f4aa409a26ada3ac2417cb
3b3dbcf7b7ba5466e6ab643e256f2374b520a6b2
e8067d1490a31ff76143d576dc9948b4f09c6c55
d5b66e88601b4d2fde5d905f9d12847126ba4449
07715044887d82f74254e64c4c32fa49b0501bea
6ed43f8f1caad702f9590d174c5ec142f3d85b18
0a83017fe95df0290adb98ec6bf457b96a3fab17
867e8885991ae450019c18aa5e42546bd4b62c2c
1f49268c46fcbe65f7e2e2cb620e6f51c059cf9e
51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6
853346a94d6aa78c97314a3b217fb5a5408a47f1
30fefee684e641a0c6867446c6de30efa2f0a126
f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45
48e67b229415b4e2b3315bd00b817e5f9ab970c8
7a26eb8a567cbc831d4f629f9eccb767a44436b8
2f9b9e61d7417183f2d9f36d804247c0926be9d4
c0767bd4f3ce7b34bb77da0657c49ba10ba1b32e
d90fb1c0bfc1e64c783c385a79e7de87013dadba
9c268263b1792d00b3ffdfd7495af2575862656e
8c74c895b300bcee5fa937a2329d1d4756567b42
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
4472c56d54f447040f6e8610b261b7efa0d04eb6
a68faed02dc8e37b8f10da14dc02e33e6ed93947
725cbe7d414f609e769081276f2a034e32a4337b
7e3bdc75e44b9139d8afaea4381b53ae78b15746
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
849f104c2789c884428fd45501912c6591a78e12
38dd53c525054daf83dba27d7d46e90e8b41fa50
6059784770c4c88fb6fe528b9f7634192fa1164e
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
271bb32855853b011fceaf0ad2f829bce66b2a19
aefdc6783cb77f09786542c90901a9e7120bea42
aa4f9c5341f5280f16cce0630ea54b84eef717b3
0adc66171a355a12494d87ebb767d509540c7ef9
93f24403f8cc760ff47979c596976b53a8b16358
1ffd527c837fb2465c9659273bbe5447a1352db2
2498e9feb025361576603a0101c86393d211e31e
# typos
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
4547137aaff32b20172870a549d3a28a3c7adf1c
# generated docs
ea333badd24f691c753d8048f911d1db349bc2cd

16
.gitattributes vendored
View File

@ -1,6 +1,16 @@
*.h linguist-language=C
*.h.in linguist-language=C
*.c.in linguist-language=C
*CMakeLists.txt linguist-language=CMake
runtime/doc/* linguist-documentation
src/xdiff/** linguist-vendored
src/cjson/** linguist-vendored
src/unicode/** linguist-vendored
src/nvim/testdir/test42.in diff
.github/ export-ignore
.github/ export-ignore
.travis.yml export-ignore
codecov.yml export-ignore
.builds/ export-ignore
.builds/ export-ignore

View File

@ -1,34 +0,0 @@
---
name: Bug report
about: Report a problem in Nvim
title: ''
labels: bug
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- Operating system/version:
- Terminal name/version:
- `$TERM`:
<!--
If this report is about different behaviour between Nvim and Vim, make sure to
read `:h vim-differences` first. Otherwise remove the next line.
-->
[ ] `vim -u DEFAULTS` (version: ) behaves differently
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
# Alternative for shell-related problems:
# env -i TERM=ansi-256color "$(which nvim)"
```
### Actual behaviour
### Expected behaviour

75
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,75 @@
name: Bug Report
description: Report a problem in Neovim
labels: [bug]
body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
- type: input
attributes:
label: "Neovim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true
- type: input
attributes:
label: "Vim (not Nvim) behaves the same?"
description: "Does `vim -u DEFAULTS` have the same issue? Note the exact Vim version (`8.x.yyyy`)."
placeholder: "no, vim 7.3.432"
validations:
required: true
- type: input
attributes:
label: "Operating system/version"
placeholder: "macOS 11.5"
validations:
required: true
- type: input
attributes:
label: "Terminal name/version"
placeholder: "xterm 3.1"
validations:
required: true
- type: input
attributes:
label: "$TERM environment variable"
placeholder: "xterm-256color"
validations:
required: true
- type: input
attributes:
label: "Installation"
description: "How did you install neovim: build from repo / system package manager / appimage / homebrew / snap / chocolatey / other (describe)?"
placeholder: "Arch User Repository (AUR)"
validations:
required: true
- type: textarea
attributes:
label: "How to reproduce the issue"
description: |
- Steps to reproduce using `nvim --clean` ("factory defaults").
- For build failures: list the exact steps including CMake flags (if any).
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
placeholder: |
nvim --clean
:edit foo
yiwp
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
validations:
required: true
- type: textarea
attributes:
label: "Actual behavior"
validations:
required: true

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://neovim.discourse.group/
about: Ask questions about configuration and usage of Neovim

View File

@ -1,27 +0,0 @@
---
name: Feature request
about: Request an enhancement for Nvim
title: ''
labels: enhancement
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- `vim -u DEFAULTS` (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```
### Actual behaviour
### Expected behaviour

View File

@ -0,0 +1,21 @@
name: Feature request
description: Request an enhancement for Neovim
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
- type: input
attributes:
label: "Feature already in Vim?"
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
placeholder: "Yes, Vim 7.3.432"
- type: textarea
attributes:
label: "Feature description"
validations:
required: true

View File

@ -1,58 +0,0 @@
---
name: Language server client bug report
about: Report a built-in lsp problem in Nvim
title: ''
labels: bug, lsp
---
<!--
Before reporting: search existing issues and check the FAQ. Usage questions
such as "How do I...?" or "Why isn't X language server/feature working?" belong
on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will
be closed.
-->
- `nvim --version`:
- language server name/version:
- Operating system/version:
<details>
<summary>nvim -c ":checkhealth nvim lspconfig"</summary>
<!-- Paste the results from `nvim -c ":checkhealth nvim lspconfig"` here. -->
</details>
<details>
<summary>lsp.log</summary>
<!--
Please paste the lsp log before and after the problem.
You can set log level like this.
`:lua vim.lsp.set_log_level("debug")`
You can find the location of the log with the following command.
`:lua print(vim.lsp.get_log_path())`
-->
</details>
### Steps to reproduce using nvim -u minimal_init.lua
<!--
Note, if the issue is with an autocompletion or other LSP plugin, please
report to the upstream tracker. Download the minmal config with
wget https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua
and modify it to include any specific commands or servers pertaining to your issues.
-->
```
nvim -u minimal_init.lua
```
### Actual behaviour
### Expected behaviour

View File

@ -0,0 +1,54 @@
name: Language server (LSP) client bug
description: Report an issue with Neovim LSP
labels: [bug, lsp]
body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
- type: input
attributes:
label: "Neovim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true
- type: input
attributes:
label: "Language server name/version"
placeholder: "rls 0.5.2"
validations:
required: true
- type: input
attributes:
label: "Operating system/version"
placeholder: "emacs 23"
validations:
required: true
- type: textarea
attributes:
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
description: |
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
- type: textarea
attributes:
label: "Actual behavior"
- type: input
attributes:
label: "Log file"
placeholder: "https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb"
description: |
- Upload `lsp.log` before and after the problem in a [secret gist](https://gist.github.com/). Paste the URL to the gist.
- You can set the log level by adding `vim.lsp.set_log_level("debug")` after setting up LSP in your config.
- You can find the location of the log with `:lua print(vim.lsp.get_log_path())`

44
.github/labeler.yml vendored
View File

@ -4,7 +4,7 @@
"lua":
- runtime/lua/**/*
- src/nvim/lua
- src/nvim/lua/*
"tui":
- src/nvim/tui/tui.*
@ -13,37 +13,53 @@
- src/nvim/lua/treesitter.*
- runtime/lua/vim/treesitter.lua
- runtime/lua/vim/treesitter/*
- runtime/queries/**/*
"diagnostic":
- runtime/lua/vim/diagnostic.lua
"dependencies":
- third-party/**/*
- cmake.deps/**/*
"topic: spell":
"spell":
- src/nvim/spell*
"topic: :terminal":
"terminal":
- src/nvim/terminal.*
"topic: column":
- src/nvim/mark.h
- src/nvim/mark.c
"column":
- src/nvim/sign*
"topic: folds":
"folds":
- src/nvim/fold*
"topic: mouse":
"mouse":
- src/nvim/mouse*
"topic: documentation":
- runtime/doc/*
"documentation":
- all: ["runtime/doc/*"]
- all: ["**/*.md"]
"topic: clipboard":
"clipboard":
- runtime/autoload/provider/clipboard.vim
"topic: diff":
"diff":
- src/nvim/diff.*
"topic: build":
"build":
- CMakeLists.txt
- "**/CMakeLists.txt"
- "**/Makefile"
- "**/*.cmake"
"test":
- all: ["test/**/*"]
"ci":
- .github/labeler.yml
- .github/workflows/**/*
- .builds/*
- ci/**/*
"filetype":
- runtime/lua/vim/filetype.lua

16
.github/scripts/remove-reviewers.js vendored Normal file
View File

@ -0,0 +1,16 @@
module.exports = async ({github, context}) => {
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const reviewers = requestedReviewers.data.users.map(e => e.login)
github.rest.pulls.removeRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: reviewers
});
}

92
.github/scripts/reviews.js vendored Normal file
View File

@ -0,0 +1,92 @@
module.exports = async ({github, context}) => {
const pr_data = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const labels = pr_data.data.labels.map(e => e.name)
const reviewers = new Set()
if (labels.includes('api')) {
reviewers.add("bfredl")
reviewers.add("muniter")
}
if (labels.includes('build')) {
reviewers.add("jamessan")
reviewers.add("justinmk")
}
if (labels.includes('ci')) {
reviewers.add("dundargoc")
reviewers.add("jamessan")
}
if (labels.includes('column')) {
reviewers.add("lewis6991")
}
if (labels.includes('diagnostic')) {
reviewers.add("gpanders")
}
if (labels.includes('diff')) {
reviewers.add("lewis6991")
}
if (labels.includes('dependencies')) {
reviewers.add("jamessan")
}
if (labels.includes('distribution')) {
reviewers.add("jamessan")
}
if (labels.includes('documentation')) {
reviewers.add("clason")
}
if (labels.includes('extmarks')) {
reviewers.add("bfredl")
}
if (labels.includes('filetype')) {
reviewers.add("clason")
reviewers.add("gpanders")
}
if (labels.includes('lsp')) {
reviewers.add("mfussenegger")
reviewers.add("glepnir")
}
if (labels.includes('treesitter')) {
reviewers.add("bfredl")
reviewers.add("clason")
reviewers.add("vigoux")
}
if (labels.includes('typo')) {
reviewers.add("dundargoc")
}
if (labels.includes('ui')) {
reviewers.add("bfredl")
}
if (labels.includes('vim-patch')) {
reviewers.add("seandewar")
reviewers.add("zeertzjq")
}
// Remove person that opened the PR since they can't review themselves
const pr_opener = pr_data.data.user.login
reviewers.delete(pr_opener)
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers)
});
}

18
.github/workflows/api-docs-check.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Missing API docs
on:
pull_request:
branches-ignore:
- 'marvim/api-doc-update**'
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
jobs:
call-regen-api-docs:
permissions:
contents: write
pull-requests: write
uses: ./.github/workflows/api-docs.yml
with:
check_only: true

View File

@ -1,26 +1,38 @@
# Autogenerate the API docs on new commit to important branches
# Also work as a check for PR's to not forget committing their doc changes
# called from api-docs-check.yml
name: Autogenerate API docs
on:
push:
paths:
- 'src/nvim/api/*.[ch]'
- 'src/nvim/**.lua'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
workflow_dispatch:
workflow_call:
inputs:
check_only:
type: boolean
default: false
required: false
jobs:
regen-api-docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Fetch depth 0 is required if called through workflow_call. In order
# to create a PR we need to access other branches, which requires a
# full clone.
fetch-depth: 0
- name: Install dependencies
@ -42,10 +54,17 @@ jobs:
python3 scripts/gen_vimdoc.py
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
- name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
run: |
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
echo "The doc generation produces the following changes:"
git diff --color --exit-code
- name: Automatic PR
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
run: |
git add -u
git commit -m 'docs: regenerate'
git commit -m 'docs: regenerate [skip ci]'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
gh pr create --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true

27
.github/workflows/backport.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Backport
on:
pull_request_target:
types: [closed, labeled]
jobs:
backport:
permissions:
contents: write
pull-requests: write
name: Backport Pull Request
if: >
github.repository_owner == 'neovim' && (
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# required to find all branches
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
uses: zeebe-io/backport-action@v0.0.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@ -1,116 +1,358 @@
name: CI
on:
push:
branches: '**'
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
pull_request:
branches:
- 'master'
- 'release-[0-9]+.[0-9]+'
paths-ignore:
- 'runtime/doc/*'
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
unixish:
name: ${{ matrix.os }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
lint:
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh lint
- name: Install apt packages
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
flake8 \
gettext \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool-bin \
libtree-sitter-dev \
libunibilium-dev \
libuv1-dev \
libvterm-dev \
locales \
lua-busted \
lua-check \
lua-filesystem \
lua-inspect \
lua-lpeg \
lua-luv-dev \
lua-nvim \
luajit \
ninja-build \
pkg-config
- name: Cache uncrustify
id: cache-uncrustify
uses: actions/cache@v3
with:
path: ${{ env.CACHE_UNCRUSTIFY }}
key: ${{ env.UNCRUSTIFY_VERSION }}
- name: Clone uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: uncrustify/uncrustify
ref: ${{ env.UNCRUSTIFY_VERSION }}
path: uncrustify
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
source_dir=uncrustify
build_dir=uncrustify/build
cmake -S $source_dir -B $build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build $build_dir
mkdir -p $HOME/.cache
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
- name: Cache artifacts
uses: actions/cache@v3
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party deps
run: ./ci/before_script.sh
- if: "!cancelled()"
name: lintstylua
uses: JohnnyMorganz/stylua-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check runtime/
- if: "!cancelled()"
name: lintlua
run: make lintlua
- if: "!cancelled()"
name: lintpy
run: make lintpy
- if: "!cancelled()"
name: lintsh
run: make lintsh
- if: "!cancelled()"
name: uncrustify
run: |
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
- if: "!cancelled()"
name: suggester / uncrustify
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool_name: uncrustify
cleanup: false
- if: "!cancelled()"
name: check uncrustify
run: |
git diff --color --exit-code
- name: Cache dependencies
run: ./ci/before_cache.sh
lintc:
# This job tests two things: it lints the code but also builds neovim using
# system dependencies instead of bundled dependencies. This is to make sure
# we are able to build neovim without pigeonholing ourselves into specifics
# of the bundled dependencies.
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh lint
- name: Install apt packages
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
gettext \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool-bin \
libtree-sitter-dev \
libunibilium-dev \
libuv1-dev \
libvterm-dev \
locales \
lua-busted \
lua-check \
lua-filesystem \
lua-inspect \
lua-lpeg \
lua-luv-dev \
lua-nvim \
luajit \
ninja-build \
pkg-config
- name: Cache artifacts
uses: actions/cache@v3
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party deps
run: ./ci/before_script.sh
- name: Build nvim
run: ./ci/run_tests.sh build_nvim
- if: "!cancelled()"
name: lintc
run: make lintc
- if: "!cancelled()"
name: check-single-includes
run: make check-single-includes
- name: Cache dependencies
run: ./ci/before_cache.sh
posix:
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
strategy:
fail-fast: false
matrix:
include:
- flavor: asan
cc: clang-12
runner: ubuntu-20.04
os: linux
- flavor: lint
cc: gcc
cc: clang-13
runner: ubuntu-20.04
os: linux
- flavor: tsan
cc: clang-12
cc: clang-13
runner: ubuntu-20.04
os: linux
- flavor: uchar
cc: gcc
runner: ubuntu-20.04
os: linux
- cc: clang
runner: macos-10.15
runner: macos-11
os: osx
# functionaltest-lua is our dumping ground for non-mainline configurations.
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
# 2. Use as oldest/minimum versions of dependencies/build tools we
# still explicitly support so we don't accidentally rely on
# features that is only available on later versions.
# 3. No treesitter parsers installed.
- flavor: functionaltest-lua
cc: gcc
runner: ubuntu-20.04
os: linux
cmake: minimum_required
runs-on: ${{ matrix.runner }}
if: github.event.pull_request.draft == false
timeout-minutes: 45
env:
CC: ${{ matrix.cc }}
CI_OS_NAME: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup commom environment variables
- name: Setup common environment variables
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
- name: Install apt packages
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
- name: Install minimum required version of cmake
if: matrix.cmake == 'minimum_required'
env:
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.10.0'
shell: bash
run: |
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
chmod a+x /tmp/cmake-installer.sh
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
cmake_version="$(cmake --version | head -1)"
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
- name: Install new clang
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
run: |
wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh
sudo ./llvm.sh 12
sudo ./llvm.sh 13
rm llvm.sh
- name: Install brew packages
if: matrix.os == 'osx'
run: |
# Workaround brew issues
rm -f /usr/local/bin/2to3
brew update >/dev/null
brew upgrade
brew install automake ccache perl cpanminus ninja
brew update --quiet
brew install automake cpanminus ninja
- name: Setup interpreter packages
run: |
./ci/before_install.sh
./ci/install.sh
run: ./ci/install.sh
- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
~/.ccache
key: ${{ runner.os }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party
- name: Build third-party deps
run: ./ci/before_script.sh
- name: Build and test
run: ./ci/script.sh
- name: Build
run: ./ci/run_tests.sh build_nvim
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
name: Unittests
run: ./ci/run_tests.sh unittests
- if: matrix.flavor != 'tsan' && !cancelled()
name: Functionaltests
run: ./ci/run_tests.sh functionaltests
- if: "!cancelled()"
name: Oldtests
run: ./ci/run_tests.sh oldtests
- if: "!cancelled()"
name: Install nvim
run: ./ci/run_tests.sh install_nvim
- name: Cache dependencies
if: ${{ success() }}
run: ./ci/before_cache.sh
windows:
runs-on: windows-2016
if: github.event.pull_request.draft == false
runs-on: windows-2019
timeout-minutes: 45
env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
strategy:
fail-fast: false
matrix:
config: [ MINGW_64-gcov, MINGW_32, MSVC_64, MSVC_32 ]
name: windows (${{ matrix.config }})
CMAKE_BUILD_TYPE: "RelWithDebInfo"
name: windows (MSVC_64)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ env.DEPS_BUILD_DIR }}
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
key: ${{ hashFiles('cmake.deps\**') }}
- name: Run CI
run: powershell ci\build.ps1
env:
CONFIGURATION: ${{ matrix.config }}
- name: Build deps
run: .\ci\build.ps1 -BuildDeps
- name: Build nvim
run: .\ci\build.ps1 -Build
- name: Install test deps
continue-on-error: false
run: .\ci\build.ps1 -EnsureTestDeps
- if: "!cancelled()"
name: Run tests
run: .\ci\build.ps1 -Test
- if: "!cancelled()"
name: Run old tests
run: .\ci\build.ps1 -TestOld

42
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: "CodeQL"
on:
schedule:
- cron: '42 0 * * 0'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- if: matrix.language == 'cpp'
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

23
.github/workflows/commitlint.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: "Commit Linter"
on:
# Only pull_request and push honor [skip ci]. Since this workflow must pass
# to merge a PR, it can't be skipped, so use pull_request_target
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'master'
jobs:
lint-commits:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
path: pr_nvim
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
- run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua
- run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})"

View File

@ -1,19 +1,19 @@
name: Coverity
on:
schedule:
- cron: '0 10 * * 1' # Run every Monday at 00:10
- cron: '10 0 * * *' # Run every day at 00:10
workflow_dispatch:
jobs:
scan:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
- name: Download Coverity
run: |

View File

@ -8,8 +8,6 @@ $HOME/.local/bin
EOF
cat <<EOF >> "$GITHUB_ENV"
CACHE_ENABLE=true
CI_TARGET=tests
CI_BUILD_DIR=$GITHUB_WORKSPACE
BUILD_DIR=$GITHUB_WORKSPACE/build
DEPS_BUILD_DIR=$HOME/nvim-deps
@ -19,13 +17,11 @@ NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
CCACHE_BASEDIR=$GITHUB_WORKSPACE
CCACHE_COMPRESS=1
CCACHE_SLOPPINESS=time_macros,file_macro
CCACHE_DIR=$HOME/.ccache
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
UNCRUSTIFY_VERSION=uncrustify-0.75.0
EOF
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
DEPS_CMAKE_FLAGS=
FUNCTIONALTEST=functionaltest
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
@ -34,19 +30,28 @@ case "$FLAVOR" in
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
cat <<EOF >> "$GITHUB_ENV"
CLANG_SANITIZER=ASAN_UBSAN
SYMBOLIZER=asan_symbolize-12
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan
SYMBOLIZER=asan_symbolize-13
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
EOF
;;
tsan)
cat <<EOF >> "$GITHUB_ENV"
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
CLANG_SANITIZER=TSAN
EOF
;;
uchar)
cat <<EOF >> "$GITHUB_ENV"
BUILD_UCHAR=1
EOF
;;
lint)
# Re-enable once system deps are available
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
cat <<EOF >> "$GITHUB_ENV"
CI_TARGET=lint
USE_BUNDLED=OFF
EOF
;;
functionaltest-lua)

View File

@ -1,13 +1,49 @@
name: "Pull Request Labeler"
on:
- pull_request_target
pull_request_target:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@main
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: ""
type-scope:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- name: "Extract commit type and add as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
- name: "Extract commit scope and add as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
- name: "Extract if the PR is a breaking change and add it as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: ["triage", "type-scope"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})

65
.github/workflows/notes.md vendored Normal file
View File

@ -0,0 +1,65 @@
```
${NVIM_VERSION}
```
## Install
### Windows
#### Zip
1. Download **nvim-win64.zip**
2. Extract the zip.
3. Run `nvim-qt.exe`
#### MSI
1. Download **nvim-win64.msi**
2. Run the MSI
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
### macOS
1. Download **nvim-macos.tar.gz**
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos.tar.gz`
4. Run `./nvim-macos/bin/nvim`
### Linux (x64)
#### Tarball
1. Download **nvim-linux64.tar.gz**
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim`
#### Debian Package
1. Download **nvim-linux64.deb**
2. Install the package using `sudo apt install ./nvim-linux64.deb`
3. Run `nvim`
#### AppImage
1. Download **nvim.appimage**
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
```
./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim
```
### Other
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
## SHA256 Checksums
```
${SHA_LINUX_64_TAR}
${SHA_LINUX_64_DEB}
${SHA_APP_IMAGE}
${SHA_APP_IMAGE_ZSYNC}
${SHA_MACOS}
${SHA_WIN_64_ZIP}
${SHA_WIN_64_MSI}
```

View File

@ -13,134 +13,164 @@ on:
- v[0-9]+.[0-9]+.[0-9]+
# Build on the oldest supported images, so we have broader compatibility
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
jobs:
linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.build.outputs.version }}
release: ${{ steps.build.outputs.release }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
- name: Build release
id: build
run: |
CC=gcc-11 make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
cd "$GITHUB_WORKSPACE/build/release"
tar cfz nvim-linux64.tar.gz nvim-linux64
- uses: actions/upload-artifact@v2
cd "$GITHUB_WORKSPACE/build/"
cpack -C $NVIM_BUILD_TYPE
- uses: actions/upload-artifact@v3
with:
name: nvim-linux64
path: build/release/nvim-linux64.tar.gz
path: |
build/nvim-linux64.tar.gz
build/nvim-linux64.deb
retention-days: 1
appimage:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-11 make appimage-latest
run: CC=gcc-10 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: CC=gcc-11 make appimage-nightly
- uses: actions/upload-artifact@v2
run: CC=gcc-10 make appimage-nightly
- uses: actions/upload-artifact@v3
with:
name: appimage
path: build/bin/nvim.appimage
retention-days: 1
- uses: actions/upload-artifact@v2
with:
name: appimage
path: build/bin/nvim.appimage.zsync
path: |
build/bin/nvim.appimage
build/bin/nvim.appimage.zsync
retention-days: 1
macOS:
runs-on: macos-10.15
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install brew packages
run: |
rm -f /usr/local/bin/2to3
brew update >/dev/null
brew upgrade
brew update --quiet
brew install automake ninja
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
- name: Provision universal `libintl`
run: |
GETTEXT_PREFIX="$(brew --prefix gettext)"
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
bottle_tag="arm64_big_sur"
brew fetch --bottle-tag="$bottle_tag" gettext
cd "$(mktemp -d)"
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
mv -f libintl.a /usr/local/lib/
- name: Ensure static linkage to `libintl`
run: |
# We're about to mangle `gettext`, so let's remove any potentially broken
# installs (e.g. curl, git) as those could interfere with our build.
brew uninstall $(brew uses --installed --recursive gettext)
brew unlink gettext
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/include"/* /usr/local/include/
rm -f "$GETTEXT_PREFIX"
- name: Build release
run: |
make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install
- name: Create package
run: |
cd "$GITHUB_WORKSPACE/build/release"
mkdir -p nvim-osx64/libs
libs=($(otool -L nvim-osx64/bin/nvim | sed 1d | sed -E -e 's|^[[:space:]]*||' -e 's| .*||'))
echo "libs:"
for lib in "${libs[@]}"; do
if echo "$lib" | grep -q -E 'libSystem|CoreFoundation' 2>/dev/null; then
echo " [skipped] $lib"
else
echo " $lib"
relname="libs/${lib##*/}"
cp -L "$lib" "nvim-osx64/$relname"
install_name_tool -change "$lib" "@executable_path/../$relname" nvim-osx64/bin/nvim
fi
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
DEPS_CMAKE_FLAGS="$OSX_FLAGS"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
cd "$GITHUB_WORKSPACE/build/"
# Make sure we build everything for M1 as well
for macho in bin/* lib/nvim/parser/*.so
do
lipo -info "$macho" | grep -q arm64 || exit 1
done
tar cfz nvim-macos.tar.gz nvim-osx64
- uses: actions/upload-artifact@v2
cpack -C "$NVIM_BUILD_TYPE"
- uses: actions/upload-artifact@v3
with:
name: nvim-macos
path: build/release/nvim-macos.tar.gz
path: build/nvim-macos.tar.gz
retention-days: 1
windows:
runs-on: windows-2016
runs-on: windows-2019
env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
CMAKE_BUILD_TYPE: "RelWithDebInfo"
strategy:
matrix:
include:
- config: MSVC_64
archive: nvim-win64
- config: MSVC_32
archive: nvim-win32
name: windows (${{ matrix.config }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: powershell ci\build.ps1 -NoTests
env:
CONFIGURATION: ${{ matrix.config }}
- run: move build\Neovim.zip build\${{ matrix.archive }}.zip
- uses: actions/upload-artifact@v2
- name: Build deps
run: .\ci\build.ps1 -BuildDeps
- name: build package
run: .\ci\build.ps1 -Package
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.archive }}
path: build/${{ matrix.archive }}.zip
path: |
build/${{ matrix.archive }}.msi
build/${{ matrix.archive }}.zip
retention-days: 1
publish:
needs: [linux, appimage, macOS, windows]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/download-artifact@v2
# Must perform checkout first, since it deletes the target directory
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gettext-base
- if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
@ -150,23 +180,26 @@ jobs:
TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- if: env.TAG_NAME == 'nightly'
run: echo 'SUBJECT=Nvim development (prerelease) build' >> $GITHUB_ENV
run: |
(echo 'SUBJECT=Nvim development (prerelease) build';
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true
- if: env.TAG_NAME != 'nightly'
run: echo 'SUBJECT=Nvim release build' >> $GITHUB_ENV
- if: env.TAG_NAME == 'nightly'
uses: dev-drprasad/delete-tag-and-release@v0.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_release: true
tag_name: nightly
run: |
(echo 'SUBJECT=Nvim release build';
echo 'PRERELEASE=') >> $GITHUB_ENV
gh release delete stable --yes || true
git push origin :stable || true
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
# containing folder from the output.
- name: Generate Linux64 SHA256 checksums
run: |
cd ./nvim-linux64
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
echo "SHA_LINUX_64=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
- name: Generate App Image SHA256 checksums
run: |
cd ./appimage
@ -182,77 +215,47 @@ jobs:
cd ./nvim-macos
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
- name: Generate Win32 SHA256 checksums
run: |
cd ./nvim-win32
sha256sum nvim-win32.zip > nvim-win32.zip.sha256sum
echo "SHA_WIN_32=$(cat nvim-win32.zip.sha256sum)" >> $GITHUB_ENV
- name: Generate Win64 SHA256 checksums
run: |
cd ./nvim-win64
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
echo "SHA_WIN_64=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
- uses: meeDamian/github-release@2.0
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
- name: Publish release
env:
NVIM_VERSION: ${{ needs.linux.outputs.version }}
DEBUG: api
run: |
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
if [ "$TAG_NAME" != "nightly" ]; then
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
fi
publish-winget:
needs: publish
runs-on: windows-latest
steps:
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
name: Publish stable
uses: vedantmgoyal2009/winget-releaser@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG_NAME }}
name: ${{ needs.linux.outputs.release }}
prerelease: ${{ env.TAG_NAME == 'nightly' }}
commitish: ${{ github.sha }}
gzip: false
allow_override: ${{ env.TAG_NAME == 'nightly' }}
files: |
nvim-macos.tar.gz:./nvim-macos/nvim-macos.tar.gz
nvim-macos.tar.gz.sha256sum:./nvim-macos/nvim-macos.tar.gz.sha256sum
nvim-linux64.tar.gz:./nvim-linux64/nvim-linux64.tar.gz
nvim-linux64.tar.gz.sha256sum:./nvim-linux64/nvim-linux64.tar.gz.sha256sum
nvim.appimage:./appimage/nvim.appimage
nvim.appimage.sha256sum:./appimage/nvim.appimage.sha256sum
nvim.appimage.zsync:./appimage/nvim.appimage.zsync
nvim.appimage.zsync.sha256sum:./appimage/nvim.appimage.zsync.sha256sum
nvim-win32.zip:./nvim-win32/nvim-win32.zip
nvim-win32.zip.sha256sum:./nvim-win32/nvim-win32.zip.sha256sum
nvim-win64.zip:./nvim-win64/nvim-win64.zip
nvim-win64.zip.sha256sum:./nvim-win64/nvim-win64.zip.sha256sum
body: |
${{ env.SUBJECT }}
```
${{ needs.linux.outputs.version }}```
## Install
### Windows
1. Extract **nvim-win64.zip** (or **nvim-win32.zip**)
2. Run `nvim-qt.exe`
### macOS
1. Download **nvim-macos.tar.gz**
2. Extract: `tar xzvf nvim-macos.tar.gz`
3. Run `./nvim-osx64/bin/nvim`
### Linux (x64)
1. Download **nvim.appimage**
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
```
./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim
```
### Other
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
## SHA256 Checksums
```
${{ env.SHA_LINUX_64 }}
${{ env.SHA_APP_IMAGE }}
${{ env.SHA_APP_IMAGE_ZSYNC }}
${{ env.SHA_MACOS }}
${{ env.SHA_WIN_64 }}
${{ env.SHA_WIN_32 }}
```
identifier: Neovim.Neovim
release-tag: ${{ github.event.inputs.tag_name || github.ref }}
token: ${{ secrets.WINGET_TOKEN }}
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Get nightly version
id: get-version
run: |
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
Install-Module -Name 'Carbon.Windows.Installer' -Force
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
echo "::set-output name=version::$VERSION"
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Publish nightly
uses: vedantmgoyal2009/winget-releaser@latest
with:
identifier: Neovim.Neovim.Nightly
version: ${{ steps.get-version.outputs.version }}
release-tag: nightly
token: ${{ secrets.WINGET_TOKEN }}

View File

@ -0,0 +1,17 @@
name: "Remove reviewers"
on:
pull_request_target:
types: [converted_to_draft, closed]
jobs:
remove-reviewers:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Remove reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/remove-reviewers.js')
await script({github, context})

18
.github/workflows/reviews.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: "Request reviews"
on:
pull_request_target:
types: [labeled, ready_for_review]
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})

View File

@ -5,7 +5,7 @@ on:
jobs:
update-vim-patches:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
@ -14,11 +14,11 @@ jobs:
VERSION_BRANCH: marvim/ci-version-update
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: vim/vim
path: ${{ env.VIM_SOURCE_DIR }}
@ -49,4 +49,4 @@ jobs:
git add -u
git commit -m 'version.c: update [skip ci]'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
gh pr create --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true

5
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Tools
/venv/
compile_commands.json
/.luarc.json
# IDEs
/.vs/
@ -13,6 +14,8 @@ compile_commands.json
/tmp/
/.clangd/
/.cache/clangd/
/.ccls-cache/
/.clang-tidy
.DS_Store
*.mo
@ -70,3 +73,5 @@ tags
# vim patches
/vim-*.patch
/CMakeUserPresets.json

View File

@ -25,3 +25,18 @@ ignore = {
read_globals = {
"vim",
}
globals = {
"vim.g",
"vim.b",
"vim.w",
"vim.o",
"vim.bo",
"vim.wo",
"vim.go",
"vim.env"
}
exclude_files = {
'test/functional/fixtures/lua/syntax_error.lua',
}

137
.mailmap Normal file
View File

@ -0,0 +1,137 @@
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
Billy Su <g4691821@gmail.com> Billy SU
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
bfredl <bjorn.linse@gmail.com>
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
Chris Kipp <ckipp@pm.me> ckipp01
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
Daniel Hahler <git@thequod.de> <github@thequod.de>
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
dundargoc <gocdundar@gmail.com> Dundar Goc
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
Fabian Viöl <f.vioel@googlemail.com> Fabian
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
Gaelan Steele <gbs@canishe.com> Gaelan
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
George Zhao <zhaozg@gmail.com> George Zhao
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
Gregory Anders <greg@gpanders.com> Greg Anders
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
Javier Lopez <graulopezjavier@gmail.com> Javier López
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
Jit Yao Yap <jityao@gmail.com> Jit
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
John Schmidt <john.schmidt.h@gmail.com> John
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
Michael Ennen <mike.ennen@gmail.com> brcolow
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
Patrice Peterson <patrice.peterson@mailbox.org> runiq
Pavel Platto <hinidu@gmail.com> Hinidu
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
Sander Bosma <sanderbosma@gmail.com> sander2
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
Shota <shotat@users.noreply.github.com> shotat
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
Wei Huang <daviseago@gmail.com> davix
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
aph <a.hewson@gmail.com> Ashley Hewson
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
chemzqm <chemzqm@gmail.com> Qiming zhao
chentau <tchen1998@gmail.com> Tony Chen
dedmass <carlo.abelli@gmail.com> Carlo Abelli
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
glacambre <code@lacamb.re> <me@r4>
glacambre <code@lacamb.re> Ghjuvan Lacambre
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
nate <nateozemon@gmail.com> nateozem
ray-x <rayx.cn@gmail.com> rayx
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
rockerBOO <rockerboo@gmail.com> Dave Lage
rpigott <rpigott@berkeley.edu> Ronan Pigott
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
shadmansaleh <shadmansaleh3@gmail.com> Shadman
sohnryang <loop.infinitely@gmail.com> 손량
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler

6
.stylua.toml Normal file
View File

@ -0,0 +1,6 @@
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Always"

3
.styluaignore Normal file
View File

@ -0,0 +1,3 @@
/scripts
/src
/test

View File

@ -1,222 +0,0 @@
dist: bionic
language: c
env:
global:
# Encrypted environment variables, see
# http://docs.travis-ci.com/user/encryption-keys/
#
# SNAP_SECRET_KEY: generated by:
# travis encrypt SNAP_SECRET_KEY=xx --add
# https://github.com/neovim/neovim/pull/11428
# snapcraft key expires after 1 year. Steps to refresh it:
# 1. snapcraft enable-ci travis --refresh
# 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
# 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
# 4. Undo changes to .travis.yml
- secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
- PATH="$HOME/.local/bin:$PATH"
# Set "false" to force rebuild of third-party dependencies.
- CACHE_ENABLE=true
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
- DEPS_BUILD_DIR="$HOME/nvim-deps"
# Install directory for Neovim.
- INSTALL_PREFIX="$HOME/nvim-install"
# Log directory for Clang sanitizers and Valgrind.
- LOG_DIR="$BUILD_DIR/log"
# Nvim log file.
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
# Default CMake flags.
- CMAKE_FLAGS="-DCI_BUILD=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DBUSTED_OUTPUT_TYPE=nvim
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=3"
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
# Environment variables for Clang sanitizers.
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
# If this file exists, the cache is valid (compile was successful).
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
# default target name for functional tests
- FUNCTIONALTEST=functionaltest
- CI_TARGET=tests
# Environment variables for ccache
- CCACHE_COMPRESS=1
- CCACHE_SLOPPINESS=time_macros,file_macro
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
- CI_OS_NAME="$TRAVIS_OS_NAME"
anchors:
envs: &common-job-env
# Do not fall back to cache for "master" for PR on "release" branch:
# adds the target branch to the cache key.
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
addons:
apt:
packages: &common-apt-packages
- apport
- autoconf
- automake
- build-essential
- clang
- cmake
- cpanminus
- cscope
- gcc-multilib
- gdb
- gperf
- language-pack-tr
- libtool-bin
- locales
- ninja-build
- pkg-config
- unzip
- valgrind
- xclip
homebrew:
update: true
casks:
- powershell
packages:
- ccache
- cpanminus
- ninja
- perl
jobs:
include:
- name: gcc-coverage (gcc 9)
os: linux
compiler: gcc-9
env:
- GCOV=gcov-9
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
- USE_LUACOV=1
- BUSTED_ARGS="--coverage"
- *common-job-env
addons:
snaps:
- name: powershell
confinement: classic
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- *common-apt-packages
- gcc-9
- name: gcc-functionaltest-lua
os: linux
compiler: gcc
env:
- FUNCTIONALTEST=functionaltest-lua
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- *common-job-env
- name: gcc-32bit
os: linux
# Travis creates a cache per compiler. Set a different value here to
# store 32-bit dependencies in a separate cache.
compiler: gcc
env:
- BUILD_32BIT=ON
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
# Minimum required CMake.
- CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
- *common-job-env
- name: big-endian
os: linux
arch: s390x
compiler: gcc
env:
- FUNCTIONALTEST=functionaltest-lua
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
- *common-job-env
addons:
apt:
packages:
- *common-apt-packages
- gettext
- python-pip
- python3-pip
- python-setuptools
- python3-setuptools
- python-dev
- python3-dev
- if: type != pull_request
name: snap
os: linux
env:
- LC_ALL: C.UTF-8
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
addons:
snaps:
- name: snapcraft
channel: stable
classic: true
- name: http
- name: transfer
- name: lxd
channel: stable
# Override default before_install, before_cache.
before_install: /bin/true
before_cache: /bin/true
install: ci/snap/install.sh
before_script: echo "Building snap..."
script: ci/snap/script.sh
after_success: ci/snap/after_success.sh
deploy:
skip_cleanup: true
provider: script
script: ci/snap/deploy.sh
on:
branch: master
allow_failures:
- env:
- LC_ALL: C.UTF-8
- LANG: C.UTF-8
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
fast_finish: true
before_install: ci/before_install.sh
install: ci/install.sh
before_script: ci/before_script.sh
script: ci/script.sh
before_cache: ci/before_cache.sh
branches:
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true
ccache: true
directories:
- "$CACHE_NVIM_DEPS_DIR"
git:
quiet: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031

View File

@ -1,4 +1,4 @@
.DONE:
@echo "Please use GNU Make (gmake) to build neovim"
@echo "Use GNU Make (gmake) to build neovim"
.DEFAULT:
@echo "Please use GNU Make (gmake) to build neovim"
@echo "Use GNU Make (gmake) to build neovim"

View File

@ -2,15 +2,12 @@
# intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
# Version should match the tested CMAKE_URL in .travis.yml.
cmake_minimum_required(VERSION 2.8.12)
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
cmake_minimum_required(VERSION 3.10)
project(nvim C)
if(POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
if(POLICY CMP0060)
cmake_policy(SET CMP0060 NEW)
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
# Point CMake at any custom modules we may ship
@ -18,6 +15,9 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# We don't support building in-tree.
include(PreventInTreeBuilds)
include(Util)
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@ -27,7 +27,7 @@ if(DEFINED ENV{DEPS_BUILD_DIR})
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
# *contain* system include paths. To avoid this, we prefix what would be
# "/usr/include" as "/_usr/include".
# This check is also performed in the third-party/CMakeLists.txt and in the
# This check is also performed in the cmake.deps/CMakeLists.txt and in the
# else clause following here.
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
@ -59,7 +59,7 @@ else()
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${PROJECT_SOURCE_DIR}/third-party
${PROJECT_SOURCE_DIR}/cmake.deps
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
execute_process(
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
@ -68,13 +68,8 @@ else()
endif()
endif()
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
# used for check_c_compiler_flag
include(CheckCCompilerFlag)
@ -88,10 +83,20 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# them be included as one of the first places to look for dependencies.
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done both here and in cmake.deps.
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message("Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
# Work around some old, broken detection by CMake for knowing when to use the
# isystem flag. Apple's compilers have supported this for quite some time
# now.
if(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
endif()
endif()
@ -116,32 +121,22 @@ endif()
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
# Build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
set_default_buildtype()
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG 1)
else()
set(DEBUG 0)
endif()
# Set available build types for CMake GUIs.
# Other build types can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
# If not in a git repo (e.g., a tarball) these tokens define the complete
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 5)
set(NVIM_VERSION_MINOR 8)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level
set(NVIM_API_LEVEL 7) # Bump this after any API change.
set(NVIM_API_LEVEL 10) # Bump this after any API change.
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false)
@ -175,7 +170,7 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
if(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
check_c_compiler_flag(-Og HAS_OG_FLAG)
else()
set(HAS_OG_FLAG 0)
@ -273,14 +268,18 @@ int main(void)
}
" HAVE_BUILTIN_ADD_OVERFLOW)
option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF)
if(MSVC)
# XXX: /W4 gives too many warnings. #3241
add_compile_options(/W3)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DWIN32)
add_definitions(-DMSWIN)
else()
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
-Wdouble-promotion
-Wmissing-noreturn
-Wmissing-format-attribute
-Wmissing-prototypes)
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
@ -288,6 +287,29 @@ else()
add_compile_options(-Wimplicit-fallthrough)
endif()
if(ENABLE_COMPILER_SUGGESTIONS)
# Clang doesn't have -Wsuggest-attribute so check for each one.
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
add_compile_options(-Wsuggest-attribute=pure)
endif()
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
add_compile_options(-Wsuggest-attribute=const)
endif()
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
add_compile_options(-Wsuggest-attribute=malloc)
endif()
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
add_compile_options(-Wsuggest-attribute=cold)
endif()
endif()
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
@ -298,6 +320,7 @@ endif()
if(MINGW)
# Use POSIX compatible stdio in Mingw
add_definitions(-D__USE_MINGW_ANSI_STDIO)
add_definitions(-DMSWIN)
endif()
if(WIN32)
# Windows Vista is the minimum supported version
@ -343,7 +366,7 @@ option(CI_BUILD "CI, extra flags will be set" OFF)
if(CI_BUILD)
message(STATUS "CI build enabled")
add_compile_options(-Werror)
if(DEFINED ENV{BUILD_32BIT})
if(DEFINED ENV{BUILD_UCHAR})
# Get some test coverage for unsigned char
add_compile_options(-funsigned-char)
endif()
@ -378,7 +401,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT P
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_BINARY_DIR}/cmake.config")
include_directories("${PROJECT_SOURCE_DIR}/src")
find_package(LibUV 1.28.0 REQUIRED)
@ -387,7 +410,7 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LibLUV 1.30.0 REQUIRED)
find_package(LibLUV 1.43.0 REQUIRED)
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
find_package(TreeSitter REQUIRED)
@ -408,12 +431,25 @@ main(void)
if(TS_HAS_SET_MATCH_LIMIT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
endif()
check_c_source_compiles("
#include <stdlib.h>
#include <tree_sitter/api.h>
int
main(void)
{
ts_set_allocator(malloc, calloc, realloc, free);
return 0;
}
" TS_HAS_SET_ALLOCATOR)
if(TS_HAS_SET_ALLOCATOR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
endif()
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
# The unit test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
if(PREFER_LUA)
find_package(Lua 5.1 REQUIRED)
find_package(Lua 5.1 EXACT REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
@ -462,18 +498,13 @@ if(FEAT_TUI)
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
endif()
find_package(LibTermkey 0.18 REQUIRED)
find_package(LibTermkey 0.22 REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif()
find_package(LIBVTERM 0.1 REQUIRED)
find_package(LIBVTERM 0.3 REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
if(WIN32)
find_package(Winpty 0.4.3 REQUIRED)
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
endif()
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
@ -543,6 +574,29 @@ endif()
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
if(COMPILE_LUA AND NOT WIN32)
if(PREFER_LUA)
foreach(CURRENT_LUAC_PRG luac5.1 luac)
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
if(_CHECK_LUAC_PRG)
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
break()
endif()
endforeach()
elseif(LUA_PRG MATCHES "luajit")
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
if(LUAJIT_HAS_JIT_BCSAVE)
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
endif()
endif()
endif()
if(LUAC_PRG)
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
endif()
# Setup busted.
find_program(BUSTED_PRG NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua)
@ -550,17 +604,78 @@ if(NOT BUSTED_OUTPUT_TYPE)
set(BUSTED_OUTPUT_TYPE "nvim")
endif()
#
# Lint
#
find_program(LUACHECK_PRG luacheck)
find_program(STYLUA_PRG stylua)
find_program(FLAKE8_PRG flake8)
find_program(GPERF_PRG gperf)
find_program(UNCRUSTIFY_PRG uncrustify)
find_program(SHELLCHECK_PRG shellcheck)
add_glob_targets(
REQUIRED
TARGET lintlua-luacheck
COMMAND ${LUACHECK_PRG}
FLAGS -q
GLOB_DIRS runtime/ scripts/ src/ test/
GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE
)
add_glob_targets(
TARGET lintlua-stylua
COMMAND ${STYLUA_PRG}
FLAGS --color=always --check
GLOB_DIRS runtime/
GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE
)
add_custom_target(lintlua)
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
include(InstallHelpers)
add_glob_targets(
TARGET lintpy
COMMAND ${FLAKE8_PRG}
FLAGS --max-line-length 88
GLOB_DIRS contrib scripts src test
GLOB_PAT *.py
TOUCH_STRATEGY SINGLE
)
add_glob_targets(
TARGET lintsh
COMMAND ${SHELLCHECK_PRG}
FILES scripts/vim-patch.sh
TOUCH_STRATEGY SINGLE
)
add_custom_target(lintcommit
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM)
add_dependencies(lintcommit nvim)
add_custom_target(lint)
add_dependencies(lint check-single-includes lintc lintlua lintpy lintsh lintcommit lintuncrustify)
#
# Format
#
add_custom_target(formatlua
COMMAND ${CMAKE_COMMAND}
-D FORMAT_PRG=${STYLUA_PRG}
-D LANG=lua
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_custom_target(format)
add_dependencies(format formatc formatlua)
file(GLOB MANPAGES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
man/nvim.1)
install_helper(
FILES ${MANPAGES}
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
#
@ -570,7 +685,7 @@ install_helper(
add_subdirectory(src/nvim)
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes)
add_subdirectory(config)
add_subdirectory(cmake.config)
add_subdirectory(test/functional/fixtures) # compile test programs
add_subdirectory(runtime)
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
@ -590,25 +705,12 @@ if(BUSTED_PRG)
# console pool: to do so we need to use the USES_TERMINAL
# option, but this is only available in CMake 3.2
set(TEST_TARGET_ARGS)
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
endif()
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test streams-test tty-test ${GENERATED_HELP_TAGS})
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
set(BENCHMARK_PREREQS nvim tty-test)
# Useful for automated build systems, if they want to manually run the tests.
add_custom_target(unittest-prereqs
DEPENDS ${UNITTEST_PREREQS})
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
add_custom_target(functionaltest-prereqs
DEPENDS ${FUNCTIONALTEST_PREREQS})
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_PREREQS})
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
if(LUA_HAS_FFI)
add_custom_target(unittest
@ -634,11 +736,11 @@ if(BUSTED_PRG)
set(TEST_LIBNVIM_PATH "")
endif()
configure_file(
${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
file(GENERATE
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND}
@ -653,8 +755,7 @@ if(BUSTED_PRG)
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(functionaltest functionaltest-prereqs
PROPERTIES FOLDER test)
set_target_properties(functionaltest PROPERTIES FOLDER test)
add_custom_target(benchmark
COMMAND ${CMAKE_COMMAND}
@ -669,7 +770,7 @@ if(BUSTED_PRG)
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS}
${TEST_TARGET_ARGS})
set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
set_target_properties(benchmark PROPERTIES FOLDER test)
endif()
if(BUSTED_LUA_PRG)
@ -689,34 +790,9 @@ if(BUSTED_LUA_PRG)
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
endif()
if(LUACHECK_PRG)
add_custom_target(lualint
COMMAND ${LUACHECK_PRG} -q runtime/ src/ test/ --exclude-files test/functional/fixtures/lua/syntax_error.lua
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_custom_target(lualint false
COMMENT "lualint: LUACHECK_PRG not defined")
endif()
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
# Set toplevel directory/installer name as Neovim
set(CPACK_PACKAGE_FILE_NAME "Neovim")
set(CPACK_TOPLEVEL_TAG "Neovim")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
include(CPack)
#add uninstall target
if(NOT TARGET uninstall)
configure_file(
"cmake/UninstallHelper.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(cmake.packaging)
endif()

95
CMakePresets.json Normal file
View File

@ -0,0 +1,95 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "default",
"displayName": "RelWithDebInfo",
"description": "Enables optimizations (-Og or -O2) with debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"inherits": [
"base"
]
},
{
"name": "debug",
"displayName": "Debug",
"description": "Disables optimizations (-O0), enables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"inherits": [
"base"
]
},
{
"name": "release",
"displayName": "Release",
"description": "Same as RelWithDebInfo, but disables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
},
"inherits": [
"base"
]
},
{
"name": "windows-default",
"displayName": "Windows x64 RelWithDebInfo",
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"inherits": [
"base"
]
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "windows-default",
"configurePreset": "windows-default",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
]
}

View File

@ -7,10 +7,11 @@ Getting started
If you want to help but don't know where to start, here are some
low-risk/isolated tasks:
- [Merge a Vim patch].
- Try a [good first issue](../../labels/good%20first%20issue) or [complexity:low] issue.
- Try a [complexity:low] issue.
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity).
- [Improve documentation](#documenting)
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
Reporting problems
------------------
@ -18,32 +19,32 @@ Reporting problems
- [Check the FAQ][wiki-faq].
- [Search existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists.
- Disable plugins incrementally, to narrow down the cause of the issue.
- Try to reproduce with `nvim --clean` ("factory defaults").
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
- Check `$NVIM_LOG_FILE`, if it exists.
- Check the logs. `:edit $NVIM_LOG_FILE`
- Include `cmake --system-information` for build-related issues.
Developer guidelines
--------------------
- Nvim contributors should read `:help dev`.
- External UI developers should read `:help dev-ui`.
- API client developers should read `:help dev-api-client`.
- Nvim developers are _strongly encouraged_ to install `ninja` for faster builds.
- Read `:help dev` if you are working on Nvim core.
- Read `:help dev-ui` if you are developing a UI.
- Read `:help dev-api-client` if you are developing an API client.
- Install `ninja` for faster builds of Nvim.
```
sudo apt-get install ninja-build
make distclean
make # Nvim build system uses ninja automatically, if available.
```
- [Improve documentation][wiki-contribute-help]
Pull requests (PRs)
---------------------
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
- Your PR must include **test coverage.** See [test/README.md][run-tests].
- To avoid duplicate work, create a draft pull request.
- Your PR must include [test coverage][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a **rebase workflow** for small PRs.
@ -62,21 +63,25 @@ Pull requests (PRs)
- During a squash/fixup, use `exec make -C build unittest` between each
pick/edit/reword.
### Stages: WIP, RFC, RDY
### Stages: Draft and Ready for review
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
For Comment) and `[RDY]` (Ready).
Pull requests have two stages: Draft and Ready for review.
1. `[RFC]` is assumed by default, **do not** put "RFC" in the PR title (it adds
noise to merge commit messages).
2. Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work
is still in flux.
3. Add `[RDY]` to the PR title if you are _done_ and only waiting on merge.
1. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback as
you are still working on the PR.
- You can skip this if your PR is ready for review.
2. [Change your PR to ready][pr-ready] when the PR is ready for review.
- You can convert back to Draft at any time.
Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
state of your PR: this just adds noise. Non-Draft PRs are assumed to be open
for comments; if you want feedback from specific people, `@`-mention them in
a comment.
### Commit messages
Follow the [convential commits guidelines][conventional_commits] to *make reviews easier* and to make
the VCS/git logs more valuable. The general structure of a commit message is as follows:
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
the VCS/git logs more valuable. The general structure of a commit message is:
```
<type>([optional scope]): <description>
@ -86,21 +91,27 @@ the VCS/git logs more valuable. The general structure of a commit message is as
[optional footer(s)]
```
- **Prefix the commit subject with a _type_:** `doc:`, `test:`
`runtime:`, ...
- Subject line for commits with only style/lint changes can be a single
word: `style` or `lint`.
- **Add the optional scope following <type> if possible:** `(lsp)`, `(treesitter)`, `(multigrid)`, ...
- Try to keep the first line under 72 characters.
- A blank line must separate the subject from the description.
- Breaking changes must be indicated at the very beginning of the footer or body section of a commit. A breaking change must consist of the uppercase text BREAKING CHANGE, followed by a colon, a space, and a description of what has changed about the API.
- Check your commit message for spelling and grammatical mistakes.
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `dist`
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
- _Description_ shouldn't start with a capital letter or end in a period.
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
- Try to keep the first line under 72 characters.
- A blank line must follow the subject.
- Breaking API changes must be indicated by
1. "!" after the type/scope, and
2. a "BREAKING CHANGE" footer describing the change.
Example:
```
refactor(provider)!: drop support for Python 2
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
```
### Automated builds (CI)
Each pull request must pass the automated builds on [Travis CI], [sourcehut]
and [AppVeyor].
Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Actions].
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
will fail the build.
@ -114,20 +125,7 @@ and [AppVeyor].
- The [lint](#lint) build checks modified lines _and their immediate
neighbors_, to encourage incrementally updating the legacy style to meet our
[style](#style). (See [#3174][3174] for background.)
- CI for freebsd and openbsd runs on [sourcehut].
- To get a backtrace on freebsd (after connecting via ssh):
```sh
sudo pkg install tmux # If you want tmux.
lldb build/bin/nvim -c nvim.core
# To get a full backtrace:
# 1. Rebuild with debug info.
rm -rf nvim.core build
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim
# 2. Run the failing test to generate a new core file.
TEST_FILE=test/functional/foo.lua gmake functionaltest
lldb build/bin/nvim -c nvim.core
```
- CI for FreeBSD runs on [Cirrus CI].
### Clang scan-build
@ -151,7 +149,7 @@ see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
```
PVS/V{id}: {description}
fix(PVS/V{id}): {description}
```
- Search the Neovim commit history to find examples:
```
@ -167,26 +165,27 @@ master build. To view the defects, just request access; you will be approved.
- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
([example](https://github.com/neovim/neovim/pull/804))):
```
coverity/{id}: {description}
fix(coverity/{id}): {description}
```
- Search the Neovim commit history to find examples:
```
git log --oneline --no-merges --grep coverity
```
### Clang sanitizers (ASAN and UBSAN)
ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
To build neovim with sanitizers enabled, use
- To build Neovim with sanitizers enabled, use
```
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
```
When running neovim, use
- When running Neovim, use
```
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
```
If neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
Coding
------
@ -206,21 +205,88 @@ You can lint a single file (but this will _not_ exclude legacy errors):
### Style
The repo includes a `.clang-format` config file which (mostly) matches the
[style-guide]. You can use `clang-format` to format code with the `gq`
operator in Nvim:
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
- You can format files by using:
```
make format
```
This will format changed Lua and C files with all appropriate flags set.
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
```
if !empty(findfile('src/uncrustify.cfg', ';'))
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
endif
```
The required version of `uncrustify` is specified in `uncrustify.cfg`.
- There is also `.clang-format` which has drifted from the [style-guide], but
is available for reference. To use the Nvim `gq` command with `clang-format`:
```
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
```
### Navigate
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
unmaintained and won't recognize many function signatures in Neovim source.)
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
```
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
- Recommendation is to use **[clangd]**.
Can use the maintained config in [nvim-lspconfig/clangd].
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- If using [lua-language-server], symlink `contrib/luarc.json` into the
project root:
$ ln -s contrib/luarc.json .luarc.json
### Includes
For managing includes in C files, use [include-what-you-use].
- [Install include-what-you-use][include-what-you-use-install]
- Run with:
```
make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt
```
See [#549][549] for more details.
Documenting
-----------
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
## Lua docstrings
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
```lua
--- {Brief}
---
--- {Long explanation}
---
---@param arg1 type {description}
---@param arg2 type {description}
{...}
---
---@return type {description}
```
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
```
---@private
```
Mark functions that are deprecated as
```
---@deprecated
```
Reviewing
---------
@ -228,37 +294,46 @@ Reviewing
To help review pull requests, start with [this checklist][review-checklist].
Reviewing can be done on GitHub, but you may find it easier to do locally.
Using [`hub`][hub], you can create a new branch with the contents of a pull
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
request, e.g. [#1820][1820]:
hub checkout https://github.com/neovim/neovim/pull/1820
gh pr checkout https://github.com/neovim/neovim/pull/1820
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
commits in the feature branch which aren't in the `master` branch; `-p`
shows each commit's diff. To show the whole surrounding function of a change
as context, use the `-W` argument as well.
[549]: https://github.com/neovim/neovim/issues/549
[1820]: https://github.com/neovim/neovim/pull/1820
[3174]: https://github.com/neovim/neovim/issues/3174
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
[Clang report]: https://neovim.io/doc/reports/clang/
[GitHub Actions]: https://github.com/neovim/neovim/actions
[clangd]: https://clangd.llvm.org
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[conventional_commits]: https://www.conventionalcommits.org
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[gh]: https://cli.github.com/
[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
[github-issues]: https://github.com/neovim/neovim/issues
[1820]: https://github.com/neovim/neovim/pull/1820
[hub]: https://hub.github.com/
[conventional_commits]: https://www.conventionalcommits.org
[style-guide]: http://neovim.io/develop/style-guide.xml
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[3174]: https://github.com/neovim/neovim/issues/3174
[Travis CI]: https://travis-ci.org/neovim/neovim
[sourcehut]: https://builds.sr.ht/~jmk
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[Clang report]: https://neovim.io/doc/reports/clang/
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
[lua-language-server]: https://github.com/sumneko/lua-language-server/
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
[uncrustify]: http://uncrustify.sourceforge.net/
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ

View File

@ -189,8 +189,17 @@ contributed under the Vim license and (2) externally maintained libraries.
The externally maintained libraries used by Neovim are:
- Klib: a Generic Library in C. MIT/X11 license.
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
- Lua: MIT license
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
- Luv: Apache 2.0 license
- libmpack: MIT license
- libtermkey: MIT license
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
- libvterm: MIT license
- lua-compat: MIT license
- tree-sitter: MIT license
- xdiff: LGPL license
- lua-cjson: MIT license
====

View File

@ -10,14 +10,13 @@ General guidelines
* Write down what was decided
* Constraints are good
* Use automation to solve problems
* Never break the API
* Never break the API... but sometimes break the UI
Ticket triage
-------------
In practice we haven't found a meaningful way to forecast more precisely than
"next" and "after next". That means there are usually one or two (at most)
planned milestones:
In practice we haven't found a way to forecast more precisely than "next" and
"after next". So there are usually one or two (at most) planned milestones:
- Next bugfix-release (1.0.x)
- Next feature-release (1.x.0)
@ -25,16 +24,16 @@ planned milestones:
The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
- PRs nearing completion (RDY).
- PRs nearing completion.
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
for having a plan written down: it is _closer to completion_ than tickets
without a plan.
- Comment activity or new information.
Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
Anything that isn't in the next milestone, and doesn't have a finished PR—is
just not something you care very much about, by construction. Post-release you
can review open issues, but chances are your next milestone is already getting
full :)
full... :)
Release policy
--------------
@ -53,9 +52,42 @@ has a major bug:
3. Cut a release from `release-x.y`.
- Run `./scripts/release.sh`
- Update (force-push) the remote `stable` tag.
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
- The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
will update the release assets based on the `stable` tag.
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
In order to trigger the action, a PR must be labeled with a label matching the
form `backport release-0.X`.
Third-party dependencies
--------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`:
- [Lua](https://www.lua.org/download.html)
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
- [Luv](https://github.com/luvit/luv)
- [libtermkey](https://github.com/neovim/libtermkey)
- [libuv](https://github.com/libuv/libuv)
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
See `./scripts/bump-deps.sh -h` for more detailed usage
- Run `./scripts/bump-deps.sh --pr` to create a pr
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
These dependencies are "vendored" (inlined), we need to update the sources manually:
- [libmpack](https://github.com/libmpack/libmpack)
- [xdiff](https://github.com/git/git/tree/master/xdiff)
- [lua-cjson](https://github.com/openresty/lua-cjson)
- [Klib](https://github.com/attractivechaos/klib)
- [inspect.lua](https://github.com/kikito/inspect.lua)
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
https://github.com/neovim/neovim/wiki/Deps
See also
--------

118
Makefile
View File

@ -1,4 +1,6 @@
THIS_DIR = $(shell pwd)
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
@ -12,6 +14,7 @@ CMAKE_BUILD_TYPE ?= Debug
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
# Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?=
NVIM_PRG := $(MAKEFILE_DIR)/build/bin/nvim
# CMAKE_INSTALL_PREFIX
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
@ -35,7 +38,7 @@ else
checkprefix: ;
endif
BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
echo "Unix Makefiles")
DEPS_BUILD_DIR ?= .deps
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
@ -43,29 +46,22 @@ ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
endif
ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(BUILD_TYPE))
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
BUILD_TOOL := ninja
else
# User's version of CMake doesn't support Ninja
BUILD_TOOL = $(MAKE)
BUILD_TYPE := Unix Makefiles
endif
ifeq (Ninja,$(CMAKE_GENERATOR))
BUILD_TOOL = ninja
else
BUILD_TOOL = $(MAKE)
endif
endif
BUILD_CMD = $(BUILD_TOOL)
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j and -n flags.
ifeq ($(BUILD_TYPE),Ninja)
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
ifeq ($(CMAKE_GENERATOR),Ninja)
ifneq ($(VERBOSE),)
BUILD_CMD += -v
BUILD_TOOL += -v
endif
BUILD_CMD += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- '-j[0-9]\+')
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
BUILD_CMD += -n
BUILD_TOOL += -n
endif
endif
@ -87,33 +83,33 @@ endif
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
nvim: build/.ran-cmake deps
+$(BUILD_CMD) -C build
+$(BUILD_TOOL) -C build
libnvim: build/.ran-cmake deps
+$(BUILD_CMD) -C build libnvim
+$(BUILD_TOOL) -C build libnvim
cmake:
touch CMakeLists.txt
$(MAKE) build/.ran-cmake
build/.ran-cmake: | deps
cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_DIR)
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
touch $@
deps: | build/.ran-third-party-cmake
deps: | build/.ran-deps-cmake
ifeq ($(call filter-true,$(USE_BUNDLED)),)
+$(BUILD_CMD) -C $(DEPS_BUILD_DIR)
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
endif
ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR):
mkdir -p "$@"
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
cd $(DEPS_BUILD_DIR) && \
$(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
endif
build/.ran-third-party-cmake::
build/.ran-deps-cmake::
mkdir -p build
touch $@
@ -121,58 +117,26 @@ build/.ran-third-party-cmake::
oldtest: | nvim build/runtime/doc/tags
+$(SINGLE_MAKE) -C src/nvim/testdir clean
ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
else
@# Handle TEST_FILE=test_foo{,.res,.vim}.
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
endif
# Build oldtest by specifying the relative .vim filename.
.PHONY: phony_force
src/nvim/testdir/%.vim: phony_force
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
build/runtime/doc/tags helptags: | nvim
+$(BUILD_CMD) -C build runtime/doc/tags
functionaltest functionaltest-lua unittest benchmark: | nvim
$(BUILD_TOOL) -C build $@
# Builds help HTML _and_ checks for invalid help tags.
helphtml: | nvim build/runtime/doc/tags
+$(BUILD_CMD) -C build doc_html
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
functionaltest-lua: | nvim
+$(BUILD_CMD) -C build functionaltest-lua
lualint: | build/.ran-cmake deps
$(BUILD_CMD) -C build lualint
shlint:
@shellcheck --version | head -n 2
shellcheck scripts/vim-patch.sh
_opt_shlint:
@command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
|| echo "SKIP: shlint (shellcheck not found)"
pylint:
flake8 contrib/ scripts/ src/ test/
# Run pylint only if flake8 is installed.
_opt_pylint:
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|| echo "SKIP: pylint (flake8 not found)"
unittest: | nvim
+$(BUILD_CMD) -C build unittest
benchmark: | nvim
+$(BUILD_CMD) -C build benchmark
lintlua lintsh lintpy lintuncrustify lintc lintcfull check-single-includes generated-sources lintcommit lint formatc formatlua format: | build/.ran-cmake
$(CMAKE_PRG) --build build --target $@
test: functionaltest unittest
clean:
+test -d build && $(BUILD_CMD) -C build clean || true
+test -d build && $(BUILD_TOOL) -C build clean || true
$(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean
$(MAKE) -C runtime/indent clean
@ -182,19 +146,7 @@ distclean:
$(MAKE) clean
install: checkprefix nvim
+$(BUILD_CMD) -C build install
clint: build/.ran-cmake
+$(BUILD_CMD) -C build clint
clint-full: build/.ran-cmake
+$(BUILD_CMD) -C build clint-full
check-single-includes: build/.ran-cmake
+$(BUILD_CMD) -C build check-single-includes
generated-sources: build/.ran-cmake
+$(BUILD_CMD) -C build generated-sources
+$(BUILD_TOOL) -C build install
appimage:
bash scripts/genappimage.sh
@ -205,16 +157,14 @@ appimage:
appimage-%:
bash scripts/genappimage.sh $*
lint: check-single-includes clint lualint _opt_pylint _opt_shlint
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles".
ifeq ($(BUILD_TYPE),Ninja)
ifeq ($(CMAKE_GENERATOR),Ninja)
build/%: phony_force
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
$(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix
.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix lintcommit formatc formatlua format

View File

@ -1,11 +1,12 @@
[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png)](https://neovim.io)
<h1 align="center">
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
</h1>
[Documentation](https://neovim.io/doc/general/) |
[Chat](https://gitter.im/neovim/neovim) |
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
[Twitter](https://twitter.com/Neovim)
[![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3A%22CI%22)
[![Codecov coverage](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim)
[![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
[![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
[![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
@ -46,8 +47,7 @@ Install from package
Pre-built packages for Windows, macOS, and Linux are found on the
[Releases](https://github.com/neovim/neovim/releases/) page.
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux],
[Gentoo], and more!
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Void Linux], [Gentoo], and more!
Install from source
-------------------
@ -62,10 +62,10 @@ After installing the dependencies, run the following command.
To install to a non-default location:
make CMAKE_INSTALL_PREFIX=/full/path/
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/
make install
To inspect the build, these CMake features are useful:
CMake hints for inspecting the build:
- `cmake --build build --target help` lists all build targets.
- `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables.
@ -80,8 +80,10 @@ Project layout
--------------
├─ ci/ build automation
├─ cmake/ build scripts
├─ runtime/ user plugins/docs
├─ cmake/ CMake utils
├─ cmake.config/ CMake defines
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
├─ runtime/ plugins and docs
├─ src/nvim/ application source code (see src/nvim/README.md)
│ ├─ api/ API subsystem
│ ├─ eval/ VimL subsystem
@ -92,7 +94,6 @@ Project layout
│ ├─ msgpack_rpc/ RPC subsystem
│ ├─ os/ low-level platform code
│ └─ tui/ built-in UI
├─ third-party/ CMake subproject to build dependencies
└─ test/ tests (see test/README.md)
License
@ -120,8 +121,9 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
[Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://apps.fedoraproject.org/packages/neovim
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
[Homebrew]: https://formulae.brew.sh/formula/neovim

View File

@ -7,16 +7,13 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
mkdir -p "${HOME}/.cache"
echo "before_cache.sh: cache size"
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
echo "before_cache.sh: ccache stats"
ccache -s 2>/dev/null || true
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
find "${HOME}/.ccache" -name stats -delete
# Update the third-party dependency cache only if the build was successful.
if ended_successfully; then
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
# Do not cache downloads. They should not be needed with up-to-date deps.
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
rm -rf "${CACHE_NVIM_DEPS_DIR}"

View File

@ -1,59 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo 'Python info:'
(
set -x
python3 --version
python2 --version
python --version
pip3 --version
pip2 --version
pip --version
pyenv --version
pyenv versions
) 2>&1 | sed 's/^/ /' || true
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
echo 'Setting Python versions via pyenv'
# Prefer Python 2 over 3 (more conservative).
pyenv global 2.7:3.8
echo 'Updated Python info:'
(
set -x
python3 --version
python2 --version
python --version
python3 -m pip --version
python2 -m pip --version
) 2>&1 | sed 's/^/ /'
fi
echo "Install node (LTS)"
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
fi
source ~/.nvm/nvm.sh
nvm install 10
if [[ -n "$CMAKE_URL" ]]; then
echo "Installing custom CMake: $CMAKE_URL"
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
cmake_version="$(cmake --version)"
echo "$cmake_version" | grep -qF '2.8.12' || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
fi

View File

@ -6,12 +6,6 @@ set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
# Enable ipv6 on Travis. ref: a39c8b7ce30d
if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then
echo "before_script.sh: enable ipv6"
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
fi
# Test some of the configuration variables.
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
echo "\$GCOV: '${GCOV}' is not executable."
@ -22,18 +16,6 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
exit 1
fi
echo "before_script.sh: ccache stats (will be cleared)"
ccache -s
# Reset ccache stats for real results in before_cache.
ccache --zero-stats
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
# Adds user to a dummy group.
# That allows to test changing the group of the file by `os_fchown`.
sudo dscl . -create /Groups/chown_test
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
fi
# Compile dependencies.
build_deps

View File

@ -1,24 +1,32 @@
param([switch]$NoTests)
[CmdletBinding(DefaultParameterSetName = "Build")]
param(
[Parameter(ParameterSetName="Build")][switch]$Build,
[Parameter(ParameterSetName="BuildDeps")][switch]$BuildDeps,
[Parameter(ParameterSetName="EnsureTestDeps")][switch]$EnsureTestDeps,
[Parameter(ParameterSetName="Package")][switch]$Package,
[Parameter(ParameterSetName="Test")][switch]$Test,
[Parameter(ParameterSetName="TestOld")][switch]$TestOld
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
$bits = $Matches.bits
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)")
$buildDir = Join-Path -Path $projectDir -ChildPath "build"
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
CMAKE_BUILD_TYPE=$cmakeBuildType;
}
$nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
CMAKE_BUILD_TYPE=$cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim';
DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
DEPS_PREFIX=$(if ($null -ne $env:DEPS_PREFIX) {$env:DEPS_PREFIX} else {".deps/usr"});
}
if ($env:DEPS_BUILD_DIR -eq $null) {
$env:DEPS_BUILD_DIR = ".deps";
if ($null -eq $env:DEPS_BUILD_DIR) {
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps"
}
$uploadToCodeCov = $false
@ -28,141 +36,97 @@ function exitIfFailed() {
}
}
if (-not $NoTests) {
node --version
npm.cmd --version
function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | ForEach-Object { "-D$($_.Key)=$($_.Value)" }
}
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
mkdir $env:DEPS_BUILD_DIR
} else {
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
}
if ($compiler -eq 'MINGW') {
if ($bits -eq 32) {
$arch = 'i686'
}
elseif ($bits -eq 64) {
$arch = 'x86_64'
}
if ($compileOption -eq 'gcov') {
$nvimCmakeVars['USE_GCOV'] = 'ON'
$uploadToCodecov = $true
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
# Setup/build Lua coverage.
$env:USE_LUACOV = 1
$env:BUSTED_ARGS = "--coverage"
}
# These are native MinGW builds, but they use the toolchain inside
# MSYS2, this allows using all the dependencies and tools available
# in MSYS2, but we cannot build inside the MSYS2 shell.
$cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
"mingw-w64-$arch-$_"
})
# Add MinGW to the PATH
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
# Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
}
elseif ($compiler -eq 'MSVC') {
$cmakeGeneratorArgs = '/verbosity:normal'
if ($bits -eq 32) {
$cmakeGenerator = 'Visual Studio 15 2017'
}
elseif ($bits -eq 64) {
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
Set-Content env:\"$name" $value
}
}
if (-not $NoTests) {
# Setup python (use AppVeyor system python)
function BuildDeps {
# Disambiguate python3, if needed
if (-not (Test-Path -Path C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe) ) {
move C:\hostedtoolcache\windows\Python\3.5.4\x64\python.exe C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe
if (Test-Path -PathType container $env:DEPS_BUILD_DIR) {
$cachedBuildTypeStr = $(Get-Content $env:DEPS_BUILD_DIR\CMakeCache.txt | Select-String -Pattern "CMAKE_BUILD_TYPE.*=($cmakeBuildType)")
if (-not $cachedBuildTypeStr) {
Write-Warning " unable to validate build type from cache dir ${env:DEPS_BUILD_DIR}"
}
}
$env:PATH = "C:\hostedtoolcache\windows\Python\2.7.18\x64;C:\hostedtoolcache\windows\Python\3.5.4\x64;$env:PATH"
python -m pip install pynvim ; exitIfFailed
python3 -m pip install pynvim ; exitIfFailed
# we currently can't use ninja for cmake.deps, see #19405
$depsCmakeGenerator = "Visual Studio 16 2019"
$depsCmakeGeneratorPlf = "x64"
cmake -S "$projectDir\cmake.deps" -B $env:DEPS_BUILD_DIR -G $depsCmakeGenerator -A $depsCmakeGeneratorPlf $(convertToCmakeArgs($depsCmakeVars)); exitIfFailed
$depsCmakeNativeToolOptions= @('/verbosity:normal', '/m')
cmake --build $env:DEPS_BUILD_DIR --config $cmakeBuildType -- $depsCmakeNativeToolOptions; exitIfFailed
}
function Build {
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
cmake --build $buildDir --config $cmakeBuildType; exitIfFailed
}
function EnsureTestDeps {
& $buildDir\bin\nvim.exe "--version"; exitIfFailed
# Ensure that the "win32" feature is set.
& $buildDir\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
python -m pip install pynvim
# Sanity check
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
python -c "import pynvim; print(str(pynvim))"; exitIfFailed
gem.cmd install --pre neovim
Get-Command -CommandType Application neovim-ruby-host.bat
Get-Command -CommandType Application neovim-ruby-host.bat; exitIfFailed
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
node --version
npm.cmd --version
npm.cmd install -g neovim; exitIfFailed
Get-Command -CommandType Application neovim-node-host.cmd; exitIfFailed
npm.cmd link neovim
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
}
}
if ($compiler -eq 'MSVC') {
# Required for LuaRocks (https://github.com/luarocks/luarocks/issues/1039#issuecomment-507296940).
$env:VCINSTALLDIR = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/"
}
function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
}
cd $env:DEPS_BUILD_DIR
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd $buildDir
# Build Neovim
mkdir build
cd build
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
.\bin\nvim --version ; exitIfFailed
# Ensure that the "win32" feature is set.
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
}
if (-not $NoTests) {
function Test {
# Functional tests
# The $LastExitCode from MSBuild can't be trusted
$failed = $false
# Run only this test file:
# $env:TEST_FILE = "test\functional\foo.lua"
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
foreach { $failed = $failed -or
cmake --build $buildDir --target functionaltest 2>&1 |
ForEach-Object { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ }
if ($uploadToCodecov) {
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\bin\luacov.bat
}
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
if ($failed) {
exit $LastExitCode
}
if (-not $uploadToCodecov) {
return
}
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\bin\luacov.bat
}
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
function TestOld {
# Old tests
# Add MSYS to path, required for e.g. `find` used in test scripts.
# But would break functionaltests, where its `more` would be used then.
$OldPath = $env:PATH
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
& "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path $projectDir\src\nvim\testdir) VERBOSE=1; exitIfFailed
$env:PATH = $OldPath
if ($uploadToCodecov) {
@ -170,8 +134,13 @@ if (-not $NoTests) {
}
}
# Build artifacts
cpack -G ZIP -C RelWithDebInfo
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
cpack -G NSIS -C RelWithDebInfo
function Package {
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
cmake --build $buildDir --target package; exitIfFailed
}
if ($PSCmdlet.ParameterSetName) {
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
exit
}

View File

@ -8,8 +8,6 @@ _stat() {
top_make() {
printf '%78s\n' | tr ' ' '='
# Travis has 1.5 virtual cores according to:
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
ninja "$@"
}
@ -26,9 +24,7 @@ build_deps() {
mkdir -p "${DEPS_BUILD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists.
if test "${CACHE_ENABLE}" = "false" ; then
export CCACHE_RECACHE=1
elif test -f "${CACHE_MARKER}" ; then
if test -f "${CACHE_MARKER}"; then
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
fi
@ -37,7 +33,7 @@ build_deps() {
# update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/third-party/"
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/"
if ! top_make; then
exit 1
@ -46,7 +42,9 @@ build_deps() {
cd "${CI_BUILD_DIR}"
}
prepare_build() {
build_nvim() {
check_core_dumps --delete quiet
if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi
@ -55,9 +53,8 @@ prepare_build() {
cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
}
build_nvim() {
echo "Building nvim."
if ! top_make nvim ; then
exit 1

View File

@ -4,7 +4,7 @@
# Args:
# $1: Flag(s) for codecov, separated by comma.
set -ex
set -e
# Change to grandparent dir (POSIXly).
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
@ -18,12 +18,12 @@ if ! [ -f "$codecov_sh" ]; then
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
chmod +x "$codecov_sh"
python3 -m pip install --quiet --user gcovr
python -m pip install --quiet --user gcovr
fi
(
cd build
python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
)
# Upload to codecov.

View File

@ -1,9 +1,3 @@
# HACK: get newline for use in strings given that "\n" and $'' do not work.
NL="$(printf '\nE')"
NL="${NL%E}"
FAIL_SUMMARY=""
# Test success marker. If END_MARKER file exists, we know that all tests
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
# file will contain information about failed tests. Build is considered
@ -11,190 +5,27 @@ FAIL_SUMMARY=""
END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
ANSI_CLEAR="\033[0K"
if test "$TRAVIS" = "true"; then
ci_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
name="$(echo -n "$name" | sed 's/-$//')"
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
}
elif test "$GITHUB_ACTIONS" = "true"; then
ci_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
name="$(echo -n "$name" | sed 's/-$//')"
case "$action" in
start)
echo "::group::${name}"
;;
end)
echo "::endgroup::"
;;
*)
:;;
esac
}
else
ci_fold() {
return 0
}
fi
enter_suite() {
set +x
FAILED=0
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
set -x
}
exit_suite() {
set +x
if test $FAILED -ne 0 ; then
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
else
ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then
exit $FAILED
else
local saved_failed=$FAILED
FAILED=0
return $saved_failed
fi
}
fail() {
local test_name="$1"
local fail_char="$2"
local message="$3"
local message="$2"
: ${fail_char:=F}
: ${message:=Test $test_name failed}
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
local full_msg="$test_name :: $message"
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
echo "Failed: $full_msg"
FAILED=1
}
run_test() {
local cmd="$1"
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
if ! eval "$cmd" ; then
fail "${test_name}" "$@"
fi
}
run_test_wd() {
local hang_ok=
if test "$1" = "--allow-hang" ; then
hang_ok=1
shift
fi
local timeout="$1"
test $# -gt 0 && shift
local cmd="$1"
test $# -gt 0 && shift
local restart_cmd="$1"
: ${restart_cmd:=true}
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
local output_file="$(mktemp)"
local status_file="$(mktemp)"
local sid_file="$(mktemp)"
local restarts=5
local prev_tmpsize=-1
while test $restarts -gt 0 ; do
: > "$status_file"
: > "$sid_file"
setsid \
env \
output_file="$output_file" \
status_file="$status_file" \
sid_file="$sid_file" \
cmd="$cmd" \
CI_DIR="$CI_DIR" \
sh -c '
. "${CI_DIR}/common/test.sh"
ps -o sid= > "$sid_file"
(
ret=0
if ! eval "$cmd" 2>&1 ; then
ret=1
fi
echo "$ret" > "$status_file"
) | tee -a "$output_file"
'
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
prev_tmpsize=$tmpsize
sleep $timeout
tmpsize="$(stat -c "%s" "$output_file")"
if test $tempsize -eq $prev_temsize ; then
# no output, assuming either hang or exit
break
fi
done
restarts=$(( restarts - 1 ))
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
# Status file not updated, assuming hang
# SID not known, this should not ever happen
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
fail "$test_name" E "Shell did not run"
break
fi
# Kill all processes which belong to one session: should get rid of test
# processes as well as sh itself.
pkill -KILL -s$(cat "$sid_file")
if test $restarts -eq 0 ; then
if test -z "$hang_ok" ; then
fail "$test_name" E "Test hang up"
fi
else
echo "Test ${test_name} hang up, restarting"
eval "$restart_cmd"
fi
else
local new_failed="$(cat "$status_file")"
if test "$new_failed" != "0" ; then
fail "$test_name" F "Test failed in run_test_wd"
fi
break
fi
done
rm -f "$output_file"
rm -f "$status_file"
rm -f "$sid_file"
}
ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:'
cat "${FAIL_SUMMARY_FILE}"
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
rm -f "$FAIL_SUMMARY_FILE"
fi
return 1
fi
if ! test -f "${END_MARKER}" ; then

View File

@ -51,7 +51,7 @@ check_core_dumps() {
fi
done
if test "$app" != quiet ; then
fail 'cores' E 'Core dumps found'
fail 'cores' 'Core dumps found'
fi
}
@ -72,7 +72,7 @@ check_logs() {
rm "${log}"
done
if test -n "${err}" ; then
fail 'logs' E 'Runtime errors detected.'
fail 'logs' 'Runtime errors detected.'
fi
}
@ -86,46 +86,39 @@ check_sanitizer() {
fi
}
run_unittests() {(
enter_suite unittests
unittests() {(
ulimit -c unlimited || true
if ! build_make unittest ; then
fail 'unittests' F 'Unit tests failed'
fail 'unittests' 'Unit tests failed'
fi
submit_coverage unittest
check_core_dumps "$(command -v luajit)"
exit_suite
)}
run_functionaltests() {(
enter_suite functionaltests
functionaltests() {(
ulimit -c unlimited || true
if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' F 'Functional tests failed'
fail 'functionaltests' 'Functional tests failed'
fi
submit_coverage functionaltest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite
)}
run_oldtests() {(
enter_suite oldtests
oldtests() {(
ulimit -c unlimited || true
if ! make oldtest; then
reset
fail 'oldtests' F 'Legacy tests failed'
fail 'oldtests' 'Legacy tests failed'
fi
submit_coverage oldtest
check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
check_core_dumps
exit_suite
)}
check_runtime_files() {(
set +x
local test_name="$1" ; shift
local message="$1" ; shift
local tst="$1" ; shift
@ -136,27 +129,25 @@ check_runtime_files() {(
# Prefer failing the build over using more robust construct because files
# with IFS are not welcome.
if ! test -e "$file" ; then
fail "$test_name" E \
"It appears that $file is only a part of the file name"
fail "$test_name" "It appears that $file is only a part of the file name"
fi
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
fail "$test_name" F "$(printf "$message" "$file")"
fail "$test_name" "$(printf "$message" "$file")"
fi
done
)}
install_nvim() {(
enter_suite 'install_nvim'
if ! build_make install ; then
fail 'install' E 'make install failed'
exit_suite
fail 'install' 'make install failed'
exit 1
fi
"${INSTALL_PREFIX}/bin/nvim" --version
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly."
fail 'help' F 'Failed running :help'
fail 'help' 'Failed running :help'
fi
# Check that all runtime files were installed
@ -177,13 +168,6 @@ install_nvim() {(
local genvimsynf=syntax/vim/generated.vim
local gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
fi
exit_suite
)}
csi_clean() {
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
find "${BUILD_DIR}" -name '*test-include*.o' -delete
}

View File

@ -3,31 +3,18 @@
set -e
set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then
python3 -m pip -q install --user --upgrade flake8
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH"
fi
# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python 3."
echo "Install neovim module for Python."
CC=cc python3 -m pip -q install --user --upgrade pynvim
if python2 -m pip -c True 2>&1; then
echo "Install neovim module for Python 2."
CC=cc python2 -m pip -q install --user --upgrade pynvim
fi
echo "Install neovim RubyGem."
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
echo "Install neovim npm package"
source ~/.nvm/nvm.sh
nvm use 10
npm install -g neovim
npm link neovim
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
if [[ $CI_OS_NAME != osx ]]; then
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
fi

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite 'clint'
run_test 'make clint-full' clint
exit_suite --continue
enter_suite 'lualint'
run_test 'make lualint' lualint
exit_suite --continue
enter_suite 'pylint'
run_test 'make pylint' pylint
exit_suite --continue
enter_suite 'shlint'
run_test 'make shlint' shlint
exit_suite --continue
enter_suite single-includes
CLICOLOR_FORCE=1 run_test_wd \
--allow-hang \
10s \
'make check-single-includes' \
'csi_clean' \
single-includes
exit_suite --continue
end_tests

View File

@ -8,33 +8,34 @@ source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite build
rm -f "$END_MARKER"
check_core_dumps --delete quiet
# Run all tests (with some caveats) if no input argument is given
if (($# == 0)); then
tests=('build_nvim')
prepare_build
build_nvim
exit_suite --continue
source ~/.nvm/nvm.sh
nvm use 10
enter_suite tests
if test "$CLANG_SANITIZER" != "TSAN" ; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
run_test run_unittests
if test "$CLANG_SANITIZER" != "TSAN"; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
tests+=('unittests')
fi
tests+=('functionaltests')
fi
run_test run_functionaltests
tests+=('oldtests' 'install_nvim')
else
tests=("$@")
fi
run_test run_oldtests
run_test install_nvim
exit_suite --continue
for i in "${tests[@]}"; do
eval "$i" || fail "$i"
done
end_tests
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# This will pass the environment variables down to a bash process which runs
# as $USER, while retaining the environment variables defined and belonging
# to secondary groups given above in usermod.
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
else
ci/run_${CI_TARGET}.sh
fi
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

View File

@ -8,7 +8,7 @@ WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
snap_realease_needed() {
snap_release_needed() {
last_committed_tag="$(git tag -l --sort=refname|head -1)"
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
git fetch -f --tags
@ -24,7 +24,7 @@ snap_realease_needed() {
trigger_snapcraft_webhook() {
[[ -n "${PAYLOAD_SIG}" ]] || exit
echo "Triggering new snap relase via webhook..."
echo "Triggering new snap release via webhook..."
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
@ -33,7 +33,7 @@ trigger_snapcraft_webhook() {
}
if $(snap_realease_needed); then
if $(snap_release_needed); then
echo "New snap release required"
trigger_snapcraft_webhook
fi

View File

@ -5,17 +5,13 @@ include(CheckIncludeFiles)
include(CheckCSourceRuns)
include(CheckCSourceCompiles)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("intmax_t" SIZEOF_INTMAX_T)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("void *" SIZEOF_VOID_PTR)
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-(Microsoft|microsoft-standard)")
# Windows Subsystem for Linux
set(HAVE_WSL 1)
endif()
check_type_size("int" SIZEOF_INT LANGUAGE C)
check_type_size("long" SIZEOF_LONG LANGUAGE C)
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
check_type_size("int32_t" SIZEOF_INT32_T LANGUAGE C)
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
check_type_size("long long" SIZEOF_LONG_LONG LANGUAGE C)
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
@ -50,10 +46,24 @@ check_function_exists(readlink HAVE_READLINK)
check_function_exists(setpgid HAVE_SETPGID)
check_function_exists(setsid HAVE_SETSID)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(strnlen HAVE_STRNLEN)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(strptime HAVE_STRPTIME)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
check_c_source_compiles("
#include <termios.h>
int
main(void)
{
return forkpty(0, NULL, NULL, NULL);
}
" HAVE_FORKPTY)
else()
set(HAVE_FORKPTY 1)
endif()
# Symbols
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
if(HAVE_LANGINFO_H)
@ -97,7 +107,7 @@ if (NOT "${HAVE_BE64TOH}")
# any case and ORDER_BIG_ENDIAN will not be examined.
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which
# will work regardless of endianess. Function is sub-optimal though.
# will work regardless of endianness. Function is sub-optimal though.
check_c_source_runs("
${SI}
${MS}
@ -118,14 +128,14 @@ endif()
# generate configuration header and update include directories
configure_file (
"${PROJECT_SOURCE_DIR}/config/config.h.in"
"${PROJECT_BINARY_DIR}/config/auto/config.h"
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
)
# generate version definitions
configure_file (
"${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
"${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
"${PROJECT_SOURCE_DIR}/cmake.config/versiondef.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h"
)
# generate pathdef.c
@ -148,6 +158,6 @@ elseif (EXISTS ${HOSTNAME_PROG})
endif()
configure_file (
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
ESCAPE_QUOTES)

View File

@ -3,8 +3,12 @@
#cmakedefine DEBUG
#define SIZEOF_INT @SIZEOF_INT@
#define SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
#cmakedefine SIZEOF_INT32_T @SIZEOF_INT32_T@
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#if @SIZEOF_VOID_PTR@ == 8
#define ARCH_64
@ -12,7 +16,7 @@
#define ARCH_32
#endif
#define PROJECT_NAME "@PROJECT_NAME@"
#cmakedefine PROJECT_NAME "@PROJECT_NAME@"
#cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_FD_CLOEXEC
@ -30,6 +34,7 @@
#cmakedefine HAVE_SETPGID
#cmakedefine HAVE_SETSID
#cmakedefine HAVE_SIGACTION
#cmakedefine HAVE_STRNLEN
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRNCASECMP
@ -39,7 +44,6 @@
#cmakedefine HAVE_SYS_WAIT_H
#cmakedefine HAVE_TERMIOS_H
#cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine HAVE_WSL
#cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME
#cmakedefine USE_FNAME_CASE
@ -50,6 +54,7 @@
# undef HAVE_SYS_UIO_H
# endif
#endif
#cmakedefine HAVE_FORKPTY
#cmakedefine FEAT_TUI

View File

@ -1,19 +1,20 @@
# This is not meant to be included by the top-level.
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.10)
project(NVIM_DEPS C)
# Needed for: check_c_compiler_flag()
include(CheckCCompilerFlag)
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
# In Windows/MSVC CMAKE_BUILD_TYPE changes the paths/linking of the build
# recipes (libuv, msgpack), make sure it is set
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
include(CheckCCompilerFlag)
include(Util)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig)
set(BUILD_TYPE_STRING -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
set_default_buildtype()
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
check_c_compiler_flag(-Og HAS_OG_FLAG)
@ -39,7 +40,6 @@ set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependencies dow
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_GPERF "Use the bundled version of gperf." ${USE_BUNDLED})
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
@ -64,11 +64,9 @@ endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
if(WIN32)
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "Git is required to apply patches for Windows.")
endif()
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "Git is required to apply patches.")
endif()
if(UNIX)
@ -97,7 +95,7 @@ endif()
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
find_program(MAKE_PRG NAMES mingw32-make)
if(NOT MAKE_PRG)
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependecies.")
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependencies.")
else()
message(STATUS "Found GNU Make for mingw32: ${MAKE_PRG}")
endif()
@ -109,10 +107,6 @@ else()
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
endif()
if(USE_BUNDLED_GPERF)
enable_language(CXX)
endif()
if(CMAKE_CXX_COMPILER)
set(DEPS_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
endif()
@ -124,93 +118,103 @@ if(CMAKE_OSX_SYSROOT)
endif()
endif()
# Cross compiling: use these for dependencies built for the
# HOST system, when not crosscompiling these should be the
# same as DEPS_*. Except when targeting Unix in which case
# want all the dependencies to use the same compiler.
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
set(HOSTDEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/host")
set(HOSTDEPS_BIN_DIR "${HOSTDEPS_INSTALL_DIR}/bin")
set(HOSTDEPS_LIB_DIR "${HOSTDEPS_INSTALL_DIR}/lib")
set(HOSTDEPS_C_COMPILER "${HOST_C_COMPILER}")
set(HOSTDEPS_CXX_COMPILER "${HOST_CXX_COMPILER}")
else()
set(HOSTDEPS_INSTALL_DIR "${DEPS_INSTALL_DIR}")
set(HOSTDEPS_BIN_DIR "${DEPS_BIN_DIR}")
set(HOSTDEPS_LIB_DIR "${DEPS_LIB_DIR}")
set(HOSTDEPS_C_COMPILER "${DEPS_C_COMPILER}")
set(HOSTDEPS_CXX_COMPILER "${DEPS_CXX_COMPILER}")
if(CMAKE_OSX_ARCHITECTURES)
string(REPLACE ";" "|" CMAKE_OSX_ARCHITECTURES_ALT_SEP "${CMAKE_OSX_ARCHITECTURES}")
# The LuaJIT build does not like being passed multiple `-arch` flags
# so we handle a universal build the old-fashioned way.
set(LUAJIT_C_COMPILER "${DEPS_C_COMPILER}")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -arch ${ARCH}")
if(DEPS_CXX_COMPILER)
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -arch ${ARCH}")
endif()
endforeach()
endif()
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message("-- Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
set(HOSTDEPS_INSTALL_DIR "${DEPS_INSTALL_DIR}")
set(HOSTDEPS_BIN_DIR "${DEPS_BIN_DIR}")
set(HOSTDEPS_LIB_DIR "${DEPS_LIB_DIR}")
set(HOSTDEPS_C_COMPILER "${DEPS_C_COMPILER}")
set(HOSTDEPS_CXX_COMPILER "${DEPS_CXX_COMPILER}")
include(ExternalProject)
if(WIN32)
# "nvim" branch of https://github.com/neovim/libuv
set(LIBUV_URL https://github.com/neovim/libuv/archive/b899d12b0d56d217f31222da83f8c398355b69ef.tar.gz)
set(LIBUV_SHA256 eb7e37b824887e1b31a4e31d1d9bad4c03d8b98532d9cce5f67a3b70495a4b2a)
else()
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.34.2.tar.gz)
set(LIBUV_SHA256 0d9d38558b45c006c1ea4e8529bae64caf8becda570295ea74e3696362aeb7f2)
endif()
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.44.2.tar.gz)
set(LIBUV_SHA256 e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/cpp-3.0.0/msgpack-3.0.0.tar.gz)
set(MSGPACK_SHA256 bfbb71b7c02f806393bc3cbc491b40523b89e64f83860c58e3e54af47de176e4)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-4.0.0/msgpack-c-4.0.0.tar.gz)
set(MSGPACK_SHA256 420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8)
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/787736990ac3b7d5ceaba2697c7d0f58f77bb782.tar.gz)
set(LUAJIT_SHA256 2e3f74bc279f46cc463abfc67b36e69faaf0366237004771f4cac4bf2a9f5efb)
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/633f265f67f322cbe2c5fd11d3e46d968ac220f7.tar.gz)
set(LUAJIT_SHA256 2681f0a6f624a64a8dfb70a5a377d494daf38960442c547d9c468674c1afa3c2)
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz)
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333)
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.2.1.tar.gz)
set(LUAROCKS_SHA256 0cab9f79311083f33e4d8f5a76021604f1d3f7141ce9a2ef1d8b717d92058370)
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.8.0.tar.gz)
set(LUAROCKS_SHA256 ab6612ca9ab87c6984871d2712d05525775e8b50172701a0a1cabddf76de2be7)
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/92d929f.tar.gz)
set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a02e4b)
set(LIBTERMKEY_URL http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz)
set(LIBTERMKEY_URL https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz)
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
set(LIBVTERM_URL http://www.leonerd.org.uk/code/libvterm/libvterm-0.1.4.tar.gz)
set(LIBVTERM_SHA256 bc70349e95559c667672fc8c55b9527d9db9ada0fb80a3beda533418d782d3dd)
set(LIBVTERM_URL https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz)
set(LIBVTERM_SHA256 61eb0d6628c52bdf02900dfd4468aa86a1a7125228bab8a67328981887483358)
set(LUV_VERSION 1.30.1-1)
set(LUV_URL https://github.com/luvit/luv/archive/${LUV_VERSION}.tar.gz)
set(LUV_SHA256 2b17921e2e18094df6221e3cd291c82d4569e50d8c081518d3e775dceae267cf)
set(LUV_VERSION 1.44.2-1)
set(LUV_URL https://github.com/luvit/luv/archive/1.44.2-1.tar.gz)
set(LUV_SHA256 f8c69908e17ec8ab370253d1508e23deaecfc0c4752d2efb77e427e579501104)
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.7.tar.gz)
set(LUA_COMPAT53_SHA256 bec3a23114a3d9b3218038309657f0f506ad10dfbc03bb54e91da7e5ffdba0a2)
set(GPERF_URL https://github.com/neovim/deps/raw/ff5b4b18a87397a8564016071ae64f64bcd8c635/opt/gperf-3.1.tar.gz)
set(GPERF_SHA256 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2)
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
# cat.exe curl.exe curl-ca-bundle.crt diff.exe tee.exe xxd.exe
set(WINTOOLS_URL https://github.com/neovim/deps/raw/9efd42511dcab26995fa3490f2319b270949159e/opt/win32tools.zip)
set(WINTOOLS_SHA256 378069d88a34e7f7283622213569020a2aba7a54f0b431fba28690f7eae3af9c)
set(WINTOOLS_URL https://github.com/neovim/deps/raw/c1e7dd8de9e1b18d11dcfa0a192cd029262e5303/opt/win32tools.zip)
set(WINTOOLS_SHA256 3c4c490a3d392ceeb1347cb77cc821a31900b688a2189276d3a1131a3f21daf1)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.16.1/neovim-qt.zip)
set(WINGUI_SHA256 ddb4492db03da407703fb0ab271c4eb060250d1a7d71200e2b3b981cb0de59de)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
set(WIN32YANK_X86_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x86.zip)
set(WIN32YANK_X86_SHA256 62f34e5a46c5d4a7b3f3b512e1ff7b77fedd432f42581cbe825233a996eed62c)
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip)
set(WIN32YANK_X86_64_SHA256 33a747a92da60fb65e668edbf7661d3d902411a2d545fe9dc08623cecd142a20)
set(WINPTY_URL https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip)
set(WINPTY_SHA256 35a48ece2ff4acdcbc8299d4920de53eb86b1fb41e64d2fe5ae7898931bcee89)
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
set(LIBICONV_URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178)
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/5aa0bbb.tar.gz)
set(TREESITTER_C_SHA256 a5dcb37460d83002dfae7f9a208170ddbc9a047f231b9d6b75da7d36d707db2f)
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz)
set(TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2 )
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.0.tar.gz)
set(TREESITTER_SHA256 4a8070b9de17c3b8096181fe8530320ab3e8cca685d8bee6a3e8d164b5fb47da)
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.13.tar.gz)
set(TREESITTER_LUA_SHA256 564594fe0ffd2f2fb3578a15019b723e1bc94ac82cb6a0103a6b3b9ddcc6f315)
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.1.0.tar.gz)
set(TREESITTER_HELP_SHA256 4c0ef80c6dc09acab362478950ec6be58a4ab1cbf2d95754b8fbb566e4c647a1)
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)
if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium)
@ -239,7 +243,7 @@ if(USE_BUNDLED_LUAJIT)
include(BuildLuajit)
endif()
if(USE_BUNDLED_LUA AND NOT CMAKE_CROSSCOMPILING)
if(USE_BUNDLED_LUA)
include(BuildLua)
endif()
@ -251,10 +255,6 @@ if(USE_BUNDLED_LUV)
include(BuildLuv)
endif()
if(USE_BUNDLED_GPERF)
include(BuildGperf)
endif()
if(USE_BUNDLED_GETTEXT)
include(BuildGettext)
endif()
@ -290,18 +290,6 @@ if(WIN32)
elseif(TARGET_ARCH STREQUAL "X86")
set(TARGET_ARCH ia32)
endif()
GetBinaryDep(TARGET winpty
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/winpty/${TARGET_ARCH}/bin/*
-DTO=${DEPS_INSTALL_DIR}/bin/
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/winpty/include/*
-DTO=${DEPS_INSTALL_DIR}/include/
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/winpty/${TARGET_ARCH}/lib/*
-DTO=${DEPS_INSTALL_DIR}/lib/
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake)
endif()
# clean-shared-libraries removes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll,
@ -318,6 +306,7 @@ else()
set(ALL_DEPS clean-shared-libraries)
endif()
# TODO(justinmk): does anyone use this target?
add_custom_target(third-party ALL
COMMAND ${CMAKE_COMMAND} -E touch .third-party
DEPENDS ${ALL_DEPS}

View File

@ -1,5 +1,4 @@
if(MSVC)
ExternalProject_Add(gettext
PREFIX ${DEPS_BUILD_DIR}
URL ${GETTEXT_URL}
@ -19,13 +18,13 @@ if(MSVC)
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
${BUILD_TYPE_STRING}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DLIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-DLIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE})
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()

View File

@ -1,5 +1,4 @@
if(MSVC)
ExternalProject_Add(libiconv
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBICONV_URL}
@ -19,11 +18,11 @@ if(MSVC)
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
${BUILD_TYPE_STRING}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE})
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()

View File

@ -0,0 +1,43 @@
if(WIN32)
set(LIBTERMKEY_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/libtermkeyCMakeLists.txt
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libtermkey
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
${BUILD_TYPE_STRING}
# Hack to avoid -rdynamic in Mingw
-DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS=""
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DUNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-DUNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LIBTERMKEY_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(LIBTERMKEY_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
find_package(PkgConfig REQUIRED)
set(LIBTERMKEY_BUILD_COMMAND "" BUILD_IN_SOURCE 1)
set(LIBTERMKEY_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR} PKG_CONFIG_PATH=${DEPS_LIB_DIR}/pkgconfig
CFLAGS=-fPIC LDFLAGS+=-static ${DEFAULT_MAKE_CFLAGS} install)
endif()
ExternalProject_Add(libtermkey
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBTERMKEY_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libtermkey
-DURL=${LIBTERMKEY_URL}
-DEXPECTED_SHA256=${LIBTERMKEY_SHA256}
-DTARGET=libtermkey
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${LIBTERMKEY_CONFIGURE_COMMAND}"
BUILD_COMMAND "${LIBTERMKEY_BUILD_COMMAND}"
INSTALL_COMMAND "${LIBTERMKEY_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS libtermkey)

View File

@ -0,0 +1,26 @@
ExternalProject_Add(libuv
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBUV_URL}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_TESTING=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DLIBUV_BUILD_SHARED=OFF
CMAKE_CACHE_ARGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv
-DURL=${LIBUV_URL}
-DEXPECTED_SHA256=${LIBUV_SHA256}
-DTARGET=libuv
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
PATCH_COMMAND
${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv init
COMMAND ${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv apply --ignore-whitespace
${CMAKE_CURRENT_SOURCE_DIR}/patches/libuv-disable-shared.patch)
list(APPEND THIRD_PARTY_DEPS libuv)

View File

@ -0,0 +1,46 @@
if(WIN32)
set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Libvterm-tbl2inc_c.cmake
${DEPS_BUILD_DIR}/src/libvterm/tbl2inc_c.cmake
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libvterm
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
if(MSVC)
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}")
else()
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC")
endif()
set(LIBVTERM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(LIBVTERM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
LDFLAGS+=-static
${DEFAULT_MAKE_CFLAGS}
install)
endif()
ExternalProject_Add(libvterm
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBVTERM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
-DURL=${LIBVTERM_URL}
-DEXPECTED_SHA256=${LIBVTERM_SHA256}
-DTARGET=libvterm
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${LIBVTERM_CONFIGURE_COMMAND}"
BUILD_COMMAND "${LIBVTERM_BUILD_COMMAND}"
INSTALL_COMMAND "${LIBVTERM_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS libvterm)

View File

@ -1,38 +1,3 @@
include(CMakeParseArguments)
# BuildLua(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build lua, wraps ExternalProject_Add.
# Failing to pass a command argument will result in no command being run
function(BuildLua)
cmake_parse_arguments(_lua
""
""
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND"
${ARGN})
if(NOT _lua_CONFIGURE_COMMAND AND NOT _lua_BUILD_COMMAND
AND NOT _lua_INSTALL_COMMAND)
message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND")
endif()
ExternalProject_Add(lua
PREFIX ${DEPS_BUILD_DIR}
URL ${LUA_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua
-DURL=${LUA_URL}
-DEXPECTED_SHA256=${LUA_SHA256}
-DTARGET=lua
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${_lua_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1
BUILD_COMMAND "${_lua_BUILD_COMMAND}"
INSTALL_COMMAND "${_lua_INSTALL_COMMAND}")
endfunction()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LUA_TARGET linux)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -74,16 +39,26 @@ set(LUA_CONFIGURE_COMMAND
-e "s@\\(#define LUA_ROOT[ ]*\"\\)/usr/local@\\1${DEPS_INSTALL_DIR}@"
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
set(LUA_BUILD_COMMAND
${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET})
set(LUA_INSTALL_COMMAND
${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install)
message(STATUS "Lua target is ${LUA_TARGET}")
BuildLua(CONFIGURE_COMMAND ${LUA_CONFIGURE_COMMAND}
BUILD_COMMAND ${LUA_BUILD_COMMAND}
INSTALL_COMMAND ${LUA_INSTALL_COMMAND})
ExternalProject_Add(lua
PREFIX ${DEPS_BUILD_DIR}
URL ${LUA_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua
-DURL=${LUA_URL}
-DEXPECTED_SHA256=${LUA_SHA256}
-DTARGET=lua
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install)
list(APPEND THIRD_PARTY_DEPS lua)
set(BUSTED ${DEPS_INSTALL_DIR}/bin/busted)

View File

@ -1,5 +1,3 @@
include(CMakeParseArguments)
# BuildLuajit(TARGET targetname CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build luajit, wraps ExternalProject_Add.
# Failing to pass a command argument will result in no command being run
@ -7,7 +5,7 @@ function(BuildLuajit)
cmake_parse_arguments(_luajit
""
"TARGET"
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND"
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
${ARGN})
if(NOT _luajit_CONFIGURE_COMMAND AND NOT _luajit_BUILD_COMMAND
AND NOT _luajit_INSTALL_COMMAND)
@ -32,13 +30,14 @@ function(BuildLuajit)
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
BUILD_IN_SOURCE 1
BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}")
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
DEPENDS "${_luajit_DEPENDS}")
# Create symlink for development version manually.
if(UNIX)
add_custom_command(
TARGET ${_luajit_TARGET}
COMMAND ${CMAKE_COMMAND} -E create_symlink luajit-2.1.0-beta3 ${DEPS_BIN_DIR}/luajit)
COMMAND ${CMAKE_COMMAND} -E create_symlink luajit-2.1.0-beta3 ${DEPS_BIN_DIR}/${_luajit_TARGET})
endif()
endfunction()
@ -53,53 +52,57 @@ if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
else()
set(AMD64_ABI "")
endif()
set(INSTALLCMD_UNIX ${MAKE_PRG} CFLAGS=-fPIC
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-DLUA_USE_ASSERT
${NO_STACK_CHECK}
${AMD64_ABI}
CCDEBUG+=-g
Q=
install)
set(BUILDCMD_UNIX ${MAKE_PRG} CFLAGS=-fPIC
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-funwind-tables
${NO_STACK_CHECK}
${AMD64_ABI}
CCDEBUG+=-g
Q=)
if(UNIX)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_OSX_DEPLOYMENT_TARGET)
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
else()
# Use the same target as our nightly builds
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=10.11")
endif()
else()
set(DEPLOYMENT_TARGET "")
endif()
# Setting MACOSX_DEPLOYMENT_TARGET is mandatory for LuaJIT; use version set by
# cmake.deps/CMakeLists.txt (either environment variable or current system version).
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
BuildLuaJit(INSTALL_COMMAND ${INSTALLCMD_UNIX}
if((UNIX AND NOT APPLE) OR (APPLE AND NOT CMAKE_OSX_ARCHITECTURES))
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET})
${DEPLOYMENT_TARGET} install)
elseif(MINGW AND CMAKE_CROSSCOMPILING)
elseif(CMAKE_OSX_ARCHITECTURES AND APPLE)
# Build luajit for the host
BuildLuaJit(TARGET luajit_host
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${INSTALLCMD_UNIX}
CC=${HOST_C_COMPILER} PREFIX=${HOSTDEPS_INSTALL_DIR})
# Passing multiple `-arch` flags to the LuaJIT build will cause it to fail.
# To get a working universal build, we build each requested architecture slice
# individually then `lipo` them all up.
set(LUAJIT_SRC_DIR "${DEPS_BUILD_DIR}/src/luajit")
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
set(STATIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH}")
set(DYNAMIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH} -fPIC")
set(TARGET_LD "${LUAJIT_C_COMPILER} -arch ${ARCH}")
list(APPEND LUAJIT_THIN_EXECUTABLES "${LUAJIT_SRC_DIR}-${ARCH}/src/luajit")
list(APPEND LUAJIT_THIN_STATIC_LIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.a")
list(APPEND LUAJIT_THIN_DYLIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.so")
list(APPEND LUAJIT_THIN_TARGETS "luajit-${ARCH}")
# Build luajit for the target
# See https://luajit.org/install.html#cross.
BuildLuaJit(TARGET "luajit-${ARCH}"
BUILD_COMMAND ${BUILDCMD_UNIX}
CC=${LUAJIT_C_COMPILER} STATIC_CC=${STATIC_CC}
DYNAMIC_CC=${DYNAMIC_CC} TARGET_LD=${TARGET_LD}
PREFIX=${DEPS_INSTALL_DIR}
${DEPLOYMENT_TARGET})
endforeach()
BuildLuaJit(
# Similar to Unix + cross - fPIC
INSTALL_COMMAND
${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR}
BUILDMODE=static install
TARGET_SYS=${CMAKE_SYSTEM_NAME}
CROSS=${CROSS_TARGET}-
HOST_CC=${HOST_C_COMPILER} HOST_CFLAGS=${HOST_C_FLAGS}
HOST_LDFLAGS=${HOST_EXE_LINKER_FLAGS}
FILE_T=luajit.exe
Q=
INSTALL_TSYMNAME=luajit.exe)
CONFIGURE_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET}
COMMAND ${CMAKE_COMMAND} -E rm -f ${LUAJIT_SRC_DIR}/src/luajit ${LUAJIT_SRC_DIR}/src/libluajit.so ${LUAJIT_SRC_DIR}/src/libluajit.a
BUILD_COMMAND lipo ${LUAJIT_THIN_EXECUTABLES} -create -output ${LUAJIT_SRC_DIR}/src/luajit
COMMAND lipo ${LUAJIT_THIN_STATIC_LIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.a
COMMAND lipo ${LUAJIT_THIN_DYLIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.so
INSTALL_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET} install
DEPENDS ${LUAJIT_THIN_TARGETS}
)
elseif(MINGW)
@ -111,7 +114,7 @@ elseif(MINGW)
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS+=-DLUA_USE_APICHECK
CFLAGS+=-DLUA_USE_ASSERT
CFLAGS+=-funwind-tables
CCDEBUG+=-g
BUILDMODE=static
# Build a DLL too
@ -126,7 +129,9 @@ elseif(MINGW)
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_INSTALL_DIR}/lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
)
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin/lua/jit
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/bin/lua/jit
)
elseif(MSVC)
BuildLuaJit(
@ -140,8 +145,10 @@ elseif(MSVC)
# Luv searches for luajit.lib
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_INSTALL_DIR}/lib/luajit.lib
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake)
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin/lua/jit
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/bin/lua/jit
)
else()
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()

View File

@ -9,39 +9,6 @@
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
# BuildLuarocks(CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
# Reusable function to build luarocks, wraps ExternalProject_Add.
# Failing to pass a command argument will result in no command being run
function(BuildLuarocks)
cmake_parse_arguments(_luarocks
""
""
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND"
${ARGN})
if(NOT _luarocks_CONFIGURE_COMMAND AND NOT _luarocks_BUILD_COMMAND
AND NOT _luarocks_INSTALL_COMMAND)
message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND")
endif()
ExternalProject_Add(luarocks
PREFIX ${DEPS_BUILD_DIR}
URL ${LUAROCKS_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luarocks
-DURL=${LUAROCKS_URL}
-DEXPECTED_SHA256=${LUAROCKS_SHA256}
-DTARGET=luarocks
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${_luarocks_CONFIGURE_COMMAND}"
BUILD_COMMAND "${_luarocks_BUILD_COMMAND}"
INSTALL_COMMAND "${_luarocks_INSTALL_COMMAND}")
endfunction()
# The luarocks binary location
set(LUAROCKS_BINARY ${HOSTDEPS_BIN_DIR}/luarocks)
@ -56,7 +23,7 @@ endif()
# Defaults to 5.1 for bundled LuaJIT/Lua.
set(LUA_VERSION "5.1")
if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
if(UNIX)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUAROCKS_OPTS
@ -90,10 +57,9 @@ if(UNIX OR (MINGW AND CMAKE_CROSSCOMPILING))
endif()
endif()
BuildLuarocks(
CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS}
INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS})
set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
elseif(MSVC OR MINGW)
if(MINGW)
@ -103,7 +69,7 @@ elseif(MSVC OR MINGW)
endif()
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
BuildLuarocks(INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
/LUA ${DEPS_INSTALL_DIR}
/LIB ${DEPS_LIB_DIR}
/BIN ${DEPS_BIN_DIR}
@ -119,13 +85,27 @@ else()
message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
endif()
ExternalProject_Add(luarocks
PREFIX ${DEPS_BUILD_DIR}
URL ${LUAROCKS_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luarocks
-DURL=${LUAROCKS_URL}
-DEXPECTED_SHA256=${LUAROCKS_SHA256}
-DTARGET=luarocks
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
BUILD_COMMAND ""
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS luarocks)
if(USE_BUNDLED_LUAJIT)
add_dependencies(luarocks luajit)
if(MINGW AND CMAKE_CROSSCOMPILING)
add_dependencies(luarocks luajit_host)
endif()
elseif(USE_BUNDLED_LUA)
add_dependencies(luarocks lua)
endif()
@ -133,16 +113,14 @@ set(ROCKS_DIR ${HOSTDEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
# mpack
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
COMMAND ${LUAROCKS_BINARY}
ARGS build mpack 1.0.8-0 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build mpack 1.0.8-0 ${LUAROCKS_BUILDARGS}
DEPENDS luarocks)
add_custom_target(mpack DEPENDS ${ROCKS_DIR}/mpack)
list(APPEND THIRD_PARTY_DEPS mpack)
# lpeg
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
COMMAND ${LUAROCKS_BINARY}
ARGS build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
DEPENDS mpack)
add_custom_target(lpeg DEPENDS ${ROCKS_DIR}/lpeg)
list(APPEND THIRD_PARTY_DEPS lpeg)
@ -150,8 +128,7 @@ list(APPEND THIRD_PARTY_DEPS lpeg)
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
# luabitop
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
COMMAND ${LUAROCKS_BINARY}
ARGS build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
DEPENDS lpeg)
add_custom_target(luabitop DEPENDS ${ROCKS_DIR}/luabitop)
list(APPEND THIRD_PARTY_DEPS luabitop)
@ -166,8 +143,7 @@ if(USE_BUNDLED_BUSTED)
# penlight
add_custom_command(OUTPUT ${ROCKS_DIR}/penlight
COMMAND ${LUAROCKS_BINARY}
ARGS build penlight 1.5.4-1 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build penlight 1.5.4-1 ${LUAROCKS_BUILDARGS}
DEPENDS ${PENLIGHT_DEPENDS})
add_custom_target(penlight DEPENDS ${ROCKS_DIR}/penlight)
@ -180,48 +156,32 @@ if(USE_BUNDLED_BUSTED)
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck")
endif()
add_custom_command(OUTPUT ${BUSTED_EXE}
COMMAND ${LUAROCKS_BINARY}
ARGS build busted 2.0.0 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build busted 2.0.0 ${LUAROCKS_BUILDARGS}
DEPENDS penlight)
add_custom_target(busted DEPENDS ${BUSTED_EXE})
# luacheck
add_custom_command(OUTPUT ${LUACHECK_EXE}
COMMAND ${LUAROCKS_BINARY}
ARGS build luacheck 0.23.0-1 ${LUAROCKS_BUILDARGS}
COMMAND ${LUAROCKS_BINARY} build luacheck 0.23.0-1 ${LUAROCKS_BUILDARGS}
DEPENDS busted)
add_custom_target(luacheck DEPENDS ${LUACHECK_EXE})
# luv
set(LUV_DEPS luacheck)
if(USE_BUNDLED_LUV)
list(APPEND LUV_DEPS luv-static lua-compat-5.3)
if(MINGW AND CMAKE_CROSSCOMPILING)
list(APPEND LUV_DEPS libuv_host)
endif()
set(LUV_ARGS "CFLAGS=-O0 -g3 -fPIC")
if(USE_BUNDLED_LIBUV)
list(APPEND LUV_ARGS LIBUV_DIR=${HOSTDEPS_INSTALL_DIR})
endif()
SET(LUV_PRIVATE_ARGS LUA_COMPAT53_INCDIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3)
add_custom_command(OUTPUT ${ROCKS_DIR}/luv
COMMAND ${LUAROCKS_BINARY}
ARGS make ${LUAROCKS_BUILDARGS} ${LUV_ARGS} ${LUV_PRIVATE_ARGS}
WORKING_DIRECTORY ${DEPS_BUILD_DIR}/src/luv
DEPENDS ${LUV_DEPS})
set(NVIM_CLIENT_DEPS luacheck luv-static lua-compat-5.3)
else()
add_custom_command(OUTPUT ${ROCKS_DIR}/luv
COMMAND ${LUAROCKS_BINARY}
ARGS build luv ${LUV_VERSION} ${LUAROCKS_BUILDARGS}
DEPENDS ${LUV_DEPS})
COMMAND ${LUAROCKS_BINARY} build luv ${LUV_VERSION} ${LUAROCKS_BUILDARGS}
DEPENDS luacheck)
add_custom_target(luv DEPENDS ${ROCKS_DIR}/luv)
set(NVIM_CLIENT_DEPS luv)
endif()
add_custom_target(luv DEPENDS ${ROCKS_DIR}/luv)
# nvim-client: https://github.com/neovim/lua-client
add_custom_command(OUTPUT ${ROCKS_DIR}/nvim-client
COMMAND ${LUAROCKS_BINARY}
ARGS build nvim-client 0.2.2-1 ${LUAROCKS_BUILDARGS}
DEPENDS luv)
COMMAND ${LUAROCKS_BINARY} build nvim-client 0.2.4-1 ${LUAROCKS_BUILDARGS}
DEPENDS ${NVIM_CLIENT_DEPS})
add_custom_target(nvim-client DEPENDS ${ROCKS_DIR}/nvim-client)
list(APPEND THIRD_PARTY_DEPS busted luacheck nvim-client)

View File

@ -0,0 +1,103 @@
set(LUV_SRC_DIR ${DEPS_BUILD_DIR}/src/luv)
set(LUV_INCLUDE_FLAGS
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(LUV_CONFIGURE_COMMAND_COMMON
${CMAKE_COMMAND} ${LUV_SRC_DIR}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
${BUILD_TYPE_STRING}
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
-DLUA_BUILD_TYPE=System
-DLUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
-DWITH_SHARED_LIBUV=ON
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON
-DBUILD_MODULE=OFF)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
else()
find_package(LuaJit)
if(LUAJIT_FOUND)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
else()
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
endif()
endif()
if(USE_BUNDLED_LIBUV)
set(LUV_CONFIGURE_COMMAND_COMMON
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR}
-DLIBUV_LIBRARIES=uv_a)
endif()
if(MSVC)
set(LUV_CONFIGURE_COMMAND
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
# Same as Unix without fPIC
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS}"
# Make sure we use the same generator, otherwise we may
# accidentally end up using different MSVC runtimes
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
else()
set(LUV_CONFIGURE_COMMAND
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS} -fPIC")
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
set(LUV_CONFIGURE_COMMAND ${LUV_CONFIGURE_COMMAND} -DCMAKE_MAKE_PROGRAM=gmake)
endif()
endif()
ExternalProject_Add(lua-compat-5.3
PREFIX ${DEPS_BUILD_DIR}
URL ${LUA_COMPAT53_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
-DURL=${LUA_COMPAT53_URL}
-DEXPECTED_SHA256=${LUA_COMPAT53_SHA256}
-DTARGET=lua-compat-5.3
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
ExternalProject_Add(luv-static
PREFIX ${DEPS_BUILD_DIR}
DEPENDS lua-compat-5.3
URL ${LUV_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luv
-DURL=${LUV_URL}
-DEXPECTED_SHA256=${LUV_SHA256}
-DTARGET=luv-static
# The source is shared with BuildLuarocks (with USE_BUNDLED_LUV).
-DSRC_DIR=${DEPS_BUILD_DIR}/src/luv
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${LUV_CONFIGURE_COMMAND}"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
LIST_SEPARATOR |)
list(APPEND THIRD_PARTY_DEPS luv-static)
if(USE_BUNDLED_LUAJIT)
add_dependencies(luv-static luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(luv-static lua)
endif()
if(USE_BUNDLED_LIBUV)
add_dependencies(luv-static libuv)
endif()

View File

@ -0,0 +1,42 @@
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
-DMSGPACK_BUILD_TESTS=OFF
-DMSGPACK_BUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC"
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
if(MSVC)
# Same as Unix without fPIC
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
-DMSGPACK_BUILD_TESTS=OFF
-DMSGPACK_BUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}"
# Make sure we use the same generator, otherwise we may
# accidentally end up using different MSVC runtimes
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
endif()
ExternalProject_Add(msgpack
PREFIX ${DEPS_BUILD_DIR}
URL ${MSGPACK_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/msgpack
-DURL=${MSGPACK_URL}
-DEXPECTED_SHA256=${MSGPACK_SHA256}
-DTARGET=msgpack
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${MSGPACK_CONFIGURE_COMMAND}"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
LIST_SEPARATOR |)
list(APPEND THIRD_PARTY_DEPS msgpack)

View File

@ -0,0 +1,38 @@
if(MSVC)
set(TREESITTER_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
set(TREESITTER_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(TREESITTER_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(TS_CFLAGS "-O3 -Wall -Wextra")
set(TREESITTER_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} CFLAGS=${TS_CFLAGS})
set(TREESITTER_INSTALL_COMMAND
${MAKE_PRG} CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} install)
endif()
ExternalProject_Add(tree-sitter
PREFIX ${DEPS_BUILD_DIR}
URL ${TREESITTER_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/tree-sitter
INSTALL_DIR ${DEPS_INSTALL_DIR}
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/tree-sitter
-DURL=${TREESITTER_URL}
-DEXPECTED_SHA256=${TREESITTER_SHA256}
-DTARGET=tree-sitter
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${TREESITTER_CONFIGURE_COMMAND}"
BUILD_COMMAND "${TREESITTER_BUILD_COMMAND}"
INSTALL_COMMAND "${TREESITTER_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS tree-sitter)

View File

@ -0,0 +1,28 @@
function(BuildTSParser LANG TS_URL TS_SHA256 TS_CMAKE_FILE)
set(NAME treesitter-${LANG})
ExternalProject_Add(${NAME}
PREFIX ${DEPS_BUILD_DIR}
URL ${TREESITTER_C_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
CMAKE_CACHE_ARGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/${NAME}
-DURL=${TS_URL}
-DEXPECTED_SHA256=${TS_SHA256}
-DTARGET=${NAME}
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DPARSERLANG=${LANG})
endfunction()
BuildTSParser(c ${TREESITTER_C_URL} ${TREESITTER_C_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(lua ${TREESITTER_LUA_URL} ${TREESITTER_LUA_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(vim ${TREESITTER_VIM_URL} ${TREESITTER_VIM_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(help ${TREESITTER_HELP_URL} ${TREESITTER_HELP_SHA256} TreesitterParserCMakeLists.txt)

View File

@ -0,0 +1,37 @@
if(WIN32)
set(UNIBILIUM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/UnibiliumCMakeLists.txt
${DEPS_BUILD_DIR}/src/unibilium/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/unibilium
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
set(UNIBILIUM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(UNIBILIUM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(UNIBILIUM_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR} CFLAGS=-fPIC LDFLAGS+=-static
BUILD_IN_SOURCE 1)
set(UNIBILIUM_INSTALL_COMMAND ${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR} install)
endif()
ExternalProject_Add(unibilium
PREFIX ${DEPS_BUILD_DIR}
URL ${UNIBILIUM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/unibilium
-DURL=${UNIBILIUM_URL}
-DEXPECTED_SHA256=${UNIBILIUM_SHA256}
-DTARGET=unibilium
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${UNIBILIUM_CONFIGURE_COMMAND}"
BUILD_COMMAND "${UNIBILIUM_BUILD_COMMAND}"
INSTALL_COMMAND "${UNIBILIUM_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS unibilium)

View File

@ -59,41 +59,48 @@ string(REPLACE ";" "-" fname "${fname}")
set(file ${DOWNLOAD_DIR}/${fname})
message(STATUS "file: ${file}")
message(STATUS "downloading...
src='${URL}'
dst='${file}'
timeout='${timeout_msg}'")
set(EXISTING_SHA256 "")
if(EXISTS ${file})
file(SHA256 ${file} EXISTING_SHA256)
endif()
file(DOWNLOAD ${URL} ${file}
${timeout_args}
${hash_args}
STATUS status
LOG log)
list(GET status 0 status_code)
list(GET status 1 status_string)
if(NOT status_code EQUAL 0)
# Retry on certain errors, e.g. CURLE_COULDNT_RESOLVE_HOST, which is often
# seen with libtermkey (www.leonerd.org.uk).
if((status_code EQUAL 6) # "Couldn't resolve host name"
OR (status_code EQUAL 7)) # "Couldn't connect to server"
message(STATUS "warning: retrying '${URL}' (${status_string}, status ${status_code})")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
file(DOWNLOAD ${URL} ${file}
${timeout_args}
${hash_args}
STATUS status
LOG log)
list(GET status 0 status_code)
list(GET status 1 status_string)
endif()
if(NOT EXISTING_SHA256 STREQUAL ${EXPECTED_SHA256})
message(STATUS "downloading...
src='${URL}'
dst='${file}'
timeout='${timeout_msg}'")
file(DOWNLOAD ${URL} ${file}
${timeout_args}
${hash_args}
STATUS status
LOG log)
list(GET status 0 status_code)
list(GET status 1 status_string)
if(NOT status_code EQUAL 0)
message(FATAL_ERROR "error: downloading '${URL}' failed
status_code: ${status_code}
status_string: ${status_string}
log: ${log}
")
# Retry on certain errors, e.g. CURLE_COULDNT_RESOLVE_HOST, which is often
# seen with libtermkey (www.leonerd.org.uk).
if((status_code EQUAL 6) # "Couldn't resolve host name"
OR (status_code EQUAL 7)) # "Couldn't connect to server"
message(STATUS "warning: retrying '${URL}' (${status_string}, status ${status_code})")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
file(DOWNLOAD ${URL} ${file}
${timeout_args}
${hash_args}
STATUS status
LOG log)
list(GET status 0 status_code)
list(GET status 1 status_string)
endif()
if(NOT status_code EQUAL 0)
message(FATAL_ERROR "error: downloading '${URL}' failed
status_code: ${status_code}
status_string: ${status_string}
log: ${log}
")
endif()
endif()
endif()

View File

@ -1,6 +1,3 @@
# Download and install binary dependencies for windows
include(CMakeParseArguments)
# This is similar to the build recipes, but instead downloads a third party
# binary and installs it under the DEPS_PREFIX.
# The INSTALL_COMMAND is executed in the folder where downloaded files are

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(gettext C)
# Adds PREFIX to each item in LIST

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libiconv C)
include_directories(

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
set(HEX_ALPHABET "0123456789abcdef")

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libvterm LANGUAGES C)
include(GNUInstallDirs)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(tree-sitter LANGUAGES C)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/lib/src/*.c)

View File

@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 2.8.12)
# some parsers have c++ scanner, problem?
project(parser C) # CXX
cmake_minimum_required(VERSION 3.10)
project(parser C)
set(CMAKE_C_STANDARD 99)
file(GLOB source_files src/*.c)
add_library(parser
MODULE
src/parser.c
${source_files}
)
set_target_properties(
parser

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(unibilium LANGUAGES C)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/*.c)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
project(libtermkey)
add_definitions(-D _CRT_SECURE_NO_WARNINGS)

View File

@ -0,0 +1,117 @@
From 326a1845f924432332071d03d156b7df4af7c46f Mon Sep 17 00:00:00 2001
From: Tim Tavlintsev <ttavlintsev@enttec.com>
Date: Thu, 21 Jul 2022 16:42:21 +1000
Subject: [PATCH] Add CMake option LIBUV_BUILD_SHARED to enable/disable shared
library build Fix #3637
---
CMakeLists.txt | 66 +++++++++++++++++++++++++++++---------------------
1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c42c3ff..a8e19980 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,8 @@ cmake_dependent_option(LIBUV_BUILD_BENCH
"Build the benchmarks when building unit tests and we are the root project" ON
"LIBUV_BUILD_TESTS" OFF)
+option(LIBUV_BUILD_SHARED "Build shared lib" ON)
+
# Qemu Build
option(QEMU "build for qemu" OFF)
if(QEMU)
@@ -390,25 +392,27 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
list(APPEND uv_test_libraries util)
endif()
-add_library(uv SHARED ${uv_sources})
-target_compile_definitions(uv
- INTERFACE
- USING_UV_SHARED=1
- PRIVATE
- BUILDING_UV_SHARED=1
- ${uv_defines})
-target_compile_options(uv PRIVATE ${uv_cflags})
-target_include_directories(uv
- PUBLIC
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
- PRIVATE
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
-if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
- target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
- set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
+if(LIBUV_BUILD_SHARED)
+ add_library(uv SHARED ${uv_sources})
+ target_compile_definitions(uv
+ INTERFACE
+ USING_UV_SHARED=1
+ PRIVATE
+ BUILDING_UV_SHARED=1
+ ${uv_defines})
+ target_compile_options(uv PRIVATE ${uv_cflags})
+ target_include_directories(uv
+ PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ PRIVATE
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
+ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
+ target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
+ set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
+ endif()
+ target_link_libraries(uv ${uv_libraries})
endif()
-target_link_libraries(uv ${uv_libraries})
add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
@@ -669,28 +673,34 @@ string(REPLACE ";" " " LIBS "${LIBS}")
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
-# The version in the filename is mirroring the behaviour of autotools.
-set_target_properties(uv PROPERTIES
- VERSION ${UV_VERSION_MAJOR}.0.0
- SOVERSION ${UV_VERSION_MAJOR})
+
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
-configure_file(libuv.pc.in libuv.pc @ONLY)
configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
-install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
+install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(TARGETS uv EXPORT libuvConfig
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS uv_a EXPORT libuvConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)
+if(LIBUV_BUILD_SHARED)
+ # The version in the filename is mirroring the behaviour of autotools.
+ set_target_properties(uv PROPERTIES
+ VERSION ${UV_VERSION_MAJOR}.0.0
+ SOVERSION ${UV_VERSION_MAJOR})
+ configure_file(libuv.pc.in libuv.pc @ONLY)
+ install(FILES ${PROJECT_BINARY_DIR}/libuv.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(TARGETS uv EXPORT libuvConfig
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+
if(MSVC)
set(CMAKE_DEBUG_POSTFIX d)
endif()
--
2.37.0

View File

@ -0,0 +1,64 @@
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_FILE_NAME "nvim")
# From the GitHub About section
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
# Pull the versions defined with the top level CMakeLists.txt
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
# are correctly passed to the cpack program.
# This should always be set to true.
set(CPACK_VERBATIM_VARIABLES TRUE)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
if(WIN32)
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
set(CPACK_GENERATOR ZIP WIX)
# WIX
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
# The following guid is just a randomly generated guid that's been pasted here.
# It has no special meaning other than to supply it to WIX.
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.ico)
# We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
# on installation, however, it can be extended.
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
elseif(APPLE)
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
set(CPACK_GENERATOR TGZ DEB)
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
# Automatically compute required shared lib dependencies.
# Unfortunately, you "just need to know" that this has a hidden
# dependency on dpkg-shlibdeps whilst using a debian based host.
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
else()
set(CPACK_GENERATOR TGZ)
endif()
# CPack variables are loaded in on the call to include(CPack). If you set
# variables *after* the inclusion, they don't get updated within the CPack
# config. Note that some CPack commands should still be run after it, such
# as cpack_add_component().
include(CPack)

View File

@ -0,0 +1,14 @@
<CPackWiXPatch>
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
<Environment
Id='UpdatePath'
Name='PATH'
Action='set'
Permanent='no'
System='yes'
Part='last'
Value='[INSTALL_ROOT]bin'
/>
</CPackWiXFragment>
</CPackWiXPatch>

BIN
cmake.packaging/neovim.icns Normal file

Binary file not shown.

BIN
cmake.packaging/neovim.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
cmake.packaging/neovim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

147
cmake.packaging/neovim.svg Normal file
View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256"
height="256"
viewBox="0 0 256 256"
version="1.1"
id="svg4612"
sodipodi:docname="neovim.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata4616">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>neovim-mark@2x</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1333"
id="namedview4614"
showgrid="false"
inkscape:zoom="2.1945358"
inkscape:cx="132.84232"
inkscape:cy="196.34741"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:current-layer="svg4612" />
<title
id="title4587">neovim-mark@2x</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<defs
id="defs4604">
<linearGradient
x1="167.95833"
y1="-0.46142399"
x2="167.95833"
y2="335.45523"
id="linearGradient-1"
gradientTransform="scale(0.46142398,2.1672042)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#16B0ED"
stop-opacity="0.800235524"
offset="0%"
id="stop4589" />
<stop
stop-color="#0F59B2"
stop-opacity="0.83700023"
offset="100%"
id="stop4591" />
</linearGradient>
<linearGradient
x1="1118.3427"
y1="-0.46586797"
x2="1118.3427"
y2="338.68604"
id="linearGradient-2"
gradientTransform="scale(0.46586797,2.1465309)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#7DB643"
offset="0%"
id="stop4594" />
<stop
stop-color="#367533"
offset="100%"
id="stop4596" />
</linearGradient>
<linearGradient
x1="356.33795"
y1="0"
x2="356.33795"
y2="612.90131"
id="linearGradient-3"
gradientTransform="scale(0.84189739,1.1877932)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#88C649"
stop-opacity="0.8"
offset="0%"
id="stop4599" />
<stop
stop-color="#439240"
stop-opacity="0.84"
offset="100%"
id="stop4601" />
</linearGradient>
</defs>
<g
id="Page-1"
sketch:type="MSPage"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
<g
id="mark-copy"
sketch:type="MSLayerGroup"
transform="translate(2,3)">
<path
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
id="Left---green"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-1)" />
<path
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
id="Right---blue"
sketch:type="MSShapeGroup"
transform="matrix(-1,0,0,1,1042,0)"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-2)" />
<path
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
id="Cross---blue"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-3)" />
<path
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
id="Shadow"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:0.12999998" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,13 @@
if(UNCRUSTIFY_PRG)
execute_process(COMMAND uncrustify --version
OUTPUT_VARIABLE user_version
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
if(NOT user_version STREQUAL required_version)
message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
endif()
endif()

View File

@ -41,6 +41,16 @@ endif()
if (MSVC)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif()
# On macOS, if libintl is a static library then we also need
# to link libiconv and CoreFoundation.
get_filename_component(LibIntl_EXT "${LibIntl_LIBRARY}" EXT)
if (APPLE AND (LibIntl_EXT STREQUAL ".a"))
set(LibIntl_STATIC TRUE)
find_library(CoreFoundation_FRAMEWORK CoreFoundation)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
endif()
check_c_source_compiles("
#include <libintl.h>
@ -54,6 +64,9 @@ int main(int argc, char** argv) {
if (MSVC)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif()
if (LibIntl_STATIC)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
endif()
if (LibIntl_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif()

View File

@ -15,7 +15,7 @@ find_path(LIBLUV_INCLUDE_DIR luv/luv.h
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
# Explicitly look for luv.so. #10407
list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX})
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})

Some files were not shown because too many files have changed in this diff Show More