Commit Graph

711 Commits

Author SHA1 Message Date
Trevor Arjeski
170c890dca
feat(shortmess): "q" flag fully hides recording message (#27415)
When "q" is set in 'shortmess' it now fully hides the "recording @a" message
when you are recording a macro instead of just shortening to "recording". This
removes duplication when using reg_recording() in the statusline.

Related #19193
2024-02-11 07:39:39 +08:00
zeertzjq
8c044f0862
fix(spell): always accept ':' as filename char in 'spellfile' (#27172)
Follow-up to #25236
2024-01-24 18:13:39 +08:00
zeertzjq
cb6320e13f
docs(options): remove misleading sentence (#27129)
Setting 'verbose' to 1 doesn't cause Nvim to produce messages. It adds
more information to existing messages, which is documented above.
2024-01-22 22:54:45 +08:00
Lewis Russell
1233ac467d
feat(fold): transparent foldtext
'foldtext' can be set to an empty string to disable and render the
line with:
  - extmark highlight
  - syntax highlighting
  - search highlighting
  - no line wrapping
  - spelling
  - conceal
  - inline virtual text
  - respects `fillchars:fold`

Currently normal virtual text is not displayed


Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-01-22 10:13:35 +00:00
zeertzjq
780dd88b68
vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)
Problem:  too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
          (zeertzjq)

related: #27050
closes: vim/vim#13877

6a8d2e1634

Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
2024-01-18 07:14:12 +08:00
dundargoc
b3e5587b7f
docs: various fixes (#26929)
Co-authored-by: Patrick Bollinger <owner@pjbollinger.com>
Co-authored-by: vilo1839 <139687192+vilo1839@users.noreply.github.com>
2024-01-17 14:01:39 +08:00
Luuk van Baal
463cb28a22 docs(column): 'statuscolumn' redraw interaction with 'relativenumber' 2024-01-16 12:14:00 +01:00
Luuk van Baal
fa61e0c047 refactor(column): define and use maximum 'statuscolumn' width
Problem:  The maximum 'statuscolumn' width and grow behavior is undocumented.
Solution: Define, use and document the maximum 'statuscolumn' width and grow behavior.
2024-01-04 11:52:37 +00:00
bfredl
e8acbc1ade refactor(cpoptions): remove 'p'
Deleting a cpo flag a day keeps the doctor away

We don't need two different ways to indent LISP code
2023-12-25 14:13:52 +01:00
Christian Clason
19aba5916a
docs(options): add codeblock annotations to options.lua (#26696)
Also consistently remove leading colons in examples

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-12-22 10:55:39 +01:00
zeertzjq
6700127b30
vim-patch:9.0.2183: Maximum callback depth is not configurable (#26703)
Problem:  Maximum callback depth is not configurable.
Solution: Revert patch 9.0.2103.  Set 'maxfuncdepth' in test.

fixes: vim/vim#13732
closes: vim/vim#13736

fe583b1e59
2023-12-22 10:33:34 +08:00
dundargoc
693aea0e9e
docs: small fixes (#26448)
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Jordan Mandel <jordan.mandel@live.com>
2023-12-19 13:29:13 +08: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
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
mathew
e38027ef69 feat(ui): completeopt support popup like vim 2023-12-16 18:59:59 +08: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
2613ba5000 feat(defaults): enable 'termguicolors' by default when supported by terminal
Enable 'termguicolors' automatically when Nvim can detect that truecolor
is supported by the host terminal.

If $COLORTERM is set to "truecolor" or "24bit", or the terminal's
terminfo entry contains capabilities for Tc, RGB, or setrgbf and
setrgbb, then we assume that the terminal supports truecolor. Otherwise,
the terminal is queried (using both XTGETTCAP and SGR + DECRQSS). If the
terminal's response to these queries (if any) indicates that it supports
truecolor, then 'termguicolors' is enabled.
2023-12-06 07:57:09 -08:00
Luuk van Baal
c4afb9788c refactor(sign): move legacy signs to extmarks
Problem:  The legacy signlist data structures and associated functions are
          redundant since the introduction of extmark signs.
Solution: Store signs defined through the legacy commands in a hashmap, placed
          signs in the extmark tree. Replace signlist associated functions.

Usage of the legacy sign commands should yield no change in behavior with the
exception of:
  - "orphaned signs" are now always removed when the line it is placed on is
    deleted. This used to depend on the value of 'signcolumn'.
  - It is no longer possible to place multiple signs with the same identifier
    in a single group on multiple lines. This will now move the sign instead.

Moreover, both signs placed through the legacy sign commands and through
|nvim_buf_set_extmark()|:
  - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|.
  - Are displayed by increasing sign identifier, left to right.
    Extmark signs used to be ordered decreasingly as opposed to legacy signs.
2023-11-17 15:10:15 +01:00
Gregory Anders
ac8ed77afb
feat(tui): add 'termsync' option (#25871)
The 'termsync' option enables a mode (provided the underlying terminal
supports it) where all screen updates during a redraw cycle are buffered
and drawn together when the redraw is complete. This eliminates tearing
or flickering in cases where Nvim redraws slower than the terminal
redraws the screen.
2023-11-14 08:53:58 -06:00
Ploum
5b45efbee6
fix(defaults): set 'fsync' #26034
Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888

Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.
2023-11-14 02:56:50 -08:00
zeertzjq
6d14f3ddab
vim-patch:9.0.2103: recursive callback may cause issues on some archs (#26013)
Problem:  recursive callback may cause issues on some archs
Solution: Decrease the limit drastically to 20

Recursive callback limit causes problems on some architectures

Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test
that causes a recursive popup callback function to be executed. However
it seems the current limit of 'maxfuncdepth' option value is still too
recursive for some 32bit architectures (e.g. 32bit ARM).

So instead of allowing a default limit of 100 (default value for
'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a
use case where one would need such a high recursive callback limit and a
limit of 20 seems reasonable (although it is currently hard-coded).

closes: vim/vim#13495
closes: vim/vim#13502

2076463e38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-13 06:33:34 +08:00
zeertzjq
2494009885
vim-patch:1b08d2cd0789 (#25993)
runtime(doc): clarify when formatoptions applies

closes: vim/vim#13503

1b08d2cd07

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12 07:49:57 +08:00
zeertzjq
f7b2ea59a6
vim-patch:9.0.2095: statusline may look different than expected (#25941)
Problem:  statusline may look different than expected
Solution: do not check for highlighting of stl and stlnc characters

statusline fillchar may be different than expected

If the highlighting group for the statusline for the current window
|hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared
(or do not differ from each other), than Vim will use the hard-coded
fallback values '^' (for the non-current windows) or '=' (for the
current window).  I believe this was done, to make sure the statusline
will always be visible and be distinguishable from the rest of the
window.

However, this may be unexpected, if a user explicitly defined those
fillchar characters just to notice that those values are then not used
by Vim.

So, let's assume users know what they are doing and just always return
the configured stl and stlnc values.  And if they want the statusline to
be non-distinguishable from the rest of the window space, so be it.  It
is their responsibility and Vim shall not know better what to use.

fixes: vim/vim#13366
closes: vim/vim#13488

6a650bf696

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-09 06:34:34 +08:00
dundargoc
2dc9ceb99c
docs: small fixes (#25585)
Co-authored-by: tmummert <doczook@gmx.de>
Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
2023-10-29 16:02:32 +08:00
zeertzjq
a2a1a65b98
vim-patch:8ebdbc9e6d80 (#25816)
runtime(doc): all secure options should note this restriction in the documentation (vim/vim#13448)

Problem:  Not all secure options document their status
Solution: Describe secure context :set restrictions in each help entry

8ebdbc9e6d

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-10-29 06:15:13 +08:00
zeertzjq
bfe8a39512
vim-patch:partial:5985879e3c36 (#25780)
runtime(doc): Fix typos in several documents (vim/vim#13420)

* Fix typos in several documents
* Update runtime/doc/terminal.txt

5985879e3c

Skip runtime/doc/indent.txt: not ported yet

Co-authored-by: h_east <h.east.727@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
2023-10-26 06:41:54 +08:00
glepnir
ae4ca4edf8 feat(complete): support f flag for complete buffer part 2023-10-21 20:06:36 +08:00
zeertzjq
272ef27115
vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)
Problem:  [security] use-after-free with wildmenu
Solution: properly clean up the wildmenu when exiting

Fix wildchar/wildmenu/pum memory corruption with special wildchar's

Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a
memory corruption if using wildmenu+pum, or wrong states if only using
wildmenu. This is due to the code only using one single place inside the
cmdline process loop to perform wild menu clean up (by checking
`end_wildmenu`) but there are other odd situations where the loop could
have exited and we need a post-loop clean up just to be sure. If the
clean up was not done you would have a stale popup menu referring to
invalid memory, or if not using popup menu, incorrect status line (if
`laststatus=0`).

For example, if you hit `<Esc>` two times when it's wildchar, there's a
hard-coded behavior to exit command-line as a failsafe for user, and if
you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean
up code would not have hit because of specialized `<C-\>` handling.

Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also
used for 'wildchar'/'wildcharm'. Currently they don't behave properly,
and also have potentially memory unsafe behavior as the logic is
currently not accounting for this situation and try to do both.
(Previous patch that addressed this: vim/vim#11677)

Also, correctly document Escape key behavior (double-hit it to escape)
in wildchar docs as it's previously undocumented.

In addition, block known invalid chars to be set in `wildchar` option,
such as Ctrl-C and `<CR>`. This is just to make it clear to the user
they shouldn't be set, and is not required for this bug fix.

closes: vim/vim#13361

8f4fb007e4

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-17 22:43:42 +08:00
zeertzjq
e5a424d78e
vim-patch:9.0.2030: no max callback recursion limit (#25655)
Problem:  no max callback recursion limit
Solution: bail out, if max call recursion for callback functions
          has been reached.

This checks the 'maxfuncdepth' setting and throws E169 when a callback
function recursively calls itself.

closes: vim/vim#13337
closes: vim/vim#13339

47510f3d65

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-10-15 17:02:17 +08:00
zeertzjq
aa62579a68
docs: restore accidentally removed line in :h 'ignorecase' (#25651) 2023-10-15 09:05:27 +08:00
zeertzjq
20dacacf37
vim-patch:2bbd0d30eebd (#25637)
runtime(doc): Improve command-line completion docs (vim/vim#13331)

* Improve command-line completion docs

Add more details about 'ignorecase' and its effect on cmdline
completion.

Make sure keys used in wildmenu are properly documented and linked in the
keys' documentation entries, and in `:h index` for proper
cross-referencing, as wildmenu popup is slightly different from
insert-mode popup menu.

* Fix docs typos

2bbd0d30ee

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-14 19:28:41 +08:00
zeertzjq
c40a1c0f41
vim-patch:9.0.2009: cmdline-completion for comma-separated options wrong (#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

54844857fd

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-10 09:15:21 +08:00
zeertzjq
f5eabaa940
fix(path): restore space separation in 'path' (#25571)
Removing this behavior causes more inconsistencies and bugs.
2023-10-10 08:22:32 +08:00
Maria José Solano
c80a3976cb
docs: miscellaneous doc and type fixes (#25554) 2023-10-10 06:34:48 +08:00
Leonardo Mello
1dd700a8d9 fix: gf fails on "foo/bar.txt:1:2" on Windows
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
2023-10-06 12:59:58 +02:00
zeertzjq
19b49b063c vim-patch:20f48d5b2ddb
runtime(doc): mention how to disable folding in diff mode (vim/vim#13242)

20f48d5b2d

Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2023-10-03 06:23:15 +08:00
zeertzjq
f06af5e669 vim-patch:9.0.1958: cannot complete option values
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

900894b09a

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-01 20:00:23 +08:00
zeertzjq
86b7d8a9f5
vim-patch:5277cfaf8afe (#25397)
runtime(doc): mention mouse scrolling in scrollbind-quickadj (vim/vim#13190)

5277cfaf8a
2023-09-28 05:22:09 +08:00
bfredl
c3d1d9445c refactor(options)!: graduate some more shortmess flags
A lot of updated places in the docs were already incorrect since long
since they did not reflect the default behaviour.

"[dos format]" could've been argued being better for discoverability
but that ship has already sailed as it is no longer displayed by default.
2023-09-25 18:23:15 +02:00
Gregory Anders
6fb1e0d499 docs: remove "f" from default 'shortmess' value
The "f" flag was removed in f7da472257.
The value of the "f" flag is no longer listed in the 'shortmess'
description and it cannot be disabled, so having it in the default value
is pointless and confusing.
2023-09-24 09:09:18 -05:00
tj-moody
046c9a83f7
fix(ui): always use stl/stlnc fillchars when drawing statusline (#25267) 2023-09-24 10:49:47 +08:00
bfredl
f7da472257 refactor(options)!: graduate shortmess+=f flag
Not everything needs to be crazy overconfigurable.

Also fixes a warning in latest clang which didn't approve of
the funky math switch statement in  append_arg_number
2023-09-23 18:13:05 +02:00
zeertzjq
f094db0e5c
vim-patch:9.0.1921: not possible to use the jumplist like a stack (#25278)
Problem:  not possible to use the jumplist like a stack
Solution: Add the 'jumpoptions' setting to make the jumplist
          a stack.

Add an option for using jumplist like tag stack

related: vim/vim#7738
closes: vim/vim#13134

ported from NeoVim:

- https://neovim.io/doc/user/motion.html#jumplist-stack
- neovim/neovim@39094b3
- https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior

Based on the feedback in the previous PR, it looks like many people like
this option.

87018255e3

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
2023-09-21 07:37:03 +08:00
Justin M. Keyes
1b55f51d0d
docs: misc #24561
fix #24699
fix #25253
2023-09-20 04:15:23 -07:00
Gregory Anders
2e92065686
docs: replace <pre> with ``` (#25136) 2023-09-14 08:23:01 -05:00
dundargoc
a6e74c1f0a
docs: fix typos and other small fixes (#25005)
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com>
Co-authored-by: XTY <xty@xty.io>
Co-authored-by: Empa <emanuel@empa.xyz>
Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
2023-09-14 12:05:27 +08:00
zeertzjq
4b6023be7c
vim-patch:596ad66d1ddb (#25102)
runtime(doc): documentation updates

This is a collection of various improvements to the help pages

closes vim/vim#12790

596ad66d1d

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Houl <anwoku@yahoo.de>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
2023-09-12 07:37:05 +08:00
zeertzjq
b1cfb299df
docs: various clarifications (#24876) 2023-08-26 08:35:05 +08:00
zeertzjq
0ba27bb51d vim-patch:9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
         different than other global-local options
Solution: Make it behave consistent for all global-local options

It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'

So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.

Add a few tests to make sure all global-local window options behave
similar

closes: vim/vim#12956
closes: vim/vim#12643

4a8eb6e7a9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-23 18:24:14 +08:00
Justin M. Keyes
1d81d7a268
feat(defaults): treat "•" as a list item prefix #24623
Problem:
Nvim docs use "•" as a list item prefix but `gw{motion}` doesn't format
such lists by default.

Solution:
Change the 'comments' option to include "fb:•" by default.
2023-08-09 15:33:53 -07:00