aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* feat(colorscheme): add semantic tokens modifiers to builtin color schemeEvgeni Chasnovski2024-03-21
|
* vim-patch:9.1.0190: complete_info() returns wrong order of items (#27955)zeertzjq2024-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: complete_info() returns wrong order of items (after v9.0.2018) Solution: Revert Patch v9.0.2018 (Girish Palya) bug fix: complete_info() gives wrong results 1) complete_info() reverses list of items during <c-p> 2) 'selected' item index is wrong during <c-p> 3) number of items returnd can be wrong Solution: - Decouple 'cp_number' from 'selected' index since they need not be correlated - Do not iterate the list backwards - Add targeted tests Regression introduced by https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2 Following are unnecessary commits to patch problems from above: https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c All the tests from above commits are retained though. fixes: vim/vim#14204 closes: vim/vim#14241 https://github.com/vim/vim/commit/8950bf7f8b85c1287d4e696965d88091fcc60594 Remove EMPTY_IF_NULL() as it has been unnecessary since #12673. Co-authored-by: Girish Palya <girishji@gmail.com>
* fix(cmdline): wrong 'incsearch' highlighting after :redraw (#27947)luukvbaal2024-03-20
| | | | Problem: Calling :redraw from a timer callback clears 'incsearch' highlighting. Solution: Re-apply 'incsearch' highlighting if the screen was updated.
* Merge #27930 nvim_create_buf fixesJustin M. Keyes2024-03-20
|\
| * fix(api): nvim_create_buf assert fails if autocmds set &swapfileSean Dewar2024-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: assertion failure in nvim_create_buf if buflist_new autocommands open a swapfile when "scratch" is set. Solution: block autocommands when setting up the buffer; fire them later instead. Note that, unlike buflist_new, I don't check if autocommands aborted script processing; the buffer is already created and configured at that point, so might as well return the handle anyway. Rather than repeat try_{start,end} and {un}block_autocmds for each relevant operation, just do it at the start and near the end. This means that, if TermResponse fires from unblock_autocmds for whatever reason, it can see the buffer in an already configured state if we didn't bail due to an error (plus it's probably a bit cleaner this way).
| * fix(api): nvim_create_buf leaks memory if buffer is loaded earlySean Dewar2024-03-19
| | | | | | | | | | | | | | Problem: memory leak in nvim_create_buf if buflist_new autocommands load the new buffer early. Solution: do not open a memfile in that case.
* | refactor(treesitter): handle coverity warnings betterLewis Russell2024-03-20
| |
* | fix(treesitter): treecursor regressionLewis Russell2024-03-20
| | | | | | | | | | | | - Also address some coverity warnings Fixes #27942
* | refactor(treesitter): reorder functionsLewis Russell2024-03-19
| |
* | refactor(treesitter): simplify argument checks for userdataLewis Russell2024-03-19
|/
* refactor(treesitter): redesign query iteratingLewis Russell2024-03-19
| | | | | | | | | | | | | | | | Problem: `TSNode:_rawquery()` is complicated, has known issues and the Lua and C code is awkwardly coupled (see logic with `active`). Solution: - Add `TSQueryCursor` and `TSQueryMatch` bindings. - Replace `TSNode:_rawquery()` with `TSQueryCursor:next_capture()` and `TSQueryCursor:next_match()` - Do more stuff in Lua - API for `Query:iter_captures()` and `Query:iter_matches()` remains the same. - `treesitter.c` no longer contains any logic related to predicates. - Add `match_limit` option to `iter_matches()`. Default is still 256.
* fix(terminal): don't pass incomplete UTF-8 sequence to libvterm (#27922)zeertzjq2024-03-19
|
* fix(treesitter): document more standard highlight groupsChristian Clason2024-03-19
| | | | | | | | | Problem: Not all standard treesitter groups are documented. Solution: Document them all (without relying on fallback); add default link for new `*.builtin` groups to `Special` and `@keyword.type` to `Structure`. Remove `@markup.environment.*` which only made sense for LaTeX.
* fix(pager): handle consecutive newlines properly (#27913)zeertzjq2024-03-18
|
* refactor(messages): remove condition that is always true (#27909)zeertzjq2024-03-18
| | | | | | After #25470 the `s` pointer is advanced before calling store_sb_text() when a newline character is found, and store_sb_text() sets `sb_str` to `s`, so it's not possible for `s == sb_str + 1` and `*sb_str == '\n'` to be satisfied at the same time.
* vim-patch:9.1.0186: cursor pos wrong on mouse click after eol with 'rl', ↵zeertzjq2024-03-18
| | | | | | | | | | | | 've' and conceal (#27903) Problem: Wrong cursor position when clicking after end of line with 'rightleft', 'virtualedit' and conceal. Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT. Also fix off-by-one cursor position with 'colorcolumn' (zeertzjq). closes: vim/vim#14218 https://github.com/vim/vim/commit/deb2204bffa075ed5485415fc2dbd20e75d87ea4
* fix(messages): allow more prompt in headless mode with UI (#27905)zeertzjq2024-03-18
| | | | | Problem: More prompt is not shown in headless mode even if there is a UI attached. Solution: Don't skip more prompt when there is a UI active.
* fix(mouse): click after eol with conceal and virtual text (#27897)zeertzjq2024-03-17
| | | | | Problem: Wrong cursor position when clicking after end of line with 'virtualedit', conceal and virtual text. Solution: Always fill linebuf_vcol[] for the columns to clear.
* refactor(drawline): integrate terminal hl with eol loop (#27893)zeertzjq2024-03-17
| | | | | | | There is no test for using 'cursorline' in Normal mode in a terminal buffer, so add a test and fix 'cursorcolumn' remaining when entering Terminal mode. Also move synIDattr() tests to ui/highlight_spec.lua.
* fix(normal): don't check conceal when pressing 'r' (#27892)zeertzjq2024-03-17
| | | | | | | | Problem: Cursor line is unconcealed when pressing 'r' in Normal mode when 'concealcursor' contains 'n' but not 'i'. Solution: Don't check conceal when pressing 'r' in Normal mode. Vim doesn't have this problem because it doesn't call redrawWinline() in conceal_check_cursor_line() and instead sets a global variable.
* vim-patch:9.1.0184: Cursor pos wrong when clicking with conceal and wrap ↵zeertzjq2024-03-17
| | | | | | | | | | | | | | | | (#27890) Problem: Cursor position wrong when clicking with conceal and wrap. Solution: Use the virtual column of the last char for ScreenCols[] in boguscols. Remove use of MAXCOL in ScreenCols[]. Rename third argument of wlv_screen_line() to "clear_end" as that's clearer what it does (zeertzjq). related: 14192 closes: vim/vim#14200 https://github.com/vim/vim/commit/d0c1b7723f7e73763597af2f97a53d94ab7ed020 Rename win_put_linebuf() to wlv_put_linebuf().
* fix(drawline): check filler_todo in place of removed draw_state (#27889)zeertzjq2024-03-17
| | | | The only place it matters is the conceal wcol check, but it can avoid unnecessary computations at other places.
* fix(lsp): add missing LSP semantic token highlight linksCaleb Marshall2024-03-16
| | | | | | | | | | | | | Added the following LSP semantic token types to be linked to highlight groups by default: * @lsp.type.event * @lsp.type.keyword * @lsp.type.modifier * @lsp.type.number * @lsp.type.operator * @lsp.type.regexp * @lsp.type.string
* vim-patch:9.1.0182: Can define function with invalid name inside ↵zeertzjq2024-03-16
| | | | | | | | | | | 'formatexpr' (#27883) Problem: Can define function with invalid name inside 'formatexpr'. Solution: Use goto instead of checking for did_emsg later. (zeertzjq) closes: vim/vim#14209 https://github.com/vim/vim/commit/6a04bf5ee523b2d6d01d7290e356a30de219f465
* vim-patch:9.1.0183: Wrong display or screenpos() result when toggling diff ↵zeertzjq2024-03-16
| | | | | | | | | | | | mode (#27882) Problem: Wrong display or screenpos() result when toggling diff mode. Solution: Reset w_skipcol when disabling 'wrap'. Reset w_leftcol when enabling 'wrap' (zeertzjq). fixes: vim/vim#14210 closes: vim/vim#14211 https://github.com/vim/vim/commit/9e7f1fc2f159d58b2a4cd4b7060bead126fead49
* vim-patch:8.2.3782: Vim9: no error if a function shadows a script variable ↵zeertzjq2024-03-16
| | | | | | | | | | | | (#27881) Problem: Vim9: no error if a function shadows a script variable. Solution: Check the function doesn't shadow a variable. (closes vim/vim#9310) https://github.com/vim/vim/commit/052ff291d72bc9c176f9562f021d7e8e030e74c0 Omit EVAL_VAR_NO_FUNC: Vim9 script only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge pull request #27877 from bfredl/pseudorandombfredl2024-03-16
|\ | | | | fix(intro): redrawing intro exposing pseudo-randomness
| * fix(intro): redrawing intro exposing pseudo-randomnessbfredl2024-03-16
| | | | | | | | | | problem: redrawing intro exposes pseudo-randomness solution: remove pseudo-randomness
* | Merge pull request #27871 from bfredl/ui_flush_fixbfredl2024-03-16
|\ \ | | | | | | fix(ui): edge case around flushing in grid_line
| * | fix(ui): fix edge case around flushingbfredl2024-03-15
| | | | | | | | | | | | | | | ui_flush_buf() doesn't know about `lenpos` so `remote_ui_raw_line` needs to always handle it before flushing
* | | fix(l10n): update Japanese translations (#27856)ite-usagi2024-03-16
| |/ |/|
* | Merge pull request #27867 from bfredl/intro_multigridbfredl2024-03-15
|\ \ | |/ |/| fix(ui): startup intro message should be visible with ext_multigrid
| * fix(ui): startup intro message should be visible with ext_multigridbfredl2024-03-15
| | | | | | | | | | | | | | | | As this message is literally drawn on top of the EOB area of the first window, the simple solution is to just draw the message on top of the grid of the first window. We still want #24764 (msg_intro event) but now only for ext_messages.
* | Merge pull request #27858 from luukvbaal/nvim_set_cursorbfredl2024-03-15
|\ \ | |/ |/| fix(ui): issues controlling cursor position with ext_cmdline
| * fix(ui): ext_cmdline should not move cursor to curwinLuuk van Baal2024-03-15
| | | | | | | | | | | | | | | | | | | | | | Problem: The ext_cmdline cursor position on the screen seems to rely on an implicit assumption that the event listener implements a cmdline window that is made the current window which is problematic (e.g. breaks 'incsearch' in the actual current window). Solution: Remove this assumption and allow nvim_win_set_cursor() to move the cursor on the screen to a non-current window (previous commit).
| * fix(api): update grid cursor in nvim_win_set_cursor()Luuk van Baal2024-03-15
| | | | | | | | | | | | Problem: Cursor position set by nvim_win_set_cursor() is not reflected on the screen when followed by a blocking call like getchar(). Solution: Immediately update the cursor position on the grid.
* | refactor: remove unused "coloff" argument of win_put_linebuf() (#27866)zeertzjq2024-03-15
| | | | | | | | It isn't really used, and is always passed 0. Also rename "start_col" to "startcol" for consistency with "endcol".
* | vim-patch:9.1.0181: no overflow check for string formatting (#27863)zeertzjq2024-03-15
| | | | | | | | | | | | | | | | | | | | | | Problem: no overflow check for string formatting Solution: Check message formatting function for overflow. (Chris van Willegen) closes: vim/vim#13799 https://github.com/vim/vim/commit/c35fc03dbd47582b256776fb11f11d8ceb24f8f0 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
* | vim-patch:9.1.0180: Cursor pos wrong when double-width chars are concealed ↵zeertzjq2024-03-15
|/ | | | | | | | | | | (#27862) Problem: Cursor pos wrong when double-width chars are concealed. Solution: Advance one more virtual column for a double-width char. Run some tests with both 'wrap' and 'nowrap' (zeertzjq). closes: vim/vim#14197 https://github.com/vim/vim/commit/010e1539d67442cc69a97bef6453efaf849d0db3
* fix(highlight): don't show CursorColumn on current line (#27848)zeertzjq2024-03-15
| | | | | | | | | | | | Problem: CursorColumn highlight behavior is inconsistent with 'virtualedit' set: - If cursor is on the text, CursorColumn is not shown. - If cursor is after end of line, CursorColumn is shown. Solution: Don't shown CursorColumn on current line if cursor is after end of line. Vim doesn't have this problem because in most cases it uses the code path for drawing buffer text when CursorColumn highlight is needed.
* Merge pull request #27852 from bfredl/persistent_introbfredl2024-03-14
|\ | | | | fix(intro): make intro explicitly stateful
| * fix(intro): make intro explicitly statefulbfredl2024-03-14
| | | | | | | | | | | | | | | | | | | | | | Instead of randomly disappearing because some random event might have caused mid_start or bot_scroll_start to randomly take a low value, treat intro message as a _first class stateful_ thing. This means that intro message will kept being _redrawn_ as long as we are in the state it should be shown. This also includes screen resizes. you will not lose the intro message because there was a delay in detecting terminal features.
* | refactor(drawline): rename vcol_off to vcol_off_co (#27857)zeertzjq2024-03-14
| | | | | | | | | | It is clearing that it's for conceal and matches the change from Vim patch 9.0.1325. Also correct some comments related to fix_for_boguscols().
* | Merge pull request #27854 from bfredl/boogalo_linesbfredl2024-03-14
|\ \ | | | | | | fix(api): fix set_lines viewport adjustment, but this time good
| * | fix(api): fix set_lines viewport adjustment, but this time goodbfredl2024-03-14
| |/ | | | | | | fixes #27720
* / fix(terminal): disable reflow againChristian Clason2024-03-14
|/ | | | | | | reverts https://github.com/neovim/neovim/commit/c855eee919f2d4edc9b9fa91b277454290fbabfe This setting introduces constant CI failures on macos (see https://github.com/neovim/neovim/issues/23762).
* vim-patch:9.1.0177: Coverity reports dead codezeertzjq2024-03-14
| | | | | | | | | | Problem: Coverity reports dead code. Solution: Remove the dead code. Also fix a mistake in ml_get_pos_len() and update some comments (zeertzjq). closes: vim/vim#14189 https://github.com/vim/vim/commit/8c55d60658b7ee3458dca57fc5eec90ca9bb9bf3
* vim-patch:9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()zeertzjq2024-03-14
| | | | | | | | | | | | Problem: More code can use ml_get_buf_len() instead of STRLEN(). Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not set ml_line_textlen in ml_replace_len() if "has_props" is set, because "len_arg" also includes the size of text properties in that case. (zeertzjq) closes: vim/vim#14183 https://github.com/vim/vim/commit/94b7c3233ef534acc669b3083ed1fe59cf3a090b
* vim-patch:8.2.4950: text properties position wrong after shifting text (#27849)zeertzjq2024-03-14
| | | | | | | | | | | Problem: Text properties position wrong after shifting text. Solution: Adjust the text properties when shifting a block of text. (closes vim/vim#10418) https://github.com/vim/vim/commit/4b93674159d60c985de906c30f45dbaf2b64056f Most of the patch is already merged. Add an assertion in place of "added". Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:9.1.0176: Cursor column wrong with 'virtualedit' and concealzeertzjq2024-03-14
| | | | | | | | | | Problem: Cursor column wrong with 'virtualedit' and conceal. Solution: Correct cursor column at end of line if never reached. (zeertzjq) closes: vim/vim#14190 https://github.com/vim/vim/commit/253ff4dece4e6cc4a9ff3ed935bc78f832b6fb7c