From 75adfefc85bcf0d62d2c0f51a951e6003b595cea Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Mon, 18 Jul 2022 14:21:40 +0200 Subject: feat(extmarks,ts,spell): full support for spelling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 Co-authored-by: Björn Linse --- src/nvim/decoration.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/decoration.h') diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 8f28442d41..bdbfd72a81 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -46,6 +46,7 @@ struct Decoration { bool hl_eol; bool virt_lines_above; bool conceal; + bool spell; // TODO(bfredl): style, etc DecorPriority priority; int col; // fixed col value, like win_col @@ -61,8 +62,8 @@ struct Decoration { bool ui_watched; // watched for win_extmark }; #define DECORATION_INIT { KV_INITIAL_VALUE, KV_INITIAL_VALUE, 0, kVTEndOfLine, \ - kHlModeUnknown, false, false, false, false, DECOR_PRIORITY_BASE, \ - 0, 0, NULL, 0, 0, 0, 0, 0, false } + kHlModeUnknown, false, false, false, false, false, \ + DECOR_PRIORITY_BASE, 0, 0, NULL, 0, 0, 0, 0, 0, false } typedef struct { int start_row; @@ -90,6 +91,8 @@ typedef struct { bool conceal; int conceal_char; int conceal_attr; + + bool spell; } DecorState; EXTERN DecorState decor_state INIT(= { 0 }); -- cgit From 1af4bd04f9ad157edbfea30642250e854c5cb5d2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 6 Nov 2022 18:59:43 +0800 Subject: feat(ui): add support to display a title in the border of a float (#20184) add "title" and "title_pos" keys to win config dict. --- src/nvim/decoration.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/decoration.h') diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index bdbfd72a81..9ba621d7a4 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -28,7 +28,6 @@ typedef enum { EXTERN const char *const hl_mode_str[] INIT(= { "", "replace", "combine", "blend" }); -typedef kvec_t(VirtTextChunk) VirtText; #define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE) typedef kvec_t(struct virt_line { VirtText line; bool left_col; }) VirtLines; -- cgit From 7e6d785d19926714615758e75c4d43e856d13a6f Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Tue, 13 Sep 2022 09:44:24 +0200 Subject: feat(extmarks): allow preventing spellchecking with spell = false --- src/nvim/decoration.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/decoration.h') diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 9ba621d7a4..8f016c103b 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -45,7 +45,7 @@ struct Decoration { bool hl_eol; bool virt_lines_above; bool conceal; - bool spell; + TriState spell; // TODO(bfredl): style, etc DecorPriority priority; int col; // fixed col value, like win_col @@ -61,7 +61,7 @@ struct Decoration { bool ui_watched; // watched for win_extmark }; #define DECORATION_INIT { KV_INITIAL_VALUE, KV_INITIAL_VALUE, 0, kVTEndOfLine, \ - kHlModeUnknown, false, false, false, false, false, \ + kHlModeUnknown, false, false, false, false, kNone, \ DECOR_PRIORITY_BASE, 0, 0, NULL, 0, 0, 0, 0, 0, false } typedef struct { @@ -91,7 +91,7 @@ typedef struct { int conceal_char; int conceal_attr; - bool spell; + TriState spell; } DecorState; EXTERN DecorState decor_state INIT(= { 0 }); -- cgit From 66360675cf4d091b7460e4a8e1435c13216c1929 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 11 Sep 2022 17:12:44 +0200 Subject: build: allow IWYU to fix includes for all .c files Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers. --- src/nvim/decoration.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/decoration.h') diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 8f016c103b..cee1eb2f94 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -1,9 +1,17 @@ #ifndef NVIM_DECORATION_H #define NVIM_DECORATION_H +#include +#include +#include + +#include "klib/kvec.h" #include "nvim/buffer_defs.h" #include "nvim/extmark_defs.h" +#include "nvim/macros.h" +#include "nvim/marktree.h" #include "nvim/pos.h" +#include "nvim/types.h" // actual Decoration data is in extmark_defs.h -- cgit From 8a4285d5637c146a0ae606918a8e77063c6a5f0d Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 18 Jan 2023 14:17:11 +0100 Subject: refactor: replace char_u with char 24 (#21823) refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/decoration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/decoration.h') diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index cee1eb2f94..c9ec8ede7f 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -58,7 +58,7 @@ struct Decoration { DecorPriority priority; int col; // fixed col value, like win_col int virt_text_width; // width of virt_text - char_u *sign_text; + char *sign_text; int sign_hl_id; int number_hl_id; int line_hl_id; -- cgit