Merge remote-tracking branch 'upstream/master' into line-folding

This commit is contained in:
rexy712 2024-10-06 17:43:50 -07:00
commit 9cfda05f71
67 changed files with 14709 additions and 16402 deletions

31
AUTHORS
View File

@ -13,16 +13,15 @@ Benno Schulenberg <bensberg@telfort.nl>
Current maintainer. Current maintainer.
David Lawrence Ramsey <pooka109@gmail.com> David Lawrence Ramsey <pooka109@gmail.com>
* Former stable series maintainer. Multiple buffer support, * Multiple-buffer support, operating-dir option (-o), bug fixes
operating dir (-o) option, bug fixes for display routines, for display routines, wrapping code, spelling fixes, parts of
wrapping code, spelling fixes, constantshow mode, parts of UTF-8 support, softwrap overhaul, constantshow mode, undoable
UTF-8 support, softwrap overhaul, undoable (un)indentations, indentations, undoable justifications, justifiable regions,
undoable justifications, justifiable regions, and numerous and numerous other fixes. Former stable-series maintainer.
other fixes.
Jordi Mallach <jordi@gnu.org> Jordi Mallach <jordi@gnu.org>
* Debian package maintainer, fellow bug squasher. * Debian package maintainer, fellow bug squasher, translator
* Internationalization support head, ca.po maintainer. for Catalan. Former head of internationalization support.
Adam Rogoyski <rogoyski@cs.utexas.edu> Adam Rogoyski <rogoyski@cs.utexas.edu>
* New write_file() function, read_file() optimization, mouse * New write_file() function, read_file() optimization, mouse
@ -35,9 +34,9 @@ Robert Siemborski <rjs3@andrew.cmu.edu>
new edit display routines. new edit display routines.
Rocco Corsi <rocco.corsi@sympatico.ca> Rocco Corsi <rocco.corsi@sympatico.ca>
* Internal spelling code, many optimizations and bug fixes for * Internal spelling code, many optimizations and bug fixes
findnextstr() and search-related functions, various display for findnextstr() and search-related functions, various
and file handling fixes. display and file-handling fixes.
David Benbennick <dbenbenn@math.cornell.edu> David Benbennick <dbenbenn@math.cornell.edu>
* Wrap and justify bugfixes/enhancements, new color syntax * Wrap and justify bugfixes/enhancements, new color syntax
@ -45,11 +44,11 @@ David Benbennick <dbenbenn@math.cornell.edu>
miscellaneous fixes. miscellaneous fixes.
Mike Frysinger <vapier@gentoo.org> Mike Frysinger <vapier@gentoo.org>
* Gentoo package maintainer. Whitespace display mode, * Whitespace display mode, --enable-utf8/--disable-utf8 configure
--enable-utf8/--disable-utf8 configure options for ncurses, options for ncurses, many new color regexes and improvements to
many new color regexes and improvements to existing color existing ones in syntax/*.nanorc, the move from svn to git, the
regexes in syntax/*.nanorc, the move from svn to git, the conversion to gnulib, and miscellaneous bug fixes. Former
conversion to gnulib, and miscellaneous bug fixes. Gentoo package maintainer.
Mark Majeres <mark@engine12.com> Mark Majeres <mark@engine12.com>
* A functional undo/redo system, and coloring nano's interface. * A functional undo/redo system, and coloring nano's interface.

1760
ChangeLog

File diff suppressed because it is too large Load Diff

5
NEWS
View File

@ -1,3 +1,8 @@
2024.09.05 - GNU nano 8.2 "Charlotte will climb walls!"
• At a Yes-No prompt, beside Y and the localized initial for "Yes",
also ^Y is accepted. Similarly, ^N for "No", and ^A for "All".
• A text-highlighting bug with Alt+Home/Alt+End is fixed.
2024.07.12 - GNU nano 8.1 "de dag van de bitterkoekjespudding" 2024.07.12 - GNU nano 8.1 "de dag van de bitterkoekjespudding"
• The idiom `nano filename:linenumber` is understood only when the • The idiom `nano filename:linenumber` is understood only when the
option --colonparsing (or 'set colonparsing') is used. option --colonparsing (or 'set colonparsing') is used.

2
README
View File

@ -15,7 +15,7 @@ Appearance
In rough ASCII graphics, this is what nano's screen looks like: In rough ASCII graphics, this is what nano's screen looks like:
____________________________________________________________________ ____________________________________________________________________
| GNU nano 8.1 filename Modified | | GNU nano 8.2 filename Modified |
-------------------------------------------------------------------- --------------------------------------------------------------------
| This is the text window, displaying the contents of a 'buffer', | | This is the text window, displaying the contents of a 'buffer', |
| the contents of the file you are editing. | | the contents of the file you are editing. |

View File

@ -2,7 +2,7 @@
# Generate configure & friends for GIT users. # Generate configure & friends for GIT users.
gnulib_url="git://git.sv.gnu.org/gnulib.git" gnulib_url="git://git.sv.gnu.org/gnulib.git"
gnulib_hash="0ba13435a9362bec0ff5fd0830907b9fac723e41" gnulib_hash="6db3edf95439f7087e60fda5e79e2c12507a6ad4"
modules=" modules="
canonicalize-lgpl canonicalize-lgpl

View File

@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see https://www.gnu.org/licenses/. # along with this program. If not, see https://www.gnu.org/licenses/.
AC_INIT([GNU nano], [8.1], [nano-devel@gnu.org], [nano]) AC_INIT([GNU nano], [8.2], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c]) AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_HOST AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.14]) AM_INIT_AUTOMAKE([1.14])

View File

@ -92,7 +92,7 @@
<h3 id="1.3">1.3. Why the name change from TIP?</h3> <h3 id="1.3">1.3. Why the name change from TIP?</h3>
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program &quot;establishes a full duplex terminal connection to a remote host&quot;, and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote> <blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program &quot;establishes a full duplex terminal connection to a remote host&quot;, and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote>
<h3 id="1.4">1.4. What is the current version of nano?</h3> <h3 id="1.4">1.4. What is the current version of nano?</h3>
<blockquote><p>The current version of nano <i>should</i> be <b>8.1</b>. Of course, you should always check the <a href="https://nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote> <blockquote><p>The current version of nano <i>should</i> be <b>8.2</b>. Of course, you should always check the <a href="https://nano-editor.org/">nano homepage</a> to see what the latest and greatest version is.</p></blockquote>
<h3 id="1.5">1.5. I want to read the man page without having to download the program!</h3> <h3 id="1.5">1.5. I want to read the man page without having to download the program!</h3>
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="https://nano-editor.org/dist/latest/nano.1.html">here</a>.</p></blockquote> <blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="https://nano-editor.org/dist/latest/nano.1.html">here</a>.</p></blockquote>
<hr width="100%"> <hr width="100%">

View File

@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see .\" Documentation License along with this program. If not, see
.\" <https://www.gnu.org/licenses/>. .\" <https://www.gnu.org/licenses/>.
.\" .\"
.TH NANO 1 "version 8.1" "July 2024" .TH NANO 1 "version 8.2" "September 2024"
.SH NAME .SH NAME
nano \- Nano's ANOther text editor, inspired by Pico nano \- Nano's ANOther text editor, inspired by Pico
@ -439,6 +439,9 @@ Suspension is enabled by default, reachable via \fB^T^Z\fR.
(If you want a plain \fB^Z\fR to suspend nano, add (If you want a plain \fB^Z\fR to suspend nano, add
\fBbind ^Z suspend main\fR to your nanorc.) \fBbind ^Z suspend main\fR to your nanorc.)
.sp .sp
At a Yes-No prompt, \fB^Y\fR can be used for "Yes", \fB^N\fR for "No",
and \fB^A\fR for "All". These unlisted bindings work in any locale.
.sp
When you want to copy marked text from \fBnano\fR to the system's clipboard, When you want to copy marked text from \fBnano\fR to the system's clipboard,
see one of the examples in the \fBnanorc\fR(5) man page. see one of the examples in the \fBnanorc\fR(5) man page.
.sp .sp

View File

@ -13,8 +13,8 @@ The complete manual for the GNU nano text editor.
@smallbook @smallbook
@set EDITION 0.8 @set EDITION 0.8
@set VERSION 8.1 @set VERSION 8.2
@set UPDATED July 2024 @set UPDATED September 2024
@dircategory Editors @dircategory Editors
@direntry @direntry
@ -29,7 +29,7 @@ The complete manual for the GNU nano text editor.
@title GNU @command{nano} @title GNU @command{nano}
@subtitle a small and friendly text editor @subtitle a small and friendly text editor
@subtitle version 8.1 @subtitle version 8.2
@author Chris Allegretta @author Chris Allegretta
@ -79,7 +79,7 @@ For suggesting improvements: @email{nano-devel@@gnu.org}
@node Top @node Top
@top @top
This manual documents GNU @command{nano}, version 8.1. This manual documents GNU @command{nano}, version 8.2.
@menu @menu
* Introduction:: * Introduction::

View File

@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see .\" Documentation License along with this program. If not, see
.\" <https://www.gnu.org/licenses/>. .\" <https://www.gnu.org/licenses/>.
.\" .\"
.TH NANORC 5 "version 8.1" "July 2024" .TH NANORC 5 "version 8.2" "September 2024"
.SH NAME .SH NAME
nanorc \- GNU nano's configuration file nanorc \- GNU nano's configuration file

View File

@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see .\" Documentation License along with this program. If not, see
.\" <https://www.gnu.org/licenses/>. .\" <https://www.gnu.org/licenses/>.
.\" .\"
.TH RNANO 1 "version 8.1" "July 2024" .TH RNANO 1 "version 8.2" "September 2024"
.SH NAME .SH NAME
rnano \- a restricted nano rnano \- a restricted nano

View File

@ -249,12 +249,12 @@
## For all details, see 'man nanorc', section SYNTAX HIGHLIGHTING. ## For all details, see 'man nanorc', section SYNTAX HIGHLIGHTING.
## To include most of the existing syntax definitions, you can do: ## To include most of the existing syntax definitions, you can do:
# include "@PKGDATADIR@/*.nanorc" # include @PKGDATADIR@/*.nanorc
## Or you can select just the ones you need. For example: ## Or you can select just the ones you need. For example:
# include "@PKGDATADIR@/html.nanorc" # include @PKGDATADIR@/html.nanorc
# include "@PKGDATADIR@/python.nanorc" # include @PKGDATADIR@/python.nanorc
# include "@PKGDATADIR@/sh.nanorc" # include @PKGDATADIR@/sh.nanorc
## In @PKGDATADIR@/extra/ you can find some syntaxes that are ## In @PKGDATADIR@/extra/ you can find some syntaxes that are
## specific for certain distros or for some less common languages. ## specific for certain distros or for some less common languages.

748
po/bg.po

File diff suppressed because it is too large Load Diff

748
po/ca.po

File diff suppressed because it is too large Load Diff

748
po/cs.po

File diff suppressed because it is too large Load Diff

748
po/da.po

File diff suppressed because it is too large Load Diff

748
po/de.po

File diff suppressed because it is too large Load Diff

748
po/eo.po

File diff suppressed because it is too large Load Diff

752
po/es.po

File diff suppressed because it is too large Load Diff

748
po/eu.po

File diff suppressed because it is too large Load Diff

748
po/fi.po

File diff suppressed because it is too large Load Diff

748
po/fr.po

File diff suppressed because it is too large Load Diff

748
po/ga.po

File diff suppressed because it is too large Load Diff

748
po/gl.po

File diff suppressed because it is too large Load Diff

748
po/hr.po

File diff suppressed because it is too large Load Diff

748
po/hu.po

File diff suppressed because it is too large Load Diff

748
po/id.po

File diff suppressed because it is too large Load Diff

748
po/is.po

File diff suppressed because it is too large Load Diff

748
po/it.po

File diff suppressed because it is too large Load Diff

748
po/ja.po

File diff suppressed because it is too large Load Diff

748
po/ka.po

File diff suppressed because it is too large Load Diff

748
po/ko.po

File diff suppressed because it is too large Load Diff

764
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

748
po/nb.po

File diff suppressed because it is too large Load Diff

748
po/nl.po

File diff suppressed because it is too large Load Diff

748
po/pl.po

File diff suppressed because it is too large Load Diff

748
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

748
po/ro.po

File diff suppressed because it is too large Load Diff

748
po/ru.po

File diff suppressed because it is too large Load Diff

748
po/sk.po

File diff suppressed because it is too large Load Diff

748
po/sl.po

File diff suppressed because it is too large Load Diff

748
po/sq.po

File diff suppressed because it is too large Load Diff

748
po/sr.po

File diff suppressed because it is too large Load Diff

748
po/sv.po

File diff suppressed because it is too large Load Diff

748
po/tr.po

File diff suppressed because it is too large Load Diff

748
po/uk.po

File diff suppressed because it is too large Load Diff

748
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION="8.1" VERSION="8.2"
./configure -C --enable-tiny && make && ./configure -C && ./configure -C --enable-tiny && make && ./configure -C &&

View File

@ -44,7 +44,7 @@ nano_SOURCES = \
winio.c winio.c
nano_LDADD = @LIBINTL@ $(top_builddir)/lib/libgnu.a \ nano_LDADD = @LIBINTL@ $(top_builddir)/lib/libgnu.a \
$(GETRANDOM_LIB) $(LIB_CLOCK_GETTIME) $(LIBTHREAD) $(GETRANDOM_LIB) $(CLOCK_TIME_LIB) $(LIBTHREAD)
install-exec-hook: install-exec-hook:
cd $(DESTDIR)$(bindir) && rm -f rnano && $(LN_S) nano rnano cd $(DESTDIR)$(bindir) && rm -f rnano && $(LN_S) nano rnano

View File

@ -493,7 +493,7 @@ char *browse(char *path)
#endif #endif
function = interpret(kbinput); function = interpret(kbinput);
if (function == full_refresh || function == do_help) { if (function == do_help || function == full_refresh) {
function(); function();
#ifndef NANO_TINY #ifndef NANO_TINY
/* Simulate a terminal resize to force a directory reread, /* Simulate a terminal resize to force a directory reread,
@ -572,8 +572,7 @@ char *browse(char *path)
/* If the given path is relative, join it with the current path. */ /* If the given path is relative, join it with the current path. */
if (*path != '/') { if (*path != '/') {
path = nrealloc(path, strlen(present_path) + path = nrealloc(path, strlen(present_path) + strlen(answer) + 1);
strlen(answer) + 1);
sprintf(path, "%s%s", present_path, answer); sprintf(path, "%s%s", present_path, answer);
} }

View File

@ -2548,9 +2548,7 @@ char **filename_completion(const char *morsel, size_t *num_matches)
if (strncmp(entry->d_name, filename, filenamelen) == 0 && if (strncmp(entry->d_name, filename, filenamelen) == 0 &&
strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, ".") != 0 &&
strcmp(entry->d_name, "..") != 0) { strcmp(entry->d_name, "..") != 0) {
fullname = nrealloc(fullname, strlen(dirname) + fullname = nrealloc(fullname, strlen(dirname) + strlen(entry->d_name) + 1);
strlen(entry->d_name) + 1);
sprintf(fullname, "%s%s", dirname, entry->d_name); sprintf(fullname, "%s%s", dirname, entry->d_name);
#ifdef ENABLE_OPERATINGDIR #ifdef ENABLE_OPERATINGDIR

View File

@ -392,6 +392,7 @@ int keycode_from_string(const char *keystring)
} }
#if defined(ENABLE_EXTRA) && defined(NCURSES_VERSION_PATCH) #if defined(ENABLE_EXTRA) && defined(NCURSES_VERSION_PATCH)
/* Report the version of ncurses that nano is linked against. */
void show_curses_version(void) void show_curses_version(void)
{ {
statusline(INFO, "ncurses-%i.%i, patch %li", NCURSES_VERSION_MAJOR, statusline(INFO, "ncurses-%i.%i, patch %li", NCURSES_VERSION_MAJOR,

View File

@ -486,9 +486,7 @@ void show_help(void)
#endif #endif
function = interpret(kbinput); function = interpret(kbinput);
if (function == full_refresh) { if (ISSET(SHOW_CURSOR) && (function == do_left || function == do_right ||
full_refresh();
} else if (ISSET(SHOW_CURSOR) && (function == do_left || function == do_right ||
function == do_up || function == do_down)) { function == do_up || function == do_down)) {
function(); function();
} else if (function == do_up || function == do_scroll_up) { } else if (function == do_up || function == do_scroll_up) {
@ -516,6 +514,8 @@ void show_help(void)
} else if (kbinput == THE_WINDOW_RESIZED) { } else if (kbinput == THE_WINDOW_RESIZED) {
; /* Nothing to do. */ ; /* Nothing to do. */
#endif #endif
} else if (function == full_refresh) {
full_refresh();
} else if (function == do_exit) { } else if (function == do_exit) {
break; break;
} else } else

View File

@ -1082,6 +1082,7 @@ void regenerate_screen(void)
/* If we have an open buffer, redraw the contents of the subwindows. */ /* If we have an open buffer, redraw the contents of the subwindows. */
if (openfile) { if (openfile) {
ensure_firstcolumn_is_aligned(); ensure_firstcolumn_is_aligned();
if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR))
draw_all_subwindows(); draw_all_subwindows();
} }
} }

View File

@ -761,9 +761,11 @@ int ask_user(bool withall, const char *question)
else if (kbinput == '\x0E' || (kbinput == '\x11' && !ISSET(MODERN_BINDINGS)) || else if (kbinput == '\x0E' || (kbinput == '\x11' && !ISSET(MODERN_BINDINGS)) ||
(kbinput == '\x18' && ISSET(MODERN_BINDINGS))) (kbinput == '\x18' && ISSET(MODERN_BINDINGS)))
choice = NO; choice = NO;
/* And interpret ^Y as "Yes". */ /* Also, interpret ^Y as "Yes, and ^A as "All". */
else if (kbinput == '\x19') else if (kbinput == '\x19')
choice = YES; choice = YES;
else if (kbinput == '\x01' && withall)
choice = ALL;
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
else if (kbinput == KEY_MOUSE) { else if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y; int mouse_x, mouse_y;

View File

@ -526,9 +526,9 @@ char *menu_to_name(int menu)
return "boooo"; return "boooo";
} }
/* Parse the next word from the string, null-terminate it, and return /* Parse the next word from the string (if any), null-terminate it,
* a pointer to the first character after the null terminator. The * and return a pointer to the next word. The returned pointer will
* returned pointer will point to '\0' if we hit the end of the line. */ * point to '\0' when end-of-line was reached. */
char *parse_next_word(char *ptr) char *parse_next_word(char *ptr)
{ {
while (!isblank((unsigned char)*ptr) && *ptr != '\0') while (!isblank((unsigned char)*ptr) && *ptr != '\0')
@ -546,10 +546,9 @@ char *parse_next_word(char *ptr)
return ptr; return ptr;
} }
/* Parse an argument, with optional quotes, after a keyword that takes /* Parse an argument (optionally enveloped in double quotes). When the
* one. If the next word starts with a ", we say that it ends with the * argument starts with a ", then the last " of the line indicates its
* last " of the line. Otherwise, we interpret it as usual, so that the * end -- meaning that an argument can contain "'s either way. */
* arguments can contain "'s too. */
char *parse_argument(char *ptr) char *parse_argument(char *ptr)
{ {
const char *ptr_save = ptr; const char *ptr_save = ptr;
@ -739,9 +738,11 @@ bool is_universal(void (*func)(void))
/* Bind or unbind a key combo, to or from a function. */ /* Bind or unbind a key combo, to or from a function. */
void parse_binding(char *ptr, bool dobind) void parse_binding(char *ptr, bool dobind)
{ {
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL; char *keycopy, *keyptr, *menuptr;
int keycode, menu, mask = 0;
keystruct *newsc = NULL; keystruct *newsc = NULL;
char *funcptr = NULL;
int keycode, menu;
int mask = 0;
check_for_nonempty_syntax(); check_for_nonempty_syntax();
@ -760,7 +761,7 @@ void parse_binding(char *ptr, bool dobind)
else else
keycopy[0] = toupper((unsigned char)keycopy[0]); keycopy[0] = toupper((unsigned char)keycopy[0]);
/* Verify that the key name is not too short, to allow the next call. */ /* Verify that the key name is not too short. */
if (keycopy[1] == '\0' || (keycopy[0] == 'M' && keycopy[2] == '\0')) { if (keycopy[1] == '\0' || (keycopy[0] == 'M' && keycopy[2] == '\0')) {
jot_error(N_("Key name %s is invalid"), keycopy); jot_error(N_("Key name %s is invalid"), keycopy);
goto free_things; goto free_things;
@ -1305,7 +1306,7 @@ void grab_and_store(const char *kind, char *ptr, regexlisttype **storage)
} }
} }
/* Gather and store the string after a comment/linter command. */ /* Gather and store the string after a comment/linter/formatter/tabgives command. */
void pick_up_name(const char *kind, char *ptr, char **storage) void pick_up_name(const char *kind, char *ptr, char **storage)
{ {
if (*ptr == '\0') { if (*ptr == '\0') {
@ -1357,8 +1358,8 @@ bool parse_syntax_commands(char *keyword, char *ptr)
} }
#endif /* ENABLE_COLOR */ #endif /* ENABLE_COLOR */
/* Verify that the user has not unmapped every shortcut for a /* Verify that the user has not unmapped every shortcut for
* function that we consider 'vital' (such as "Exit"). */ * a function that we consider 'vital' (such as "Exit"). */
static void check_vitals_mapped(void) static void check_vitals_mapped(void)
{ {
#define VITALS 4 #define VITALS 4
@ -1382,7 +1383,7 @@ static void check_vitals_mapped(void)
/* Parse the rcfile, once it has been opened successfully at rcstream, /* Parse the rcfile, once it has been opened successfully at rcstream,
* and close it afterwards. If just_syntax is TRUE, allow the file to * and close it afterwards. If just_syntax is TRUE, allow the file to
* to contain only color syntax commands. */ * contain only color syntax commands. */
void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only) void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only)
{ {
char *buffer = NULL; char *buffer = NULL;
@ -1712,6 +1713,7 @@ void parse_one_nanorc(void)
jot_error(N_("Error reading %s: %s"), nanorc, strerror(errno)); jot_error(N_("Error reading %s: %s"), nanorc, strerror(errno));
} }
/* Return TRUE when path-plus-name denotes a readable, normal file. */
bool have_nanorc(const char *path, const char *name) bool have_nanorc(const char *path, const char *name)
{ {
if (path == NULL) if (path == NULL)

View File

@ -578,8 +578,6 @@ void do_undo(void)
break; break;
case REPLACE: case REPLACE:
undidmsg = _("replacement"); undidmsg = _("replacement");
if ((u->xflags & INCLUDED_LAST_LINE) && !ISSET(NO_NEWLINES))
remove_magicline();
data = u->strdata; data = u->strdata;
u->strdata = line->data; u->strdata = line->data;
line->data = data; line->data = data;
@ -757,8 +755,6 @@ void do_redo(void)
break; break;
case REPLACE: case REPLACE:
redidmsg = _("replacement"); redidmsg = _("replacement");
if ((u->xflags & INCLUDED_LAST_LINE) && !ISSET(NO_NEWLINES))
new_magicline();
data = u->strdata; data = u->strdata;
u->strdata = line->data; u->strdata = line->data;
line->data = data; line->data = data;
@ -1049,8 +1045,6 @@ void add_undo(undo_type action, const char *message)
break; break;
case REPLACE: case REPLACE:
u->strdata = copy_of(thisline->data); u->strdata = copy_of(thisline->data);
if (thisline == openfile->filebot && answer[0] != '\0')
u->xflags |= INCLUDED_LAST_LINE;
break; break;
#ifdef ENABLE_WRAPPING #ifdef ENABLE_WRAPPING
case SPLIT_BEGIN: case SPLIT_BEGIN:
@ -1600,8 +1594,7 @@ void concat_paragraph(linestruct *line, size_t count)
line->data[line_len] = '\0'; line->data[line_len] = '\0';
} }
line->data = nrealloc(line->data, line->data = nrealloc(line->data, line_len + next_line_len - next_lead_len + 1);
line_len + next_line_len - next_lead_len + 1);
strcat(line->data, next_line->data + next_lead_len); strcat(line->data, next_line->data + next_lead_len);
UNFOLD_SEGMENT(line); UNFOLD_SEGMENT(line);
#ifndef NANO_TINY #ifndef NANO_TINY

View File

@ -3682,11 +3682,10 @@ void full_refresh(void)
wrefresh(curscr); wrefresh(curscr);
} }
/* Draw all elements of the screen. That is: the title bar plus the content /* Draw the three elements of the screen: the title bar,
* of the edit window (when not in the file browser), and the bottom bars. */ * the contents of the edit window, and the bottom bars. */
void draw_all_subwindows(void) void draw_all_subwindows(void)
{ {
if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR))
titlebar(title); titlebar(title);
#ifdef ENABLE_HELP #ifdef ENABLE_HELP
if (inhelp) { if (inhelp) {
@ -3694,7 +3693,6 @@ void draw_all_subwindows(void)
wrap_help_text_into_buffer(); wrap_help_text_into_buffer();
} else } else
#endif #endif
if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR))
edit_refresh(); edit_refresh();
bottombars(currmenu); bottombars(currmenu);
} }

View File

@ -7,7 +7,7 @@ syntax autoconf "\.(ac|m4)$"
comment "#" comment "#"
# Keywords: # Keywords:
color yellow "\<(if|test|then|elif|else|fi|for|in|do|done)\>" color yellow "\<(if|test|then|elif|else|fi|case|esac|ifelse|for|in|do|done)\>"
color yellow "=|!=|&&|\|\|" color yellow "=|!=|&&|\|\|"
# Macros: # Macros:

View File

@ -32,6 +32,8 @@ color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
# Strings. # Strings.
color brightyellow ""([^"\]|\\.)*"" color brightyellow ""([^"\]|\\.)*""
# Escape sequences.
color brick "\\([abfnrtv\/"]|[0-7]{1,3}|x[[:xdigit:]]{1,2}|u[[:xdigit:]]{1,8})"
# Comments. # Comments.
color brightblue "(^|[[:blank:]])#.*" color brightblue "(^|[[:blank:]])#.*"

View File

@ -14,7 +14,9 @@ color brightblue "\<(AutoReq|AutoProv|AutoReqProv)[[:space:]]*:"
color brightblue "\<(License|Copyright|Distribution|Vendor|Packager)[[:space:]]*:" color brightblue "\<(License|Copyright|Distribution|Vendor|Packager)[[:space:]]*:"
color brightblue "\<((Source|Patch)[0-9]*|Nosource|Nopatch)[[:space:]]*:" color brightblue "\<((Source|Patch)[0-9]*|Nosource|Nopatch)[[:space:]]*:"
# Architectures. # Architectures.
color brightred "\<(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppciseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x?|noarch)\>" color brightred "\<((a|loong)arch64|alpha(ev(56?|67?)|pca56)?|amd64|armv(3l|4b|4l|5t(ej?)?l|6h?l|7(hn?)?l|8h?l)|athlon|em64t|geode|i370|i(3|4|5|6)86|ia32e|ia64|m68k(mint)?|mips(64)?(el|r6|r6el)?)\>"
color brightred "\<(pentium(3|4)|ppc(32dy4|8260|8560)?|ppc64(le|p7)?|ppc(64)?(i|p)series|riscv64|rs6000|s390x?|sgi|sh(3|4|4a)?|sparc(64v?|v8|v9v?)?|x86_64(_v2|_v3|_v4)?|xtensa)\>"
# Architecture and OS conditionals. # Architecture and OS conditionals.
color brightred "%(ifarch|elifarch|ifnarch|ifos|elifos|ifnos)\>" color brightred "%(ifarch|elifarch|ifnarch|ifos|elifos|ifnos)\>"
# %* strings. # %* strings.

View File

@ -17,7 +17,7 @@ color magenta "^((override +)?(un)?define|endef|(un)?export|private|vpath)\>"
color blue "\$+[{(][a-zA-Z0-9_-]+[})]" color blue "\$+[{(][a-zA-Z0-9_-]+[})]"
# Targets. # Targets.
color brightblue "^[^ ]+:" color brightblue "^[^ ].*:"
# Comments. # Comments.
color green "(^|[[:blank:]]+)#.*" color green "(^|[[:blank:]]+)#.*"

View File

@ -10,7 +10,7 @@ color brightred ".*"
color yellow "^[[:blank:]]*(i?color|set[[:blank:]]+((error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color))[[:blank:]]+(bold,)?(italic,)?(((bright|light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3})?(,(((light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3}))?\>" color yellow "^[[:blank:]]*(i?color|set[[:blank:]]+((error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color))[[:blank:]]+(bold,)?(italic,)?(((bright|light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3})?(,(((light)?(white|black|red|blue|green|yellow|magenta|cyan))|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3}))?\>"
# The arguments of two special commands # The arguments of two special commands
color bold,purple "^[[:blank:]]*include[[:blank:]][^"]*([[:blank:]]|$)" color bold,purple "^[[:blank:]]*include[[:blank:]]+[^[:blank:]"]+"
color lime "^[[:blank:]]*extendsyntax[[:blank:]]+[[:alpha:]]+[[:blank:]]+(i?color|header|magic|comment|formatter|linter|tabgives)[[:blank:]]+.*" color lime "^[[:blank:]]*extendsyntax[[:blank:]]+[[:alpha:]]+[[:blank:]]+(i?color|header|magic|comment|formatter|linter|tabgives)[[:blank:]]+.*"
# The arguments of commands # The arguments of commands