Dropping two superfluous checks for restricted mode, and
two superfluous checks for the definition of a formatter. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5325 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
bff6a905af
commit
0b15c42a5c
|
@ -2,6 +2,11 @@
|
||||||
* src/text.c (do_formatter), src/nano.c (allow_pending_sigwinch):
|
* src/text.c (do_formatter), src/nano.c (allow_pending_sigwinch):
|
||||||
Reenable SIGWINCH-es also when invoking the formatter fails, and
|
Reenable SIGWINCH-es also when invoking the formatter fails, and
|
||||||
correct some comments.
|
correct some comments.
|
||||||
|
* src/text.c (do_linter, do_formatter): In restricted mode, no nanorc
|
||||||
|
files are read, so no linter or formatter will be defined, so these
|
||||||
|
routines will never be called. Also, the formatter will only ever
|
||||||
|
be called when a syntax applies to the current file and this syntax
|
||||||
|
defines a formatter, so there is no need to check this again.
|
||||||
|
|
||||||
2015-07-26 Benno Schulenberg <bensberg@justemail.net>
|
2015-07-26 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/search.c (do_replace_loop): When doing regex replacements, find
|
* src/search.c (do_replace_loop): When doing regex replacements, find
|
||||||
|
|
17
src/text.c
17
src/text.c
|
@ -2908,11 +2908,6 @@ void do_linter(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ISSET(RESTRICTED)) {
|
|
||||||
nano_disabled_msg();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (openfile->modified) {
|
if (openfile->modified) {
|
||||||
int i = do_yesno_prompt(FALSE, _("Save modified buffer before linting?"));
|
int i = do_yesno_prompt(FALSE, _("Save modified buffer before linting?"));
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
|
@ -3223,18 +3218,6 @@ void do_formatter(void)
|
||||||
static char **formatargs = NULL;
|
static char **formatargs = NULL;
|
||||||
char *finalstatus = NULL;
|
char *finalstatus = NULL;
|
||||||
|
|
||||||
/* Check whether we're using syntax highlighting
|
|
||||||
* and the formatter option is set. */
|
|
||||||
if (openfile->syntax == NULL || openfile->syntax->formatter == NULL) {
|
|
||||||
statusbar(_("Error: no formatter defined"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ISSET(RESTRICTED)) {
|
|
||||||
nano_disabled_msg();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (temp == NULL) {
|
if (temp == NULL) {
|
||||||
statusbar(_("Error writing temp file: %s"), strerror(errno));
|
statusbar(_("Error writing temp file: %s"), strerror(errno));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue