aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spell.c
diff options
context:
space:
mode:
authorThomas Vigouroux <thomas.vigouroux@protonmail.com>2023-07-19 17:56:25 +0200
committerGitHub <noreply@github.com>2023-07-19 16:56:25 +0100
commit30a5c28c8740d2e07c20cb58822b7d7aa489b728 (patch)
tree6dced02f6777be52feb94f2dc1d7537a59950500 /src/nvim/spell.c
parent2f22ed6a00db10c4852a8fa232b8782f8b6a6646 (diff)
downloadrneovim-30a5c28c8740d2e07c20cb58822b7d7aa489b728.tar.gz
rneovim-30a5c28c8740d2e07c20cb58822b7d7aa489b728.tar.bz2
rneovim-30a5c28c8740d2e07c20cb58822b7d7aa489b728.zip
feat(decoration_provider): log errors as error messages
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r--src/nvim/spell.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index c8a7bb2622..2ae0863a5c 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -1214,11 +1214,10 @@ static void decor_spell_nav_start(win_T *wp)
decor_redraw_reset(wp, &decor_state);
}
-static TriState decor_spell_nav_col(win_T *wp, linenr_T lnum, linenr_T *decor_lnum, int col,
- char **decor_error)
+static TriState decor_spell_nav_col(win_T *wp, linenr_T lnum, linenr_T *decor_lnum, int col)
{
if (*decor_lnum != lnum) {
- decor_providers_invoke_spell(wp, lnum - 1, col, lnum - 1, -1, decor_error);
+ decor_providers_invoke_spell(wp, lnum - 1, col, lnum - 1, -1);
decor_redraw_line(wp, lnum - 1, &decor_state);
*decor_lnum = lnum;
}
@@ -1277,7 +1276,6 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att
linenr_T lnum = wp->w_cursor.lnum;
clearpos(&found_pos);
- char *decor_error = NULL;
// Ephemeral extmarks are currently stored in the global decor_state.
// When looking for spell errors, we need to:
// - temporarily reset decor_state
@@ -1362,7 +1360,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att
bool no_plain_buffer = (wp->w_s->b_p_spo_flags & SPO_NPBUFFER) != 0;
bool can_spell = !no_plain_buffer;
- switch (decor_spell_nav_col(wp, lnum, &decor_lnum, col, &decor_error)) {
+ switch (decor_spell_nav_col(wp, lnum, &decor_lnum, col)) {
case kTrue:
can_spell = true; break;
case kFalse:
@@ -1488,7 +1486,6 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att
theend:
decor_state_free(&decor_state);
- xfree(decor_error);
decor_state = saved_decor_start;
xfree(buf);
return ret;