Commit Graph

35 Commits

Author SHA1 Message Date
Thomas Vigouroux
7e6d785d19 feat(extmarks): allow preventing spellchecking with spell = false 2022-11-12 10:19:01 +00:00
dundargoc
1887d8d7d0
docs: fix typos (#20724)
Co-authored-by: Marco Lehmann <m99@posteo.de>
2022-10-23 09:45:39 +08:00
Lewis Russell
2921de6a96 fix(decoration): call providers in win_update() earlier
Fixes #20651
2022-10-15 18:06:59 +01:00
Lewis Russell
546b294e74 fix(decoration): redraw correctly when re-using ids
00cfc1d (from #20249) reduced the amount of unnecessary redraws. This
surfaced an issue where if and extmark with a specific ID is
repositioned to a different row, the decorations from the old row were
not redrawn and removed. This change fixes that by redrawing the
old row.
2022-10-14 13:03:03 +01:00
bfredl
5399513fd0
Merge pull request #20343 from zeertzjq/virt-lines-vcol
fix(extmarks): make virt_lines always start at 0 virtcol
2022-09-30 10:15:51 +02:00
zeertzjq
7e98821e56
fix(ui): redraw end of buffer if last line is modified (#20354) 2022-09-27 06:33:48 +08:00
zeertzjq
fded344f38 fix(extmarks): make virt_lines always start at 0 virtcol 2022-09-25 21:44:01 +08:00
Christian Clason
67df3347fd
vim-patch:9712ff1288f9 (#20240)
Update runtime files
9712ff1288
2022-09-18 15:20:20 +02:00
Thomas Vigouroux
75adfefc85 feat(extmarks,ts,spell): full support for spelling
- Added 'spell' option to extmarks:

  Extmarks with this set will have the region spellchecked.

- Added 'noplainbuffer' option to 'spelloptions':

  This is used to tell Neovim not to spellcheck the buffer. The old
  behaviour was to spell check the whole buffer unless :syntax was set.

- Added spelling support to the treesitter highlighter:

  @spell captures in highlights.scm are used to define regions which
  should be spell checked.

- Added support for navigating spell errors for extmarks:

  Works for both ephemeral and static extmarks

- Added '_on_spell_nav' callback for decoration providers:

  Since ephemeral callbacks are only drawn for the visible screen,
  providers must implement this callback to instruct Neovim which
  regions in the buffer need can be spell checked.

  The callback takes a start position and an end position.

  Note: this callback is subject to change hence the _ prefix.

- Added spell captures for built-in support languages

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-09-06 10:14:11 +01:00
bfredl
d879331b0d feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces
- check for EOF in screen tests (to indicate a likely crash)
2022-08-17 16:20:39 +02:00
Lewis Russell
a27756cc24
fix(signs): priority of extmark signs (#19718) 2022-08-11 17:26:17 +01:00
ii14
a195dc7c83
fix(decorations): nvim_buf_set_extmark breaks conceal #19010
Closes #19007

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-19 10:33:54 -07:00
zeertzjq
19e80738e0
fix(screen): restart win_update() if a decor provider changes signcols (#18768) 2022-06-01 22:53:29 +08:00
dundargoc
e63e5d1dbd
docs: typo fixes (#17859)
Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com>
Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com>
Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: rwxd <rwxd@pm.me>
Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
2022-04-15 12:35:06 +02:00
zeertzjq
ba257d74b1
fix(decorations): do not put empty virt_text (#17872) 2022-03-29 19:56:45 +08:00
zeertzjq
7735163652
fix(screen): do not do syntax highlighting at filler or folded lines (#17818) 2022-03-23 07:07:34 +08:00
Lewis Russell
2ab2af598e fix(extmarks): fix signs
Don't add sign extmarks to state->active. Instead when drawing signs,
perform a full line scan for sign marks. This allows decor_redraw_line
to be moved back inside the `!number_only` block in screen.c, which
prevents decor scans when redrawing the number column when
'relativenumber' is set.

Fixes: #17638
2022-03-08 22:08:57 +00:00
Lewis Russell
30e4cc3b3f feat(decorations): support signs
Add the following options to extmarks:
  - sign_text
  - sign_hl_group
  - number_hl_group
  - line_hl_group
  - cursorline_hl_group

Note: ranges are unsupported and decorations are only applied to
start_row
2022-03-05 16:51:59 +00:00
zeertzjq
b326bf5f41 fix(screen): do not draw filler lines post eof if already at last row 2021-12-07 23:19:56 +08:00
Björn Linse
995dbd2ca6 fix(extmark): fix missing virt_lines when using id param of set_extmark 2021-11-01 22:57:33 +01:00
Björn Linse
8d7816cf27 feat(decorations): support more than one virt_lines block 2021-10-23 14:17:09 +02:00
Björn Linse
392c658d4d feat(decorations): support virtual lines (for now: only one block at a time) 2021-09-26 12:19:54 +02:00
Björn Linse
a4d81a8002 refactor(decorations): merge the two different code paths for virt_text
test(bufhl): CHANGE of tested behaviour (inb4 a proper priority mechanism)
test(decoration): change of test; previous behavior was buggy (ghost
buffer text)
2021-07-29 20:34:42 +02:00
Björn Linse
1495d36d63 feat(decorations): allow more than one stacked highlight in a virt_text 2021-07-29 20:34:20 +02:00
Björn Linse
cd353aa824 fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
fixes #15212
2021-07-29 12:59:56 +02:00
James McCoy
833a6fcb60
coverity/331378: Fix inserting new decor provider
Since the providers are ordered by ns_id, inserting a new provider may
require shifting existing providers around to maintain this ordering.

When this happens, we need to allocate a new element at the end of the
vector and then shift the larger elements to the right.  Rather than
iterating (incorrectly) with a loop and copying each item, use memmove
to copy the entire block.
2021-05-06 18:56:56 -04:00
Björn Linse
0865f1238f decorations: right_align and win_col 2021-05-01 11:48:04 +02:00
Björn Linse
7b488314d0 decoration: Clean up duplicate Decoration attributes + bonus hl_eol flag 2021-04-14 13:04:33 +02:00
Björn Linse
06c191848b decorations: memory error with ephemeral virt_text 2021-03-23 13:58:18 +01:00
Björn Linse
bb6d2c9b7c api: destabilize nvim_set_hl_ns
The sematics and signature of this API is going to change, but we
don't wanna delay 0.5 for it. Mark API as unstable for now.
2021-03-15 09:58:39 +01:00
Björn Linse
425bc438ae decorations: add additional styling of virt_text overlays 2021-03-10 12:11:05 +01:00
Björn Linse
4781333a7a decorations: allow virt_text overlay at any column 2021-02-22 09:40:06 +01:00
Björn Linse
a4986ab47f decorations: allow nvim_set_hl to break existing links
also add `default` flag to NOT break existing links/defs
2020-11-21 11:24:14 +01:00
Björn Linse
c146eddc8b api: add API for themes
co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function)

orange is sus??

NOVEMBER DAWN

erase the lie that is redraw_later()
2020-11-01 19:14:56 +01:00
Björn Linse
0b615dae07 api: multiple decoration providers at once 2020-10-10 15:16:45 +02:00