diff options
-rw-r--r-- | src/nvim/regexp_nfa.c | 40 | ||||
-rw-r--r-- | src/nvim/spellfile.c | 6 |
2 files changed, 26 insertions, 20 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 95dc17f57f..3b905f5efc 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2038,9 +2038,10 @@ static int nfa_regpiece(void) break; } /* end switch */ - if (re_multi_type(peekchr()) != NOT_MULTI) - /* Can't have a multi follow a multi. */ + if (re_multi_type(peekchr()) != NOT_MULTI) { + // Can't have a multi follow a multi. EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi")); + } return OK; } @@ -2453,7 +2454,8 @@ static void nfa_set_code(int c) } static FILE *log_fd; -static char_u e_log_open_failed[] = N_("Could not open temporary log file for writing, displaying on stderr... "); +static char_u e_log_open_failed[] = N_( + "Could not open temporary log file for writing, displaying on stderr... "); /* * Print the postfix notation of the current regexp. @@ -2466,10 +2468,11 @@ static void nfa_postfix_dump(char_u *expr, int retval) f = fopen(NFA_REGEXP_DUMP_LOG, "a"); if (f != NULL) { fprintf(f, "\n-------------------------\n"); - if (retval == FAIL) + if (retval == FAIL) { fprintf(f, ">>> NFA engine failed... \n"); - else if (retval == OK) + } else if (retval == OK) { fprintf(f, ">>> NFA engine succeeded !\n"); + } fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr); for (p = post_start; *p && p < post_ptr; p++) { nfa_set_code(*p); @@ -5067,8 +5070,9 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, fprintf(log_fd, "------------------------------------------\n"); fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); fprintf(log_fd, - ">>> Advanced one character... Current char is %c (code %d) \n", curc, - (int)curc); + ">>> Advanced one character... Current char is %c (code %d) \n", + curc, + (int)curc); fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); { int i; @@ -5100,16 +5104,17 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, { int col; - if (t->subs.norm.in_use <= 0) + if (t->subs.norm.in_use <= 0) { col = -1; - else if (REG_MULTI) + } else if (REG_MULTI) { col = t->subs.norm.list.multi[0].start_col; - else + } else { col = (int)(t->subs.norm.list.line[0].start - regline); + } nfa_set_code(t->state->c); fprintf(log_fd, "(%d) char %d %s (start col %d)%s... \n", - abs(t->state->id), (int)t->state->c, code, col, - pim_info(&t->pim)); + abs(t->state->id), (int)t->state->c, code, col, + pim_info(&t->pim)); } #endif @@ -6263,8 +6268,9 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col, proftime_T *tm) nfa_print_state(f, start); fprintf(f, "\n\n"); fclose(f); - } else + } else { EMSG("Could not open temporary log file for writing"); + } #endif clear_sub(&subs.norm); @@ -6490,10 +6496,10 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags) FILE *f = fopen(NFA_REGEXP_RUN_LOG, "a"); if (f != NULL) { - fprintf( - f, - "\n*****************************\n\n\n\n\tCompiling regexp \"%s\"... hold on !\n", - expr); + fprintf(f, + "\n*****************************\n\n\n\n\t" + "Compiling regexp \"%s\"... hold on !\n", + expr); fclose(f); } } diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index ecf3a52fd3..b8774bd680 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -3032,7 +3032,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) hash_init(&ht); vim_snprintf((char *)IObuff, IOSIZE, - _("Reading dictionary file %s..."), fname); + _("Reading dictionary file %s..."), fname); spell_message(spin, IObuff); // start with a message for the first line @@ -4998,7 +4998,7 @@ static void sug_write(spellinfo_T *spin, char_u *fname) } vim_snprintf((char *)IObuff, IOSIZE, - _("Writing suggestion file %s..."), fname); + _("Writing suggestion file %s..."), fname); spell_message(spin, IObuff); // <SUGHEADER>: <fileID> <versionnr> <timestamp> @@ -5234,7 +5234,7 @@ mkspell ( if (!error && !got_int) { // Write the info in the spell file. vim_snprintf((char *)IObuff, IOSIZE, - _("Writing spell file %s..."), wfname); + _("Writing spell file %s..."), wfname); spell_message(&spin, IObuff); error = write_vim_spell(&spin, wfname) == FAIL; |