feedback: say it when spell check or manipulation did not change anything
parent
34170611d3
commit
d2fb371fe2
24
src/text.c
24
src/text.c
|
@ -2528,6 +2528,7 @@ const char *do_int_speller(const char *tempfile_name)
|
||||||
return _("Error invoking \"spell\"");
|
return _("Error invoking \"spell\"");
|
||||||
|
|
||||||
/* When all went okay. */
|
/* When all went okay. */
|
||||||
|
statusbar(_("Finished checking spelling"));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
close_pipes_and_exit:
|
close_pipes_and_exit:
|
||||||
|
@ -2554,6 +2555,7 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling)
|
||||||
static char **arguments = NULL;
|
static char **arguments = NULL;
|
||||||
pid_t thepid;
|
pid_t thepid;
|
||||||
int program_status;
|
int program_status;
|
||||||
|
bool replaced = FALSE;
|
||||||
|
|
||||||
/* Get the timestamp and the size of the temporary file. */
|
/* Get the timestamp and the size of the temporary file. */
|
||||||
stat(tempfile_name, &fileinfo);
|
stat(tempfile_name, &fileinfo);
|
||||||
|
@ -2597,10 +2599,13 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling)
|
||||||
/* Stat the temporary file again. */
|
/* Stat the temporary file again. */
|
||||||
stat(tempfile_name, &fileinfo);
|
stat(tempfile_name, &fileinfo);
|
||||||
|
|
||||||
/* Read in the temporary file only when it changed. */
|
/* When the temporary file wasn't touched, say so and leave. */
|
||||||
if ((long)fileinfo.st_mtim.tv_sec != timestamp_sec ||
|
if ((long)fileinfo.st_mtim.tv_sec == timestamp_sec &&
|
||||||
(long)fileinfo.st_mtim.tv_nsec != timestamp_nsec) {
|
(long)fileinfo.st_mtim.tv_nsec == timestamp_nsec) {
|
||||||
bool replaced = FALSE;
|
statusbar(_("Nothing changed"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Replace the marked text (or entire text) with the corrected text. */
|
/* Replace the marked text (or entire text) with the corrected text. */
|
||||||
if (openfile->mark) {
|
if (openfile->mark) {
|
||||||
|
@ -2634,7 +2639,11 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling)
|
||||||
#endif
|
#endif
|
||||||
openfile->placewewant = pww_save;
|
openfile->placewewant = pww_save;
|
||||||
adjust_viewport(STATIONARY);
|
adjust_viewport(STATIONARY);
|
||||||
}
|
|
||||||
|
if (spelling)
|
||||||
|
statusbar(_("Finished checking spelling"));
|
||||||
|
else
|
||||||
|
statusbar(_("Buffer has been processed"));
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -2702,8 +2711,7 @@ void do_spell(void)
|
||||||
statusline(ALERT, result_msg);
|
statusline(ALERT, result_msg);
|
||||||
else
|
else
|
||||||
statusline(ALERT, _("%s: %s"), result_msg, strerror(errno));
|
statusline(ALERT, _("%s: %s"), result_msg, strerror(errno));
|
||||||
} else
|
}
|
||||||
statusbar(_("Finished checking spelling"));
|
|
||||||
}
|
}
|
||||||
#endif /* ENABLE_SPELLER */
|
#endif /* ENABLE_SPELLER */
|
||||||
|
|
||||||
|
@ -3084,8 +3092,6 @@ void do_fixer(void)
|
||||||
|
|
||||||
if (result_msg != NULL)
|
if (result_msg != NULL)
|
||||||
statusline(ALERT, result_msg);
|
statusline(ALERT, result_msg);
|
||||||
else
|
|
||||||
statusbar(_("Buffer has been processed"));
|
|
||||||
|
|
||||||
unlink(temp_name);
|
unlink(temp_name);
|
||||||
free(temp_name);
|
free(temp_name);
|
||||||
|
|
Loading…
Reference in New Issue