aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* docs: small fixesdundargoc2023-10-10
| | | | | | Co-authored-by: Wansmer <wansmer@gmail.com> Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com> Co-authored-by: David Moberg <david.moberg@mediatek.com>
* Merge pull request #25561 from glepnir/9663bfredl2023-10-10
|\ | | | | feat(float): add fclose command
| * feat(float): add fclose commandglepnir2023-10-10
| |
* | fix(highlight): add `FloatFooter` to 'highlight_defs.h' (#25577)Evgeni Chasnovski2023-10-10
| |
* | vim-patch:9.0.2009: cmdline-completion for comma-separated options wrong ↵zeertzjq2023-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25569) Problem: cmdline-completion for comma-separated options wrong Solution: Fix command-line expansions for options with filenames with commas Fix command-line expansions for options with filenames with commas Cmdline expansion for option values that take a comma-separated list of file names is currently not handling file names with commas as the commas are not escaped. For such options, the commas in file names need to be escaped (to differentiate from a comma that delimit the list items). The escaped comma is unescaped in `copy_option_part()` during option parsing. Fix as follows: - Cmdline completion for option values with comma-separated file/folder names will not start a new match when seeing `\\,` and will instead consider it as one value. - File/folder regex matching will strip the `\\` when seeing `\\,` to make sure it can match the correct files/folders. - The expanded value will escape `,` with `\\,`, similar to how spaces are escaped to make sure the option value is correct on the cmdline. This fix also takes into account the fact that Win32 Vim handles file name escaping differently. Typing '\,' for a file name results in it being handled literally but in other platforms '\,' is interpreted as a simple ',' and commas need to be escaped using '\\,' instead. Also, make sure this new logic only applies to comma-separated options like 'path'. Non-list options like 'set makeprg=<Tab>' and regular ex commands like `:edit <Tab>` do not require escaping and will continue to work. Also fix up documentation to be clearer. The original docs are slightly misleading in how it discusses triple slashes for 'tags'. closes: vim/vim#13303 related: vim/vim#13301 https://github.com/vim/vim/commit/54844857fd6933fa4f6678e47610c4b9c9f7a091 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | fix(file_search): path with spaces in finddir() and findfile() (#25493)Leonardo Mello2023-10-10
| | | | | | Co-authored-by: dundargoc <gocdundar@gmail.com>
* | vim-patch:9.0.2008: test: undofile left behind (#25567)zeertzjq2023-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: test: undofile left behind Solution: cleanup undofile fix: tmp file not deleted when running make test_undo Temporary file `.Xtestfile.txt.un~` was left running `make test_undo` and vim was configured with: ``` ./configure --with-features=normal --enable-gui=no --enable-terminal ``` closes: vim/vim#13304 https://github.com/vim/vim/commit/b07b9dc4dafe2aad5ee752a51f06acacae210fef Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
* | fix(autocmd): API functions accept garbage after event name #25523ii142023-10-09
| | | | | | | | | | | | | | "VimEnter foo" was accepted as a valid event name for "VimEnter". Events delimited with commas, eg. "VimEnter,BufRead", were also accepted, even though only the first event was actually parsed. Co-authored-by: ii14 <ii14@users.noreply.github.com>
* | feat(ui-ext): make 'mousehide' into proper ui_option (#25532)Jaehoon Hwang2023-10-09
| |
* | test(ui/embed_spec): use notification instead of request (#25555)zeertzjq2023-10-09
| | | | | | This avoid the hang mentioned in #24888, and also matches TUI better.
* | Merge pull request #25503 from bfredl/unishapebfredl2023-10-08
|\ \ | |/ |/| refactor(grid): do arabic shaping in one place
| * refactor(grid): do arabic shaping in one placebfredl2023-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'arabicshape' feature of vim is a transformation of unicode text to make arabic and some related scripts look better at display time. In particular the content of a cell will be adjusted depending on the (original) content of the cells just before and after it. This is implemented by the arabic_shape() function in nvim. Before this commit, shaping was invoked in four different contexts: - when rendering buffer text in win_line() - in line_putchar() for rendering virtual text - as part of grid_line_puts, used by messages and statuslines and similar - as part of draw_cmdline() for drawing the cmdline This replaces all these with a post-processing step in grid_put_linebuf(), which has become the entry point for all text rendering after recent refactors. An aim of this is to make the handling of multibyte text yet simpler. One of the main reasons multibyte chars needs to be "parsed" into codepoint arrays of composing chars is so that these could be inspected for the purpose of shaping. This can likely be vastly simplified in many contexts where only the total length (in bytes) and width of composed char is needed.
* | fix(lsp): account for border height in max floating popup height (#25539)LW2023-10-08
| |
* | Merge pull request #25522 from glepnir/4334bfredl2023-10-07
|\ \ | | | | | | fix(ui): trigger TabNewEntered after split new tab
| * | fix(ui): trigger TabNewEntered after split new tabglepnir2023-10-07
| | |
* | | vim-patch:9.0.1995: Invalid memory access with empty 'foldexpr' (#25530)zeertzjq2023-10-07
| |/ |/| | | | | | | | | | | | | Problem: Invalid memory access when 'foldexpr' returns empty string. Solution: Check for NUL. closes: vim/vim#13293 https://github.com/vim/vim/commit/a991ce9c083bb8c02b1b1ec34ed35728197050f3
* | fix(lua): vim.region on linewise selection #25467Aayush Ojha2023-10-06
| | | | | | fixes #18155
* | refactor: cleanupJustin M. Keyes2023-10-06
| |
* | fix: gf fails on "foo/bar.txt:1:2" on WindowsLeonardo Mello2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: On Windows, "gf" fails on a filepath that has a line:column suffix. Example: E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23" Solution: - Remove ":" from 'isfname' on Windows. Colon is not a valid filename character (except for the drive-letter). - Handle drive letters specially in file_name_in_line(). Fixes #25160
* | Merge pull request #25513 from bfredl/cleangridbfredl2023-10-06
|\ \ | | | | | | refactor(grid): get rid of unbatched grid_puts and grid_putchar
| * | refactor(grid): get rid of unbatched grid_puts and grid_putcharbfredl2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes the long running refactor from the old TUI-focused grid implementation where text-drawing cursor was not separated from the visible cursor. Still, the pattern of setting cursor position together with updating a line was convenient. Introduce grid_line_cursor_goto() to still allow this but now being explicit about it. Only having batched drawing functions makes code involving drawing a bit longer. But it is better to be explicit, and this highlights cases where multiple small redraws can be grouped together. This was the case for most of the changed places (messages, lastline, and :intro)
* | | vim-patch:9.0.1978: No filetype detection for just filesChristian Clason2023-10-06
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Problem: No filetype detection for just files Solution: Detect just files (*.just, justfile, etc) closes: vim/vim#13271 https://github.com/vim/vim/commit/3d90f71b764e67b1eb12fc6a9a4b9e2fca6dc087 vim-patch:b6d01f13: runtime(just): Correct filetype detection pattern and style Co-authored-by: dundargoc <gocdundar@gmail.com>
* | vim-patch:9.0.1983: scrolling inactive window not possible with cursorbind ↵zeertzjq2023-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25507) Problem: Scrolling non-current window using mouse is inconsistent depending on 'scrollbind'/'scrolloff' and different from GUI vertical scrollbar when 'cursorbind' is set. Solution: Don't move cursor in non-current windows for 'cursorbind' if cursor in the current window didn't move. closes: vim/vim#13219 closes: vim/vim#13210 https://github.com/vim/vim/commit/8e5f26ec6a1446aabffa7a0a7819a7462372a5b8
* | vim-patch:9.0.1981: not being able to scroll up in diff mode (#25506)zeertzjq2023-10-05
| | | | | | | | | | | | | | | | | | Problem: Cannot scroll up in diff mode with many filler lines and zero 'scrolloff'. Solution: Invalidate w_cline_row before calling comp_botline(). closes: vim/vim#13256 https://github.com/vim/vim/commit/0583491277dea9d14e000051c26405b90d839072
* | Merge pull request #25491 from glepnir/25474bfredl2023-10-04
|\ \ | | | | | | fix(highlight): attr set all when normal attr changed
| * | fix(highlight): attr set all when normal attr changedglepnir2023-10-04
| |/
* | feat: ignore swapfile for running Nvim processes #25336Justin M. Keyes2023-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The swapfile "E325: ATTENTION" dialog is displayed when editing a file already open in another (running) Nvim. Usually this behavior is annoying and irrelevant: - "Recover" and the other options ("Open readonly", "Quit", "Abort") are almost never wanted. - swapfiles are less relevant for "multi-Nvim" since 'autoread' is enabled by default. - Even less relevant if user enables 'autowrite'. Solution: Define a default SwapExists handler which does the following: 1. If the swapfile is owned by a running Nvim process, automatically chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile, which is mostly harmless and ignored except by `:recover` or `nvim -r`. 2. Shows a 1-line "ignoring swapfile..." message. 3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
* | fix(path): accept special characters on Windows (#25424)Leonardo Mello2023-10-04
| |
* | Merge pull request #25470 from bfredl/msg_displaybfredl2023-10-03
|\ \ | | | | | | refactor(message): simplify msg_puts_display and use batched grid updates
| * | refactor(message): simplify msg_puts_display and use batched grid updatesbfredl2023-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | msg_puts_display was more complex than necessary in nvim, as in nvim, it no longer talks directly with a terminal. In particular we don't need to scroll the grid before emiting the last char. The TUI already takes care of things like that, for terminals where it matters.
* | | fix(api): avoid immediate TextChanged with nvim_create_buf (#25492)zeertzjq2023-10-03
|/ /
* | fix(treesitter): make Visual hl work consistently with foldtext (#25484)zeertzjq2023-10-03
| | | | | | | | | | Problem: Visual highlight is inconsistent on a folded line with treesitter foldtext. Solution: Don't added Folded highlight as it is already in background.
* | test(fileio_spec): fix files not cleaned up properly (#25483)zeertzjq2023-10-03
| |
* | fix(terminal): check terminal size at end of screen update (#25480)zeertzjq2023-10-03
| |
* | vim-patch:9.0.1973: Clean up cmdline option completion code (#25477)zeertzjq2023-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Clean up cmdline option completion code Solution: Fix various minor problems - Fix manual array size calculations to just use `ARRAY_LENGTH()`. - Fix unintentional typo in comments due to copy-paste error. - Fix assert_equal() usages to pass the expected value to first parameter instead of 2nd one to avoid confusion. - Fix signed vs unsigned warnings - Correct misplaced comments about set_op_T and set_prefix_T and fix a typo in another comment closes: vim/vim#13249 closes: vim/vim#13237 https://github.com/vim/vim/commit/6d113472601fa6f3a444a95ef7b11d4309215117 N/A patch: vim-patch:9.0.1976: style: space before tab in optionstr.c Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | vim-patch:9.0.1972: win32: missing '**' expansion test (#25476)zeertzjq2023-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: win32: missing '**' expansion test (after v9.0.1947) Solution: Add test for MS-Windows win32: Add "**" test Vim supports "**" on MS-Windows. However, it is not tested by `Test_glob_extended_bash`. Unlike Unix, it doesn't use 'shell' and doesn't support {,} expansion. So, I added as a separate test. related: vim/vim#13205 closes: vim/vim#13250 https://github.com/vim/vim/commit/4a1ad5556423dca5f5b7ee39f143579e67569ae1 Co-authored-by: Ken Takata <kentkt@csc.jp>
* | feat(lsp)!: replace snippet parser by lpeg grammarMaria José Solano2023-10-02
| |
* | feat(lsp): fallback to code-action command on resolve failure (#25464)Mathias Fußenegger2023-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The haskell-language-server supports resolve only for a subset of code actions. For many code actions trying to resolve the `edit` property results in an error, but the unresolved action already contains a command that can be executed without issue. The protocol specification is unfortunately a bit vague about this, and what the haskell-language-server does seems to be valid. Example: newtype Dummy = Dummy Int instance Num Dummy where Triggering code actions on "Num Dummy" and choosing "Add placeholders for all missing methods" resulted in: -32601: No plugin enabled for SMethod_CodeActionResolve, potentially available: explicit-fields, importLens, hlint, overloaded-record-dot With this change it will insert the missing methods: instance Num Dummy where (+) = _ (-) = _ (*) = _ negate = _ abs = _ signum = _ fromInteger = _
* | feat(treesitter): add foldtext with treesitter highlighting (#25391)Till Bungert2023-10-01
| |
* | feat(completion): support completing more string optionszeertzjq2023-10-01
| |
* | vim-patch:9.0.1968: cmdline completion should consider key optionzeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cmdline completion should consider key option Solution: Disable cmdline completion for key option, slightly refactor how P_NO_CMD_EXPAND is handled Harden crypto 'key' option: turn off cmdline completion, disable set-= "set-=" can be used maliciously with a crypto key, as it allows an attacker (who either has access to the computer or a plugin author) to guess a substring by observing the modified state. Simply turn off set+=/-=/^= for this option as there is no good reason for them to be used. Update docs to make that clear as well. Also, don't allow cmdline completion for 'key' as it just shows ***** which is not useful and confusing to the user what it means (if the user accidentally hits enter they will have replaced their key with "*****" instead). Move logic to better location, don't use above 32-bit for flags Move P_NO_CMD_EXPAND to use the unused 0x20 instead of going above 32-bits, as currently the flags parameter is only 32-bits on some systems. Left a comment to warn that future additions will need to change how the flags work either by making it 64-bit or split into two member vars. Also, move the logic for detecting P_NO_CMD_EXPAND earlier so it's not up to each handler to decide, and you won't see the temporary "..." that Vim shows while waiting for completion handler to complete. closes: vim/vim#13224 https://github.com/vim/vim/commit/6ee7b521fa7531ef356ececc8be7575c3800f872 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | vim-patch:9.0.1961: 'listchars' completion misses "multispace" and ↵zeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | | | | | | | "leadmultispace" Problem: Cmdline completion for 'listchars' fields doesn't include "multispace" and "leadmultispace" (after 9.0.1958). Solution: Include "multispace" and "leadmultispace" in lcstab. closes: vim/vim#13225 https://github.com/vim/vim/commit/1f025b01e29be6fce907d0379602b45031d6998f
* | vim-patch:9.0.1958: cannot complete option valueszeertzjq2023-10-01
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: vim/vim#13182 https://github.com/vim/vim/commit/900894b09a95398dfc75599e9f0aa2ea25723384 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* Merge pull request #25455 from bfredl/highlight_namespace_gettersbfredl2023-10-01
|\ | | | | feat(ui): allow to get the highlight namespace. closes #24390
| * feat(ui): allow to get the highlight namespaceDaniel Steinberg2023-10-01
| |
* | vim-patch:9.0.1967: xattr errors not translated (#25454)zeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | Problem: xattr errors not translated Solution: mark for translation, consistently capitalize first letter. closes: vim/vim#13236 https://github.com/vim/vim/commit/7ece036d72cf639b05d3936183220bec7179bf63
* | vim-patch:9.0.1963: Configure script may not detect xattrzeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Configure script may not detect xattr correctly Solution: include sys/xattr instead of attr/xattr, make Test_write_with_xattr_support() test xattr feature correctly This also applies to the Smack security feature, so change the include and configure script for it as well. closes: vim/vim#13229 https://github.com/vim/vim/commit/6de4e58cf27a3bb6e81653ca63b77e29d1bb46f2
* | vim-patch:9.0.1962: No support for writing extended attributeszeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No support for writing extended attributes Solution: Add extended attribute support for linux It's been a long standing issue, that if you write a file with extended attributes and backupcopy is set to no, the file will loose the extended attributes. So this patch adds support for retrieving the extended attributes and copying it to the new file. It currently only works on linux, mainly because I don't know the different APIs for other systems (BSD, MacOSX and Solaris). On linux, this should be supported since Kernel 2.4 or something, so this should be pretty safe to use now. Enable the extended attribute support with normal builds. I also added it explicitly to the :version output as well as make it able to check using `:echo has("xattr")`, to have users easily check that this is available. In contrast to the similar support for SELINUX and SMACK support (which also internally uses extended attributes), I have made this a FEAT_XATTR define, instead of the similar HAVE_XATTR. Add a test and change CI to include relevant packages so that CI can test that extended attributes are correctly written. closes: vim/vim#306 closes: vim/vim#13203 https://github.com/vim/vim/commit/e085dfda5d8dde064b0332464040959479696d1c Co-authored-by: Christian Brabandt <cb@256bit.org>
* | test(unit): move statusline tests to statusline_spec.lua (#25441)zeertzjq2023-09-30
| |
* | Merge pull request #25386 from glepnir/toggle_floatbfredl2023-09-30
|\ \ | | | | | | feat(float): support toggle show float window