aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* feat(lsp): snippet parsing using lpegMaria 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 = _
* refactor: move cmdline completion types to cmdexpand_defs.h (#25465)zeertzjq2023-10-02
|
* feat(treesitter): add foldtext with treesitter highlighting (#25391)Till Bungert2023-10-01
|
* refactor(option.c): change :set boolean prefix to an enum (#25458)zeertzjq2023-10-01
| | | Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* Merge pull request #25456 from zeertzjq/vim-9.0.1958zeertzjq2023-10-01
|\ | | | | vim-patch:9.0.{1958,1960,1961,1968}: string option completion
| * 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.1960: Make CI checks more strictzeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Make CI checks more strict Solution: Add -Wstrict-prototypes -Wmissing-prototypes to CI, fix uncovered problems Add -Wstrict-prototypes -Wmissing-prototypes warnings check to CI Add two new warnings to CI, silence some Perl related build-warnings: - `strict-prototypes` helps prevent declaring a function with an empty argument list, e.g. `int func()`. In C++, that's equivalent to `int func(void)`, but in C, that means a function that can take any number of arguments which is rarely what we want. - `missing-prototypes` makes sure we use `static` for file-only internal functions. Non-static functions should have been declared on a prototype file. - Add `no-compound-token-split-by-macro` to the perl cflags, since it throws out a bunch of perl-related warnings that make the CI log unnecessary verbose and hard to read. This seems to happen only with clang 12 and above. When applying those changes, it already uncovered a few warnings, so fix up the code as well (fix prototypes, make the code static, remove shadowed var declaration) GTK header needs to have #pragma warning suppressiong because GTK2 headers will warn on `-Wstrict-prototypes`, and it's included by gui.h and so we can't just turn off the warning in a couple files. closes: vim/vim#13223 closes: vim/vim#13226 https://github.com/vim/vim/commit/f7f746b1672909ae57d2eec97253d6627f6c0887 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
| * 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.1964: xattr support fails to build on MacOS X (#25448)zeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: xattr support fails to build on MacOS X Solution: Disable xattr support for MacOS X MacOS X uses the same headers and functions sys/xattr.h but the function signatures for xattr support are much different, so building fails. So let's for now disable xattr support there. closes: vim/vim#13230 closes: vim/vim#13232 https://github.com/vim/vim/commit/a4dfbfed89e26a766e30cca62c18e710eec81c3f Co-authored-by: Christian Brabandt <cb@256bit.org>
* | Merge pull request #25442 from zeertzjq/vim-9.0.1962zeertzjq2023-09-30
|\ \ | | | | | | vim-patch:9.0.{1962,1963}: extended attributes
| * | 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
| * | feat(float): support toggle show float windowglepnir2023-09-30
| | |
* | | vim-patch:9.0.1366: functions for setting options are in random order (#25440)zeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Functions for setting options are in random order. Solution: Sort functions alphabetically. (Yegappan Lakshmanan, closes vim/vim#12082) https://github.com/vim/vim/commit/ad60898aa47b44fdece12d28c471fb50df27fb50 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | | refactor: align set_chars_option() with Vim (#25438)zeertzjq2023-09-30
| | | | | | | | | Needed for completion of 'listchars'/'fillchars' values.
* | | refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
* | | build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
| | |
* | | test(old): don't check for $CLANG_SANITIZER (#25432)zeertzjq2023-09-30
| | | | | | | | | | | | Functional tests don't check for an environment variable before printing ASAN logs, so oldtests shouldn't either.
* | | vim-patch:9.0.1956: Custom completion skips orig cmdline if it invokes ↵zeertzjq2023-09-30
| |/ |/| | | | | | | | | | | | | | | | | | | glob() (#25427) Problem: Custom cmdline completion skips original cmdline when pressing Ctrl-P at first match if completion function invokes glob(). Solution: Move orig_save into struct expand_T. closes: vim/vim#13216 https://github.com/vim/vim/commit/28a23602e8f88937645b8506b7915ecea6e09b18
* | Merge pull request #25418 from bfredl/no_attr2bfredl2023-09-29
|\ \ | | | | | | refactor(message): remove more "attr" variants
| * | refactor(message): smsg_attr -> smsgbfredl2023-09-29
| | |
| * | refactor(message): msg_puts_attr_len -> msg_puts_lenbfredl2023-09-29
| | |
| * | refactor(message): msg_outtrans_long_len_attr -> msg_outtrans_longbfredl2023-09-29
| | |
* | | docs(term): use tic -x for better compatibility with old ncurses (#25421)Dr. Matthew Swabey2023-09-29
| | | | | | | | | Use `tic -x` instead of `tic` to include any unknown capabilities in a modern `terminfo.src` as user-defined ones, instead of dropping them. Modern ncurses behavior with `tic -x` will not change.
* | | Merge pull request #25395 from bfredl/line_buf2bfredl2023-09-29
|\ \ \ | | | | | | | | refactor(grid): unify the two put-text-on-the-screen code paths
| * | | refactor(grid): unify the two put-text-on-the-screen code pathsbfredl2023-09-29
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The screen grid refactors will continue until morale improves. Jokes aside, this is quite a central installment in the series. Before this refactor, there were two fundamentally distinct codepaths for getting some text on the screen: - the win_line() -> grid_put_linebuf() -> ui_line() call chain used for buffer text, with linebuf_char as a temporary scratch buffer - the grid_line_start/grid_line_puts/grid_line_flush() -> ui_line() path used for every thing else: statuslines, messages and the command line. Here the grid->chars[] array itself doubles as a scratch buffer. With this refactor, the later family of functions still exist, however they now as well render to linebuf_char just like win_line() did, and grid_put_linebuf() is called in the end to calculate delta changes. This means we don't need any duplicate logic for delta calculations anymore. Later down the line, it will be possible to share more logic operating on this scratch buffer, like doing 'rightleft' reversal and arabic shaping as a post-processing step.
* / / refactor(lsp): deprecate util methods (#25400)Maria José Solano2023-09-29
|/ /
* | refactor: remove longdundargoc2023-09-29
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
* | fix(unittests): ignore __s128 and __u128 types in ffiJames McCoy2023-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux added these types to their userspace headers in [6.5], which causes unit tests to fail like ``` -------- Running tests from test/unit/api/private_helpers_spec.lua RUN vim_to_object converts true: 17.00 ms ERR test/unit/helpers.lua:748: test/unit/helpers.lua:732: (string) ' test/unit/helpers.lua:264: ';' expected near '__s128' at line 194' exit code: 256 stack traceback: test/unit/helpers.lua:748: in function 'itp_parent' test/unit/helpers.lua:784: in function <test/unit/helpers.lua:774> ``` Since we don't use these types, they can be ignored to avoid LuaJIT's C parser choking on them. [6.5]: https://github.com/torvalds/linux/commit/224d80c584d3016cb8d83d1c33914fdd3508aa8c
* | vim-patch:02902b547bdb (#25406)zeertzjq2023-09-29
| | | | | | | | | | | | | | runtime(doc): text-objects: document how escaped delimiters are handled https://github.com/vim/vim/commit/02902b547bdb3ba480a52c90dce742201241f224 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | vim-patch:9.0.1950: Vim9: error codes spread out (#25405)zeertzjq2023-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: error codes spread out Solution: group them together and reserve 100 more for future use Reserve 100 error codes for future enhancements to the Vim9 class support closes: vim/vim#13207 https://github.com/vim/vim/commit/413f83990f15d5d59d27ab741670f527a7a3feb8 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | Merge pull request #25398 from zeertzjq/vim-9.0.1946zeertzjq2023-09-29
|\ \ | | | | | | vim-patch:9.0.{0607,1946,1947}: filename expansion using ** in bash may fail
| * | vim-patch:9.0.1947: Bash Expansion test fails on Windows/MacOSzeertzjq2023-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Bash Expansion test fails on Windows/MacOS Solution: Disable Test_glob_extended_bash for now This test doesn't work on Windows even if bash can be executed, since the globstar functionality has only been enabled in Unix builds of Vim (Commit 9eb1ce531527a7177d16373b0f8689bbcd3d5f73, patch 9.0.1946). closes: vim/vim#13205 https://github.com/vim/vim/commit/03ca4002c1dcd34c4b17fe4a491b02d77ec2c887 Co-authored-by: Ken Takata <kentkt@csc.jp>
| * | vim-patch:9.0.1946: filename expansion using ** in bash may failzeertzjq2023-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filename expansion using ** in bash may fail Solution: Try to enable the globstar setting Starting with bash 4.0 it supports extended globbing using the globstar shell option. This makes matching recursively below a certain directory using the ** pattern work as expected nowadays. However, we need to explicitly enable this using the 'shopt -s globstar' bash command. So let's check the bash environment variable $BASH_VERSINFO (which is supported since bash 3.0 and conditionally enable the globstar option, if the major version is at least 4. For older bashs, this at least shouldn't cause errors (unless one is using really ancient bash 2.X or something). closes: vim/vim#13002 closes: vim/vim#13144 https://github.com/vim/vim/commit/9eb1ce531527a7177d16373b0f8689bbcd3d5f73 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * | vim-patch:9.0.0607: verbose echo message test fails on Mac OSzeertzjq2023-09-29
|/ / | | | | | | | | | | | | | | | | Problem: Verbose echo message test fails on Mac OS. Solution: Skip the test on Mac OS. https://github.com/vim/vim/commit/f802767df7b4532651fcf11d49e812ead32db45b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | test: decoration provider with wrapped lines (#25404)zeertzjq2023-09-28
| |
* | docs: Lua docstrings guidance #25345dundargoc2023-09-27
| | | | | | | | | | | | Recommend adding a space after i.e. `--- @see`. The "space" variant is common for the vast majority of docstring formats such as doxygen, javadoc and typescript.
* | Merge pull request #25396 from bfredl/no_attrbfredl2023-09-27
|\ \ | | | | | | refactor(messages): fold msg() functions with and without attr
| * | refactor(messages): rename msg_trunc_attr and msg_multiline_attr without attrbfredl2023-09-27
| | |
| * | refactor(messages): fold msg_attr into msgbfredl2023-09-27
| | | | | | | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * | refactor(messages): fold msg_outtrans_attr into msg_outtransbfredl2023-09-27
| | | | | | | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
* | | vim-patch:5277cfaf8afe (#25397)zeertzjq2023-09-28
| | | | | | | | | | | | | | | runtime(doc): mention mouse scrolling in scrollbind-quickadj (vim/vim#13190) https://github.com/vim/vim/commit/5277cfaf8afe847b7d4dcde6057fbecb001ab64e