Compare commits

..

15 Commits
v3.0 ... v3.1

Author SHA1 Message Date
Benno Schulenberg
ce94cb1dc6 po: update translations and regenerate POT file and PO files 2018-09-18 19:39:06 +02:00
Benno Schulenberg
031f255ffd bump version numbers and add a news item for the 3.1 release 2018-09-18 19:27:31 +02:00
Benno Schulenberg
e8a5665d2c bindings: make ^H rebindable also on NetBSD, FreeBSD and macOS
So that the user can do 'bind ^H cutwordleft all' in their nanorc
to make ^H (and sometimes also <Ctrl+Backspace>) delete the word
to the left of the cursor while <Backspace> continues to delete
just one character.
2018-09-18 19:14:05 +02:00
Benno Schulenberg
65e4784eec bindings: bind ASCII DEL during startup instead of repeatedly at runtime 2018-09-18 19:14:05 +02:00
Benno Schulenberg
e2051a61e0 syntax: sh: let the header regex match also busybox shell scripts
And recognize calls via 'env' too.

This addresses https://savannah.gnu.org/bugs/?54674.
Reported-by: Aaron Sears <geodelic@gmail.com>
2018-09-18 19:06:11 +02:00
Benno Schulenberg
a8fa0a82c4 tweaks: rename a variable to be special and distinct 2018-09-17 20:35:13 +02:00
Benno Schulenberg
d19169c263 tweaks: condense a bit of code 2018-09-17 20:32:48 +02:00
Benno Schulenberg
4e7b92ed4c tweaks: sharpen an optimization, to allow DEL to be a shortcut 2018-09-16 19:21:27 +02:00
Benno Schulenberg
eaeafe29ca suspension: don't try to show the cursor position when going to sleep
As the statusbar() function will write the position directly to the
terminal when not in curses mode, the final part of this position
message will seem to be after the prompt when exiting from nano.

The cursor position will get written correctly to the status bar
anyway, because returning from suspension enters a fake key into
the keyboard buffer, and this key elicits an update of the display.

This fixes https://savannah.gnu.org/bugs/?54639.
Reported-by: Lauri Kasanen <cand@gmx.com>

Bug existed since version 2.4.2, commit 75d64e67.
2018-09-13 19:55:20 +02:00
Benno Schulenberg
fe3a72ce3e main: allow toggling all editor features when in view mode
Most of these toggles just change the appearance of things, and
all of them are harmless -- none of them modify the contents of
the buffer.

This fixes https://savannah.gnu.org/bugs/?54650.
Reported-by: Liu Hao <lh_mouse@126.com>

Bug existed since version 2.9.4, commit 54103d8e.

(The offending commit meant in the previous commit was 60f1090d.
My mistake.)
2018-09-12 19:54:32 +02:00
Liu Hao
6cd53e7f44 search: disallow switching to the Replace prompt when in view mode
Switching to Replace allows modifiying the buffer, which should
not be possible in view mode.

This fixes https://savannah.gnu.org/bugs/?54649.

Bug existed since version 2.9.4, commit 54103d8e.

Signed-off-by: Liu Hao <lh_mouse@126.com>
2018-09-12 19:22:08 +02:00
Benno Schulenberg
b84d7bf7a5 input: keep the cursor in edit window after message, also on NetBSD
This fixes https://savannah.gnu.org/bugs/?54632.
2018-09-12 15:22:53 +02:00
Benno Schulenberg
6840205e84 tweaks: remove a superfluous comment and a redundant assignment 2018-09-12 15:07:44 +02:00
Benno Schulenberg
3c5e5d4b6f input: recognize the sequences for Ctrl+Shift+Delete on xterm and urxvt
This fixes https://savannah.gnu.org/bugs/?54648.
2018-09-12 15:04:59 +02:00
Benno Schulenberg
09ab2e3d0e bindings: when Ctrl+Shift+Delete has no keycode, don't use KEY_BSP
When curses gives no code for Ctrl+Shift+Delete, do not fall back
to KEY_BACKSPACE, because then ^H and/or <Backspace> get bound to
'cutwordleft'.

This fixes https://savannah.gnu.org/bugs/?54642.

Bug was introduced with version 3.0, commit e6429e78.
2018-09-12 14:34:50 +02:00
51 changed files with 8147 additions and 8138 deletions

View File

@@ -1,3 +1,24 @@
Changes between v3.0 and v3.1:
------------------------------
Benno Schulenberg (13):
bindings: bind ASCII DEL during startup instead of repeatedly at runtime
bindings: make ^H rebindable also on NetBSD, FreeBSD and macOS
bindings: when Ctrl+Shift+Delete has no keycode, don't use KEY_BSP
bump version numbers and add a news item for the 3.1 release
input: keep the cursor in edit window after message, also on NetBSD
input: recognize the sequences for Ctrl+Shift+Delete on xterm and urxvt
main: allow toggling all editor features when in view mode
suspension: don't try to show the cursor position when going to sleep
syntax: sh: let the header regex match also busybox shell scripts
tweaks: condense a bit of code
tweaks: remove a superfluous comment and a redundant assignment
tweaks: rename a variable to be special and distinct
tweaks: sharpen an optimization, to allow DEL to be a shortcut
Liu Hao (1):
search: disallow switching to the Replace prompt when in view mode
Changes between v2.9.8 and v3.0:
--------------------------------

6
NEWS
View File

@@ -1,3 +1,9 @@
2018.09.18 - GNU nano 3.1 "Je faisais des bonds comme ça!" fixes a
misbinding of ^H on some terminals and some systems,
does not leave stray stuff after the prompt upon exit
when having suspended nano while using --constantshow,
and does not allow to toggle to Replace in view mode.
2018.09.09 - GNU nano 3.0 "Water Flowing Underground" speeds up the
reading of a file by seventy percent, roughly doubles the
speed of handling ASCII text, changes the way words at line

View File

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

View File

@@ -91,7 +91,7 @@
<h3><a name="1.3"></a>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>
<h3><a name="1.4"></a>1.4. What is the current version of nano?</h3>
<blockquote><p>The current version of nano <i>should</i> be <b>3.0</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>3.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>
<h3><a name="1.5"></a>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>
<hr width="100%">

View File

@@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.TH NANO 1 "version 3.0" "September 2018"
.TH NANO 1 "version 3.1" "September 2018"
.SH NAME
nano \- Nano's ANOther editor, an enhanced free Pico clone

View File

@@ -8,7 +8,7 @@
@smallbook
@set EDITION 0.5
@set VERSION 3.0
@set VERSION 3.1
@set UPDATED September 2018
@dircategory Editors
@@ -23,7 +23,7 @@
@titlepage
@title GNU @command{nano}
@subtitle a small and friendly text editor
@subtitle version 3.0
@subtitle version 3.1
@author Chris Allegretta
@page
@@ -63,7 +63,7 @@ e-mail: @email{chrisa@@asty.org}@*
@node Top
@top
This manual documents the GNU @command{nano} editor, version 3.0.
This manual documents the GNU @command{nano} editor, version 3.1.
@menu
* Introduction::

View File

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

View File

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

454
po/bg.po

File diff suppressed because it is too large Load Diff

454
po/ca.po

File diff suppressed because it is too large Load Diff

454
po/cs.po

File diff suppressed because it is too large Load Diff

454
po/da.po

File diff suppressed because it is too large Load Diff

454
po/de.po

File diff suppressed because it is too large Load Diff

454
po/eo.po

File diff suppressed because it is too large Load Diff

454
po/es.po

File diff suppressed because it is too large Load Diff

472
po/eu.po

File diff suppressed because it is too large Load Diff

598
po/fi.po

File diff suppressed because it is too large Load Diff

454
po/fr.po

File diff suppressed because it is too large Load Diff

454
po/ga.po

File diff suppressed because it is too large Load Diff

454
po/gl.po

File diff suppressed because it is too large Load Diff

454
po/hr.po

File diff suppressed because it is too large Load Diff

454
po/hu.po

File diff suppressed because it is too large Load Diff

472
po/id.po

File diff suppressed because it is too large Load Diff

454
po/it.po

File diff suppressed because it is too large Load Diff

454
po/ja.po

File diff suppressed because it is too large Load Diff

474
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

454
po/nb.po

File diff suppressed because it is too large Load Diff

454
po/nl.po

File diff suppressed because it is too large Load Diff

472
po/nn.po

File diff suppressed because it is too large Load Diff

454
po/pl.po

File diff suppressed because it is too large Load Diff

454
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

454
po/ro.po

File diff suppressed because it is too large Load Diff

454
po/ru.po

File diff suppressed because it is too large Load Diff

454
po/sl.po

File diff suppressed because it is too large Load Diff

454
po/sr.po

File diff suppressed because it is too large Load Diff

454
po/sv.po

File diff suppressed because it is too large Load Diff

454
po/tr.po

File diff suppressed because it is too large Load Diff

454
po/uk.po

File diff suppressed because it is too large Load Diff

454
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,8 +1,7 @@
#!/bin/bash
VERSION="3.0"
VERSION="3.1"
echo "Pulling..." && git pull &&
echo "Running autogen..." && ./autogen.sh &&
rm -v -f m4/*.m4~ *.asc *.sig *.gz *.xz &&

View File

@@ -462,6 +462,10 @@ int keycode_from_string(const char *keystring)
if (keystring[0] == '^') {
if (strcasecmp(keystring, "^Space") == 0)
return 0;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
if (strcasecmp(keystring, "^H") == 0)
return KEY_BACKSPACE;
#endif
if (keystring[1] <= '_' && strlen(keystring) == 2)
return keystring[1] - 64;
else
@@ -1076,6 +1080,11 @@ void shortcut_init(void)
add_to_sclist(MMOST, "Bsp", KEY_BACKSPACE, do_backspace, 0);
add_to_sclist(MMOST, "^D", 0, do_delete, 0);
add_to_sclist(MMOST, "Del", 0, do_delete, 0);
/* Make ASCII DEL do a delete when requested, otherwise a backspace. */
if (ISSET(REBIND_DELETE))
add_to_sclist(MMOST, "Del", DEL_CODE, do_delete, 0);
else
add_to_sclist(MMOST, "Bsp", DEL_CODE, do_backspace, 0);
add_to_sclist(MMOST, "^I", 0, do_tab, 0);
add_to_sclist(MMOST, "Tab", TAB_CODE, do_tab, 0);
add_to_sclist(MMOST & ~MFINDINHELP, "^G", 0, do_help_void, 0);

View File

@@ -499,28 +499,20 @@ void help_init(void)
/* Now add our shortcut info. */
for (f = allfuncs; f != NULL; f = f->next) {
int scsfound = 0;
int tally = 0;
if ((f->menus & currmenu) == 0)
continue;
/* Let's simply show the first two shortcuts from the list. */
for (s = sclist; s != NULL; s = s->next) {
if ((s->menus & currmenu) == 0)
continue;
if (s->func == f->func) {
scsfound++;
if ((s->menus & currmenu) && s->func == f->func) {
/* Make the first column narrower (6) than the second (10),
* but allow it to spill into the second, for "M-Space". */
if (scsfound == 1) {
if (++tally == 1) {
sprintf(ptr, "%s ", s->keystr);
/* Unicode arrows take three bytes instead of one. */
if (strstr(s->keystr, "\xE2") != NULL)
ptr += 8;
else
ptr += 6;
ptr += (strstr(s->keystr, "\xE2") != NULL ? 8 : 6);
} else {
ptr += sprintf(ptr, "(%s)\t", s->keystr);
break;
@@ -528,9 +520,9 @@ void help_init(void)
}
}
if (scsfound == 0)
if (tally == 0)
ptr += sprintf(ptr, "\t\t");
else if (scsfound == 1)
else if (tally == 1)
ptr += 10;
/* The shortcut's help text. */

View File

@@ -1263,6 +1263,9 @@ RETSIGTYPE do_suspend(int signal)
/* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm);
/* The suspend keystroke must not elicit cursor-position display. */
suppress_cursorpos=TRUE;
#ifdef SIGSTOP
/* Do what mutt does: send ourselves a SIGSTOP. */
kill(0, SIGSTOP);
@@ -1753,7 +1756,8 @@ int do_input(bool allow_funcs)
if (shortcut == NULL)
pletion_line = NULL;
else {
if (ISSET(VIEW_MODE) && !okay_for_view(shortcut)) {
if (ISSET(VIEW_MODE) && shortcut->func != do_toggle_void &&
!okay_for_view(shortcut)) {
print_view_warning();
return ERR;
}
@@ -2580,7 +2584,7 @@ int main(int argc, char **argv)
controlhome = get_keycode("kHOM5", CONTROL_HOME);
controlend = get_keycode("kEND5", CONTROL_END);
controldelete = get_keycode("kDC5", CONTROL_DELETE);
controlshiftdelete = get_keycode("kDC6", KEY_BACKSPACE);
controlshiftdelete = get_keycode("kDC6", CONTROL_SHIFT_DELETE);
#ifndef NANO_TINY
/* Ask for the codes for Shift+Control+Left/Right/Up/Down. */
shiftcontrolleft = get_keycode("kLFT6", SHIFT_CONTROL_LEFT);

View File

@@ -588,6 +588,7 @@ enum
#define SHIFT_CONTROL_DOWN 0x414
#define SHIFT_CONTROL_HOME 0x415
#define SHIFT_CONTROL_END 0x416
#define CONTROL_SHIFT_DELETE 0x417
#define ALT_LEFT 0x421
#define ALT_RIGHT 0x422
#define ALT_UP 0x423

View File

@@ -155,6 +155,12 @@ void search_init(bool replacing, bool keep_the_answer)
} else if (func == regexp_void) {
TOGGLE(USE_REGEXP);
} else if (func == flip_replace) {
if (ISSET(VIEW_MODE)) {
print_view_warning();
tidy_up_after_search();
free(thedefault);
return;
}
replacing = !replacing;
} else {
if (func == flip_goto)

View File

@@ -709,11 +709,6 @@ int parse_kbinput(WINDOW *win)
case KEY_SDC:
return KEY_BACKSPACE;
#endif
case DEL_CODE:
if (ISSET(REBIND_DELETE))
return the_code_for(do_delete, KEY_DC);
else
return KEY_BACKSPACE;
#ifdef KEY_SIC /* Slang doesn't support KEY_SIC. */
case KEY_SIC:
return the_code_for(do_insertfile_void, KEY_IC);
@@ -1096,17 +1091,20 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
if (length > 2 && seq[2] == '~')
return KEY_DC;
if (length > 4 && seq[2] == ';' && seq[4] == '~') {
/* Esc [ 3 ; x ~ == modified Delete on xterm. */
*consumed = 5;
if (seq[3] == '5')
/* Esc [ 3 ; 5 ~ == Ctrl-Delete on xterm. */
return CONTROL_DELETE;
if (seq[3] == '6')
/* Esc [ 3 ; 6 ~ == Ctrl-Shift-Delete on xterm. */
return controlshiftdelete;
}
if (length > 2 && seq[2] == '^') {
if (length > 2 && seq[2] == '^')
/* Esc [ 3 ^ == Ctrl-Delete on urxvt. */
*consumed = 3;
return CONTROL_DELETE;
}
if (length > 2 && seq[2] == '@')
/* Esc [ 3 @ == Ctrl-Shift-Delete on urxvt. */
return controlshiftdelete;
break;
case '4': /* Esc [ 4 ~ == End on VT220/VT320/
* Linux console/xterm. */
@@ -1316,6 +1314,7 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
lastmessage = HUSH;
if (currmenu == MMAIN) {
place_the_cursor();
wnoutrefresh(edit); /* Needed for correct placement on NetBSD. */
curs_set(1);
}
}
@@ -1761,7 +1760,8 @@ const sc *get_shortcut(int *kbinput)
#endif
/* Plain characters cannot be shortcuts, so just skip those. */
if (!meta_key && (*kbinput & 0x7F) >= 0x20 && *kbinput <= 0xFF)
if (!meta_key && ((*kbinput >= 0x20 && *kbinput < 0x7F) ||
(*kbinput >= 0xA0 && *kbinput <= 0xFF)))
return NULL;
for (s = sclist; s != NULL; s = s->next) {

View File

@@ -1,7 +1,7 @@
## Here is an example for Bourne shell scripts.
syntax sh "(\.sh|\.(a|ba|c|da|k|mk|pdk|tc|z)(sh|shrc|sh_profile)|/(etc/|\.)profile)$"
header "^#!.*/(((a|ba|c|da|k|mk|pdk|tc|z)?sh)|openrc-run|runscript)"
header "^#!.*/(((a|ba|c|da|k|mk|pdk|tc|z)?sh)|(busybox|env) +sh|openrc-run|runscript)"
magic "(POSIX|Bourne-Again) shell script.*text"
linter dash -n
comment "#"