aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r--src/nvim/spell.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 9ed421c8a0..013cc1e594 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -634,7 +634,7 @@ static void find_word(matchinf_T *mip, int mode)
if (byts[arridx] == 0) {
if (endidxcnt == MAXWLEN) {
// Must be a corrupted spell file.
- EMSG(_(e_format));
+ emsg(_(e_format));
return;
}
endlen[endidxcnt] = wlen;
@@ -1386,7 +1386,7 @@ static 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)) {
- EMSG(_(e_no_spell));
+ emsg(_(e_no_spell));
return true;
}
return false;
@@ -1758,7 +1758,8 @@ void slang_free(slang_T *lp)
}
/// Frees a salitem_T
-static void free_salitem(salitem_T *smp) {
+static void free_salitem(salitem_T *smp)
+{
xfree(smp->sm_lead);
// Don't free sm_oneof and sm_rules, they point into sm_lead.
xfree(smp->sm_to);
@@ -1768,7 +1769,8 @@ static void free_salitem(salitem_T *smp) {
}
/// Frees a fromto_T
-static void free_fromto(fromto_T *ftp) {
+static void free_fromto(fromto_T *ftp)
+{
xfree(ftp->ft_from);
xfree(ftp->ft_to);
}
@@ -2036,7 +2038,7 @@ static int count_syllables(slang_T *slang, const char_u *word)
// Parse 'spelllang' and set w_s->b_langp accordingly.
// Returns NULL if it's OK, an error message otherwise.
-char_u *did_set_spelllang(win_T *wp)
+char *did_set_spelllang(win_T *wp)
{
garray_T ga;
char_u *splp;
@@ -2057,7 +2059,7 @@ char_u *did_set_spelllang(win_T *wp)
bool nobreak = false;
langp_T *lp, *lp2;
static bool recursive = false;
- char_u *ret_msg = NULL;
+ char *ret_msg = NULL;
char_u *spl_copy;
bufref_T bufref;
@@ -2155,8 +2157,7 @@ char_u *did_set_spelllang(win_T *wp)
// SpellFileMissing autocommands may do anything, including
// destroying the buffer we are using...
if (!bufref_valid(&bufref)) {
- ret_msg =
- (char_u *)N_("E797: SpellFileMissing autocommand deleted buffer");
+ ret_msg = N_("E797: SpellFileMissing autocommand deleted buffer");
goto theend;
}
}
@@ -2870,7 +2871,7 @@ void spell_suggest(int count)
}
if (*curwin->w_s->b_p_spl == NUL) {
- EMSG(_(e_no_spell));
+ emsg(_(e_no_spell));
return;
}
@@ -2933,7 +2934,7 @@ void spell_suggest(int count)
true, need_cap, true);
if (GA_EMPTY(&sug.su_ga)) {
- MSG(_("Sorry, no suggestions"));
+ msg(_("Sorry, no suggestions"));
} else if (count > 0) {
if (count > sug.su_ga.ga_len) {
smsg(_("Sorry, only %" PRId64 " suggestions"),
@@ -3149,7 +3150,7 @@ void ex_spellrepall(exarg_T *eap)
linenr_T prev_lnum = 0;
if (repl_from == NULL || repl_to == NULL) {
- EMSG(_("E752: No previous spell replacement"));
+ emsg(_("E752: No previous spell replacement"));
return;
}
addlen = (int)(STRLEN(repl_to) - STRLEN(repl_from));
@@ -3193,7 +3194,7 @@ void ex_spellrepall(exarg_T *eap)
xfree(frompat);
if (sub_nsubs == 0) {
- EMSG2(_("E753: Not found: %s"), repl_from);
+ semsg(_("E753: Not found: %s"), repl_from);
} else {
do_sub_msg(false);
}
@@ -3404,7 +3405,7 @@ static void spell_suggest_file(suginfo_T *su, char_u *fname)
// Open the file.
fd = os_fopen((char *)fname, "r");
if (fd == NULL) {
- EMSG2(_(e_notopen), fname);
+ semsg(_(e_notopen), fname);
return;
}
@@ -3420,7 +3421,6 @@ static void spell_suggest_file(suginfo_T *su, char_u *fname)
if (STRICMP(su->su_badword, line) == 0) {
// Match! Isolate the good word, until CR or NL.
for (len = 0; p[len] >= ' '; ++len) {
- ;
}
p[len] = NUL;
@@ -3813,7 +3813,6 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
if (sp->ts_prefixdepth == PFD_PREFIXTREE) {
// Skip over the NUL bytes, we use them later.
for (n = 0; n < len && byts[arridx + n] == 0; ++n) {
- ;
}
sp->ts_curi += n;
@@ -3888,7 +3887,6 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
n = stack[sp->ts_prefixdepth].ts_arridx;
len = pbyts[n++];
for (c = 0; c < len && pbyts[n + c] == 0; ++c) {
- ;
}
if (c > 0) {
c = valid_word_prefix(c, n, flags,