aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spell.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-25 18:01:06 +0800
committerGitHub <noreply@github.com>2023-05-25 18:01:06 +0800
commitaa9d46b6724cf3454aca602e64350856827c3ab8 (patch)
tree1c95080c85ac0df1b6930aa82f8aeb9476ff7583 /src/nvim/spell.c
parentebb10d624825468c1f75bd14725cce500974b673 (diff)
parent50efdd6ccf1891392c048b92da5e5d123a30ff26 (diff)
downloadrneovim-aa9d46b6724cf3454aca602e64350856827c3ab8.tar.gz
rneovim-aa9d46b6724cf3454aca602e64350856827c3ab8.tar.bz2
rneovim-aa9d46b6724cf3454aca602e64350856827c3ab8.zip
Merge pull request #23744 from luukvbaal/spell
vim-patch:9.0.{0175,0590,0608,0664}
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r--src/nvim/spell.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 84875261f1..498bd56b9e 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -1189,11 +1189,19 @@ bool spell_valid_case(int wordflags, int treeflags)
|| (wordflags & WF_ONECAP) != 0));
}
-// Returns true if spell checking is not enabled.
+/// Return true if spell checking is enabled for "wp".
+bool spell_check_window(win_T *wp)
+{
+ return wp->w_p_spell
+ && *wp->w_s->b_p_spl != NUL
+ && wp->w_s->b_langp.ga_len > 0
+ && *(char **)(wp->w_s->b_langp.ga_data) != NULL;
+}
+
+/// Return true and give an error if spell checking is not enabled.
bool no_spell_checking(win_T *wp)
{
- if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL
- || GA_EMPTY(&wp->w_s->b_langp)) {
+ if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL || GA_EMPTY(&wp->w_s->b_langp)) {
emsg(_(e_no_spell));
return true;
}