Commit Graph

6322 Commits

Author SHA1 Message Date
Lewis Russell
5a2536de0c
refactor(lsp): move changetracking to separate file (#26577)
* refactor(lsp): move changetracking to separate file

- Prefixed changetracking types with `vim.lsp.`

* fixup!: make _reset_timer a local function

* fixup!: remove @private annotations

* fixup!: changetracking.lua -> _changetracking.lua

* fixup! types

* fixup! add send_changes_for_group
2023-12-17 09:54:38 +00:00
dundargoc
404fdb0f36 build: cmake fixes
- add EXTERNALPROJECT_OPTIONS variable to main build
- use `REQUIRED` keyword for IWYU.
- remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS`
  is `ON`. If we explicitly enable it then we probably want it to give
  an error if it doesn't exist, rather than silently skip it.
- Move dependency interface libraries to their find module and use them
  as a pseudo-imported target.
- Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it
  again if something similar is needed.
- Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version`
  output.
2023-12-16 21:06:28 +01:00
Gregory Anders
8fb7419d7c
refactor: only reload colorscheme if &bg changed (#26598)
Currently, setting &bg at all re-initializes highlights and reloads
the active colorscheme, even if the actual value of &bg has not changed.
With https://github.com/neovim/neovim/pull/26595 this causes a
regression since &bg is set unconditionally based on the value detected
from the terminal.

Instead, only reload the colorscheme if the actual value of &bg has
changed.
2023-12-16 11:18:45 -06:00
dundargoc
7840760776 build: bump minimum cmake version to 3.13
The benefits are primarily being able to use FetchContent, which allows
for a more flexible dependency handling. Other various quality-of-life
features such as `-B` and `-S` flags are also included.

This also removes broken `--version` generation as it does not work for
version 3.10 and 3.11 due to the `JOIN` generator expression.

Reference: https://github.com/neovim/neovim/issues/24004
2023-12-16 17:17:24 +01:00
Christian Clason
69f5f0e20e vim-patch:82f19734bfcb
runtime(doc): remove deprecation warning for gdefault

Deprecated can be misunderstood as being slated for removal; slightly
change wording to be clearer.

82f19734bf

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-12-16 15:57:22 +01:00
Christian Clason
bf382df84f vim-patch:0f61943eb776
runtime(logtalk): Update Logtalk runtime files for the latest language spec (vim/vim#13697)

0f61943eb7

Co-authored-by: Paulo Moura <pmoura@logtalk.org>
2023-12-16 15:57:22 +01:00
Christian Clason
ba613d63c4 vim-patch:5eb9cb53d619
runtime(racket): update Racket runtime files (vim/vim#13693)

This brings the included Racket runtime files to commit 43bfc87 (update
headers, 2023-12-15) of https://github.com/benknoble/vim-racket. Note
that not all files from that repository are included. (In particular,
the ftdetect script is omitted for now.)

5eb9cb53d6

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2023-12-16 15:57:22 +01:00
Christian Clason
6b8084a6be vim-patch:0378f07fbaee
runtime(colorschemes): Update colorschemes (vim/vim#13691)

Minor changes:

- Regenerated using colortemplate 2.2.3
- Removed reversed gui-cursor for some of the colorschemes (retrobox, wildcharm, lunaperche)
- Change MatchParen for some of colorschemes.

0378f07fba

Co-authored-by: Maxim Kim <habamax@gmail.com>
2023-12-16 15:43:26 +01:00
Evgeni Chasnovski
574519d9d6 feat(highlight): tweak default color scheme
Problem: Updating default color scheme produced some feedback.

Solution: Address the feedback.

Outline of the changes:

- Colors `Grey1` and `Grey2` are made a little bit more extreme (dark -
  darker, light - lighter) to increase overall contrast.

- `gui` colors are treated as base with `cterm` colors falling back to
  using 0-15 colors which come from terminal emulator.

- Update highlight group definition to not include attribute definition
  if it is intended to staty uncolored.

- Tweak some specific highlight groups.

- Add a list of Neovim specific highlight groups which are now defined
  differently in a breaking way.

- Minor tweaks in several other places related to default color scheme.
2023-12-16 14:43:03 +01:00
mathew
e38027ef69 feat(ui): completeopt support popup like vim 2023-12-16 18:59:59 +08:00
bfredl
7e7da962de
Merge pull request #26512 from famiu/refactor/options/type_flags
refactor(options): remove option type macros
2023-12-16 11:39:30 +01:00
dundargoc
7cae94e91e vim-patch:e06f2b498ccc
runtime(doc): fix typo in change.txt

e06f2b498c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-16 10:29:50 +01:00
Gregory Anders
f4f7e29469
refactor(defaults): always set options, even if value hasn't changed (#26595)
Comparing against the old value before setting matched the original
C implementation, but there is no reason to use this restriction. In
particular, this inhibits using OptionSet to determine when the option
was set. If users need to handle a case where the option _changed_, it
is easy to do so in an OptionSet autocommand using v:option_new and
v:option_old (and friends).
2023-12-15 16:35:55 -06:00
zeertzjq
0d26d192d8
vim-patch:9a775b4a2ae6 (#26588)
runtime(netrw): escape curdir in BrowseUpDir (vim/vim#13681)

 fixes vim/vim#13678

9a775b4a2a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-16 05:28:57 +08:00
Gregory Anders
224b2ec202
Merge pull request #26579 from gpanders/defer-set-tgc
refactor(defaults): defer setting 'termguicolors' until after VimEnter
2023-12-15 09:23:12 -06:00
Christian Clason
34f008e247 vim-patch:3afc9f2556fa
runtime(cmake): sync runtime files with upstream (vim/vim#13597)

3afc9f2556

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-12-15 10:30:13 +01:00
Christian Clason
65032e03e0 vim-patch:1c97b5c0c0b4
runtime(vim): Update syntax file, fix missing for highlight (vim/vim#13668)

Fix highlighting of :for command.  Link the vimFor syntax group to the
vimCommand highlight group.

Error introduced in commit f686921

1c97b5c0c0

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-15 10:30:13 +01:00
Christian Clason
7e717805be vim-patch:b52e7ac7c61c
runtime(netrw): Fix `w:netrw_bannercnt` ref error with `netrw_fastbrowse=2` (vim/vim#13659)

* NetRW: Fix `w:netrw_bannercnt` ref error with `netrw_fastbrowse=2`
* NetRW: Fix wrong `w:netrw_bannercnt` setting

closes: vim/vim#13640

b52e7ac7c6

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-12-15 10:30:13 +01:00
Christian Clason
02e8582230 vim-patch:5a68cdf14915
runtime(sbt): do not set b:did_ftplugin before sourcing scala ftplugin(vim/vim#13657)

The `b:did_ftplugin` guard was set and prevented us from actually sourcing `ftplugin/scala.vim`. Since the latter script also sets the guard properly, we can simply remove the guard here.

5a68cdf149

Co-authored-by: Karl Yngve Lervåg <karl.yngve@lervag.net>
2023-12-15 10:30:13 +01:00
Christian Clason
745b74162c vim-patch:f6869212c9e1
runtime(vim): Update syntax file (vim/vim#13653)

Improve variable highlighting in :let, :unlet, :const and :for commands.

Match registers and local, global and terminal option variables.

f6869212c9

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-12-15 10:30:13 +01:00
zeertzjq
165e5ececc
vim-patch:17dca3cb97cd (#26584)
runtime(doc): grammar & typo fixes

closes: vim/vim#13654

17dca3cb97

Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-12-15 06:42:29 +08:00
zeertzjq
046efa106e
vim-patch:323dda1484d9 (#26583)
runtime(termdebug): add Tbreak command

closes: vim/vim#13656

323dda1484

Co-authored-by: iam28th <artyom28th@gmail.com>
2023-12-15 06:27:49 +08:00
Gregory Anders
b0e2643cb2 refactor(defaults): defer setting 'termguicolors' until after VimEnter
This ensures that any OptionSet autocommands will fire when the value is
changed.
2023-12-14 11:42:17 -06:00
Gregory Anders
ffeb31c2f9 fix(termcap): set 'nested' on TermResponse autocommand 2023-12-14 11:38:34 -06:00
Gregory Anders
ef38fdfdc6
refactor(diagnostic): use named namespaces (#26568)
Anonymous namespaces are more difficult to extend or hook into since
they do not appear in the output of nvim_get_namespaces(). Use named
namespaces instead.
2023-12-14 09:19:33 -06:00
Gregory Anders
ddcbc5c78a
docs: add comment for OSC 11 tmux passthrough (#26566) 2023-12-14 08:38:26 -06:00
Lewis Russell
97bea3163a feat(lsp): more annotations 2023-12-14 12:39:18 +00:00
Famiu Haque
3c2c022e5e
refactor(options): remove option type macros
Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future.

Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future.

Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
2023-12-14 16:46:42 +06:00
Raphael
619407eb54
feat(nvim_open_term): convert LF => CRLF (#26384)
Problem:
Unlike termopen(), nvim_open_term() PTYs do not carriage-return the
cursor on newline ("\n") input.

    nvim --clean
    :let chan_id = nvim_open_term(1, {})
    :call chansend(chan_id, ["here", "are", "some", "lines"])

Actual behavior:

    here
        are
           some
               lines

Expected behaviour:

    here
    are
    some
    lines

Solution:
Add `force_crlf` option, and enable it by default.
2023-12-14 16:08:00 +08:00
Jaehwang Jung
5aa1ba3efe
fix(defaults): background detection in tmux (#26557)
Wrap the query with passthrough sequence
2023-12-14 06:16:21 +08:00
dundargoc
1d63a057a6 docs: fix links 2023-12-13 20:31:16 +01:00
dundargoc
7908dc0d15 docs: move vim-patch wiki page to runtime documentation 2023-12-13 18:31:05 +01:00
dundargoc
fbd0f6658f docs: add installation and build guides from wiki to repo 2023-12-13 17:53:36 +01:00
Gregory Anders
ad6c4c2e9d
Merge pull request #26555 from gpanders/diagnostic-sign-fixup
Diagnostic sign fixups
2023-12-13 10:38:16 -06:00
dundargoc
ef58ee48f4
docs: add wiki FAQ to the runtime documentation (#26539)
Problem: Wiki contents are not discoverable and hard to maintain.
Solution: Move FAQ to runtime docs.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-12-13 17:31:39 +01:00
Gregory Anders
a3b3978474 feat(diagnostics): support numhl and linehl for diagnostic signs 2023-12-13 09:56:10 -06:00
Gregory Anders
39112c72dd docs(diagnostic): fix typo in example 2023-12-13 09:43:27 -06:00
Gregory Anders
29d5ff6ac4 fix(diagnostic): check for sign namespace instead of sign group 2023-12-13 09:30:13 -06:00
Raphael
8122470f83
refactor(diagnostic): set sign by using extmark (#26193)
after sign implementation refactor by using extmark, we can use
`nvim_buf_set_extmark` to set diagnostic sign instead use `sign_define`
2023-12-13 08:19:53 -06:00
Gregory Anders
e527842211
fix(termcap): only call callback for requested capabilities (#26546)
If multiple XTGETTCAP requests are active at once (for example, for
requesting the Ms capability and truecolor capabilities), then the
TermResponse autocommand may fire for capabilities that were not
requested. Instead, make sure that the provided callback is only called
for capabilities that were actually requested.
2023-12-13 08:14:30 -06:00
Will Hopkins
69ffbb76c2
feat(iter): add Iter.take (#26525) 2023-12-12 14:27:24 -06:00
Raphael
1d4a5cd185
feat(eval): exists() function supports checking v:lua functions (#26485)
Problem:  Vimscript function exists() can't check v:lua functions.
Solution: Add support for v:lua functions to exists().
2023-12-12 19:06:22 +08:00
Lewis Russell
8097b4a725
Merge pull request #26506 from tomtomjhj/tsfold
fix(treesitter): improve vim.treesitter.foldexpr
2023-12-11 19:30:53 +00:00
Jaehwang Jung
6f75facb9d fix(treesitter): improve vim.treesitter.foldexpr
* Collect on_bytes and flush at the invocation of the scheduled callback
  to take account of commands that triggers multiple on_bytes.
* More accurately track movement of folds so that foldexpr returns
  reasonable values even when the scheduled computation is not run yet.
* Start computing folds from the line above (+ foldminlines) the changed
  lines to handle the folds that are removed due to the size limit.
* Shrink folds that end at the line at which another fold starts to
  assign proper level to that line.
* Use level '=' for lines that are not computed yet.
2023-12-12 02:29:59 +09:00
Jaehwang Jung
7c6f9690f7 fix(treesitter): fix indexing in foldexpr 2023-12-12 02:29:59 +09:00
Jongwook Choi
3692fd4c87
feat(gen_lsp.lua): validate CLI args #26514
- Improve CLI argument parsing, rejects invalid argument and commands as
  early as possible. Also prints USAGE in the command line.
- No longer allows `--<outfile>`, use `--out <outfile>` instead.
- Print a little bit of verbose messages to better know what's going on
  rather than remaining silent at all times.
- Add type annotation `gen_lsp._opt` to avoid type warnings.
2023-12-11 01:10:00 -08:00
Christian Clason
c675e51c2f docs(news): very, very minorly
* fix garbled item for new treesitter injection format
* add missing item for new `vim.lpeg` and `vim.re`
* use taglinks where possible
* remove redundant "Added" and "Removed" from items
2023-12-10 14:28:07 +01:00
zeertzjq
29aa4dd10a
vim-patch:61e984e212ed (#26484)
runtime(doc): link cmdline completion to to |wildcards| and fix typos (vim/vim#13636)

The docs for cmdline completion doesn't mention that [abc] is considered
a wildcard, and |wildcards| contains more detailed information, so just
link to it.

Also fix some typos in other help files.

61e984e212
2023-12-09 15:35:45 +08:00
zeertzjq
f45bf44176
vim-patch:ff0baca86523 (#26476)
runtime(syntax): unlet b:filetype_in_cpp_family for cpp & squirrel

Update runtime/syntax/cpp.vim and runtime/syntax/squirrel.vim to unlet
b:filetype_in_cpp_family as it remains set even after updating the ft of
a file manually or through a modeline, not allowing c specific keywords
to be highlighted.

Since the variable b:filetype_in_cpp_family is only used by the c.vim
syntax script, unlet it directly after sourcing the c.vim runtime file
instead of at the end of the script.

Also update the last Change Header for both files.

closes: vim/vim#13650

ff0baca865

Co-authored-by: laburnumT <laburnumtec@gmail.com>
2023-12-09 07:45:31 +08:00
Maria José Solano
a1bdf2852d
fix(snippet): remove misleading comment about TM_FILENAME_BASE (#26465) 2023-12-08 21:23:46 +01:00