Compare commits

..

49 Commits

Author SHA1 Message Date
Benno Schulenberg
fd8ce7af8e po: regenerate POT file and PO files 2017-06-25 11:09:38 +02:00
Benno Schulenberg
c5a0c9b6b2 tweaks: baptize the previous release 2017-06-25 10:59:40 +02:00
Benno Schulenberg
6520aa0079 bump version numbers and add a news item for the 2.8.5 release 2017-06-25 10:37:17 +02:00
Benno Schulenberg
3d8b9895b8 gnulib: update to its current state 2017-06-25 10:05:27 +02:00
Benno Schulenberg
9026e04c73 startup: don't use position history when reading from standard input 2017-06-23 13:44:01 +02:00
Benno Schulenberg
92befae93d startup: don't mark the buffer as modified when in view mode 2017-06-23 10:43:52 +02:00
Benno Schulenberg
dbbc14e0ac tweaks: be consistent in the spelling of title bar and status bar 2017-06-23 10:33:19 +02:00
Benno Schulenberg
8b80ec3e1a startup: allow negative line and column numbers on the command line
They can be given at the prompt, so it's better to accept them on the
command line too.
2017-06-23 10:25:12 +02:00
Benno Schulenberg
a71a2f9a0c startup: don't mark the buffer as modified when nothing was read 2017-06-23 09:51:58 +02:00
Benno Schulenberg
56ce5f2ba8 tweaks: rename a function and a variable, to better match what they do
Also improve some comments.
2017-06-23 09:50:48 +02:00
Benno Schulenberg
5ebdd3fe6e tweaks: reduce the scope of three variables, and rename them besides 2017-06-23 09:00:15 +02:00
Benno Schulenberg
426e6d37c5 startup: don't try placing the cursor when reading standard input failed
And rename the function while there anyway.
2017-06-23 08:30:24 +02:00
Benno Schulenberg
4dd9aadf8a startup: allow positioning the cursor also when reading standard input
A recent change (8dffb00f) removed this ability.  This change restores
it, and also allows reading from standard input multiple times -- maybe
not useful, but it works.
2017-06-20 11:22:57 +02:00
Benno Schulenberg
5ecd81bd19 tweaks: rename a variable, and frob a couple of comments
Also, conditionalize a statement that is only effective when
multiple file buffers are available.
2017-06-18 21:37:42 +02:00
Benno Schulenberg
b4a955512e docs: spell "title bar" and "status bar" correctly 2017-06-18 20:09:30 +02:00
Benno Schulenberg
33c7a4ca95 tweaks: adjust indentation after preceding changes
Also, shorten two variable names.
2017-06-18 11:29:09 +02:00
Benno Schulenberg
40d34862fd tweaks: reduce the scope of two variables, and rename them too
This reduction is possible since the routine no longer loops when
it encounters a +NUMBER argument.
2017-06-18 11:06:58 +02:00
Benno Schulenberg
bee670424e tweaks: elide a variable 2017-06-18 11:00:21 +02:00
Benno Schulenberg
8dffb00fd9 startup: always open with the file that was mentioned first
Also when a dash is the first "file" mentioned on the command line,
nano should show this buffer at startup and not the next.

This fixes https://savannah.gnu.org/bugs/?51207.
2017-06-18 10:49:51 +02:00
Benno Schulenberg
403e87c0a0 docs: avoid a double "see" for cross references in the HTML manual
This fixes https://savannah.gnu.org/bugs/?51208.
2017-06-08 16:25:23 +02:00
Benno Schulenberg
942bb39547 startup: don't crash when opening standard input would fail
This fixes https://savannah.gnu.org/bugs/?51206.
2017-06-08 11:28:49 +02:00
Benno Schulenberg
52b7a41ea4 tweaks: elide a function that should not be a separate one
Reading from standard input is a purely sequential affair --
no need to split it into two functions.
2017-06-07 21:28:34 +02:00
Benno Schulenberg
6807e06a74 tweaks: frob a few comments, and elide and #ifndef 2017-06-06 22:22:48 +02:00
Benno Schulenberg
84cd0abd6f tweaks: avoid compiler warning about implicit type 2017-06-04 12:59:05 +02:00
Benno Schulenberg
6a70d2b6e2 tweaks: rename two functions and a variable, and invert its logic 2017-06-04 12:34:21 +02:00
Benno Schulenberg
16482f99b8 tweaks: unglobalize the nodelay_mode variable 2017-06-04 12:15:26 +02:00
Benno Schulenberg
621eb904b3 bindings: in the tiny version exclude word jumping from the prompts
In the tiny version, Ctrl+Left and Ctrl+Right are available only
in the editor itself and in the file browser.

This fixes https://savannah.gnu.org/bugs/?51173.
2017-06-04 11:13:03 +02:00
Benno Schulenberg
84ff9ebb91 display: don't let a SIGCONT write anything to the screen
The old praxis of calling total_refresh() upon a SIGCONT was confusing,
because the screen would look as if nano had returned from suspension,
but in fact the shell was still active.

Instead of calling total_refresh(), put a no-op key into ncurses' buffer,
so that, when nano actually does return out of suspension (through 'fg'),
this key will be read and discarded, upon which nano will go sit and wait
for the next key, just before which it calls doupdate().  The latter is
all we need to get the entire screen restored.

This also fixes https://savannah.gnu.org/bugs/?51131 for "tiny".
2017-06-02 21:00:13 +02:00
Benno Schulenberg
a2038a9b2b input: give an appropriate message when there are too many errors
This fixes a secondary part of https://savannah.gnu.org/bugs/?51124.
2017-05-31 15:11:11 +02:00
Benno Schulenberg
a969adf804 suspension: fake a SIGWINCH when coming back out of the background
When receiving a SIGCONT, don't call regenerate_screen() directly
but act as if a SIGWINCH occurred.  Also insert a dummy key, and
thus let the relevant input routine redraw the relevant subwindows.

Use KEY_F0 as the dummy key, as both Ncurses and Slang know it, and
it should normally do nothing at all.

This fixes https://savannah.gnu.org/bugs/?51124.
2017-05-31 14:57:56 +02:00
Benno Schulenberg
59b0f81bfa display: redraw title bar and edit window only when needed
When we are in the file browser, browser_refresh() will take care of
redrawing the title bar and the file list, so total_refresh() should
leave those two subwindows alone in that case.

This fixes https://savannah.gnu.org/bugs/?51147.
2017-05-31 12:44:02 +02:00
Benno Schulenberg
6ad3d3d6c0 display: show the cursor position also when searching took a while
Achieve this by making the suppression flag global, so that we can
just reset it instead of making an improper call of do_cursorpos().

This fixes the secondary part of https://savannah.gnu.org/bugs/?51134.
2017-05-29 22:15:38 +02:00
Benno Schulenberg
ca70885564 tweaks: don't bother calculating the position when we won't show it
Also, remove a useless assert.
2017-05-29 21:51:47 +02:00
Benno Schulenberg
cfa20c3f42 display: don't show the cursor while we are busy calculating its position
This fixes https://savannah.gnu.org/bugs/?51134.
2017-05-29 21:47:38 +02:00
Benno Schulenberg
4781d4d351 tweaks: reshuffle some stuff, to put related things closer together 2017-05-24 10:23:20 +02:00
Benno Schulenberg
ef1a3b08ae suspension: remove a duplicate setting of the HUP and TERM handler
This has been done already during signal_init().
2017-05-24 10:15:42 +02:00
Benno Schulenberg
4063fce6a0 syntax: default: allow leading whitespace before a hash comment 2017-05-23 20:07:15 +02:00
Benno Schulenberg
3db2beefd3 po: regenerate POT file and PO files 2017-05-21 10:57:12 +02:00
Benno Schulenberg
5907f8801b bump version numbers and add a news item for the 2.8.4 release 2017-05-21 10:21:03 +02:00
Benno Schulenberg
c68398f18f syntax: php: color "static" again as "function", like it used to be 2017-05-21 10:11:42 +02:00
Benno Schulenberg
d653aeab93 syntax: default: color also hash comments and email addresses 2017-05-19 21:09:15 +02:00
Benno Schulenberg
491e02f532 tweaks: reorder three items in the Info document 2017-05-19 21:09:02 +02:00
Benno Schulenberg
f1a47a2aae tweaks: reshuffle a few things to reduce duplication
It is no longer necessary to assign up() and down() separately for
the help viewer because by now the movement keys have been sorted
in order of ascending stride also in the main menu.

The two string definitions are relocated just to reduce the number
of #ifdefs.
2017-05-19 17:57:39 +02:00
Benno Schulenberg
7b23878b42 tweaks: do actual screen refreshes in a single call, when possible 2017-05-19 16:31:08 +02:00
Benno Schulenberg
5cdadc3eb1 tweaks: avoid an unused-variable warning when using --disable-comment 2017-05-19 11:55:37 +02:00
Benno Schulenberg
8f89e23adb tweaks: adjust the indentation after the preceding change
Also, change two error messages a bit.
2017-05-19 11:47:13 +02:00
Benno Schulenberg
8302ff700b tweaks: remove the no-op x$disable tests 2017-05-19 11:47:13 +02:00
Benno Schulenberg
a32d21c759 build: correct the inverted logic for the nanorc man page
All this "not is no" has me turning around in circles
at least ten times before I know which side is which.

This fixes https://savannah.gnu.org/bugs/?51061
Reported-by: Vicente Olivert Riera <vincent.riera@imgtec.com>
2017-05-19 11:46:18 +02:00
Benno Schulenberg
f8214440c2 gnulib: update to its current state 2017-05-18 20:09:04 +02:00
55 changed files with 13124 additions and 12743 deletions

View File

@@ -1,3 +1,61 @@
Changes between v2.8.4 and v2.8.5:
----------------------------------
Benno Schulenberg (35):
bindings: in the tiny version exclude word jumping from the prompts
bump version numbers and add a news item for the 2.8.5 release
display: don't let a SIGCONT write anything to the screen
display: don't show the cursor while we are busy calculating its position
display: redraw title bar and edit window only when needed
display: show the cursor position also when searching took a while
docs: avoid a double "see" for cross references in the HTML manual
docs: spell "title bar" and "status bar" correctly
gnulib: update to its current state
input: give an appropriate message when there are too many errors
startup: allow negative line and column numbers on the command line
startup: allow positioning the cursor also when reading standard input
startup: always open with the file that was mentioned first
startup: don't crash when opening standard input would fail
startup: don't mark the buffer as modified when in view mode
startup: don't mark the buffer as modified when nothing was read
startup: don't try placing the cursor when reading standard input failed
startup: don't use position history when reading from standard input
suspension: fake a SIGWINCH when coming back out of the background
suspension: remove a duplicate setting of the HUP and TERM handler
syntax: default: allow leading whitespace before a hash comment
tweaks: adjust indentation after preceding changes
tweaks: avoid compiler warning about implicit type
tweaks: be consistent in the spelling of title bar and status bar
tweaks: don't bother calculating the position when we won't show it
tweaks: elide a function that should not be a separate one
tweaks: elide a variable
tweaks: frob a few comments, and elide and #ifndef
tweaks: reduce the scope of three variables, and rename them besides
tweaks: reduce the scope of two variables, and rename them too
tweaks: rename a function and a variable, to better match what they do
tweaks: rename a variable, and frob a couple of comments
tweaks: rename two functions and a variable, and invert its logic
tweaks: reshuffle some stuff, to put related things closer together
tweaks: unglobalize the nodelay_mode variable
Changes between v2.8.3 and v2.8.4:
----------------------------------
Benno Schulenberg (11):
build: correct the inverted logic for the nanorc man page
bump version numbers and add a news item for the 2.8.4 release
gnulib: update to its current state
syntax: default: color also hash comments and email addresses
syntax: php: color "static" again as "function", like it used to be
tweaks: adjust the indentation after the preceding change
tweaks: avoid an unused-variable warning when using --disable-comment
tweaks: do actual screen refreshes in a single call, when possible
tweaks: remove the no-op x$disable tests
tweaks: reorder three items in the Info document
tweaks: reshuffle a few things to reduce duplication
Changes between v2.8.2 and v2.8.3:
----------------------------------

11
NEWS
View File

@@ -1,3 +1,14 @@
2017.06.25 - GNU nano 2.8.5 "Farouche" avoids a crash when waking from
a suspension that was induced from the outside, allows
negative line and column numbers on the command line,
avoids some flickering when resizing the screen while
in the file browser, opens files in the order they were
mentioned on the command line, and does not pretend to
have woken from suspension when receiving a SIGCONT.
2017.05.21 - GNU nano 2.8.4 "Our Version of Events" includes the nanorc
man page again.
2017.05.18 - GNU nano 2.8.3 "Hirsch" fixes a misplacement of the spotlight
during interactive replacing, avoids build failures on AIX
and Solaris, fixes a crash on Solaris, speeds up backwards

View File

@@ -2,7 +2,7 @@
# Generate configure & friends for GIT users.
gnulib_url="git://git.sv.gnu.org/gnulib.git"
gnulib_hash="3eee3a1e3c5b8883e0d4934bfc1326ee605cb7c1"
gnulib_hash="736844e30bb369d203d45503a7cab9f560113cab"
modules="
futimens

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], [2.8.3], [nano-devel@gnu.org], [nano])
AC_INIT([GNU nano], [2.8.5], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.14])
@@ -69,10 +69,8 @@ if test "x$enable_tiny" = xyes; then
enable_browser=no
fi
fi
if test "x$disable_browser" != xyes; then
if test "x$enable_browser" != xno; then
AC_DEFINE(ENABLE_BROWSER, 1, [Define this to enable the built-in file browser.])
fi
if test "x$enable_browser" != xno; then
AC_DEFINE(ENABLE_BROWSER, 1, [Define this to enable the built-in file browser.])
fi
AC_ARG_ENABLE(color,
@@ -100,10 +98,8 @@ if test "x$enable_tiny" = xyes; then
enable_comment=no
fi
fi
if test "x$disable_comment" != xyes; then
if test "x$enable_comment" != xno; then
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.])
fi
if test "x$enable_comment" != xno; then
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.])
fi
AC_ARG_ENABLE(extra,
@@ -117,7 +113,7 @@ AS_HELP_STRING([--disable-help], [Disable the built-in help texts]))
if test "x$enable_tiny" = xyes; then
if test "x$enable_help" = xyes; then
if test "x$enable_multibuffer" != xyes; then
AC_MSG_ERROR([--enable-help cannot work without --enable-multibuffer])
AC_MSG_ERROR([--enable-help needs --enable-multibuffer to work])
fi
else
enable_help=no
@@ -131,10 +127,8 @@ if test "x$enable_multibuffer" = xno; then
enable_help=no
fi
fi
if test "x$disable_help" != xyes; then
if test "x$enable_help" != xno; then
AC_DEFINE(ENABLE_HELP, 1, [Define this to enable the Ctrl+G help texts.])
fi
if test "x$enable_help" != xno; then
AC_DEFINE(ENABLE_HELP, 1, [Define this to enable the Ctrl+G help texts.])
fi
AC_ARG_ENABLE(histories,
@@ -159,10 +153,8 @@ if test "x$enable_tiny" = xyes; then
enable_linenumbers=no
fi
fi
if test "x$disable_linenumbers" != xyes; then
if test "x$enable_linenumbers" != xno; then
AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.])
fi
if test "x$enable_linenumbers" != xno; then
AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.])
fi
AC_ARG_ENABLE(mouse,
@@ -172,10 +164,8 @@ if test "x$enable_tiny" = xyes; then
enable_mouse=no
fi
fi
if test "x$disable_mouse" != xyes; then
if test "x$enable_mouse" != xno; then
AC_DEFINE(ENABLE_MOUSE, 1, [Define this to enable mouse support.])
fi
if test "x$enable_mouse" != xno; then
AC_DEFINE(ENABLE_MOUSE, 1, [Define this to enable mouse support.])
fi
AC_ARG_ENABLE(multibuffer,
@@ -185,10 +175,8 @@ if test "x$enable_tiny" = xyes; then
enable_multibuffer=no
fi
fi
if test "x$disable_multibuffer" != xyes; then
if test "x$enable_multibuffer" != xno; then
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.])
fi
if test "x$enable_multibuffer" != xno; then
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.])
fi
AC_ARG_ENABLE(nanorc,
@@ -198,12 +186,9 @@ if test "x$enable_tiny" = xyes; then
enable_nanorc=no
fi
fi
if test "x$disable_nanorc" != xyes; then
if test "x$enable_nanorc" != xno; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to enable the use of .nanorc files.])
else
nanorc_support=yes
fi
if test "x$enable_nanorc" != xno; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to enable the use of .nanorc files.])
nanorc_support=yes
fi
AC_ARG_ENABLE(operatingdir,
@@ -225,10 +210,8 @@ if test "x$enable_tiny" = xyes; then
enable_tabcomp=no
fi
fi
if test "x$disable_tabcomp" != xyes; then
if test "x$enable_tabcomp" != xno; then
AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
fi
if test "x$enable_tabcomp" != xno; then
AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
fi
AC_ARG_ENABLE(wordcomp,
@@ -240,10 +223,8 @@ if test "x$enable_tiny" = xyes; then
enable_wordcomp=no
fi
fi
if test "x$disable_wordcomp" != xyes; then
if test "x$enable_wordcomp" != xno; then
AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word-completion function.])
fi
if test "x$enable_wordcomp" != xno; then
AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word-completion function.])
fi
AC_ARG_ENABLE(wrapping,
@@ -275,7 +256,7 @@ if test "x$enable_tiny" = xyes; then
color_support=no
else
if test "x$enable_nanorc" != xyes; then
AC_MSG_ERROR([--enable-color with --enable-tiny cannot work without --enable-nanorc])
AC_MSG_ERROR([--enable-color needs --enable-nanorc to work])
fi
fi
if test "x$enable_extra" != xyes; then

View File

@@ -83,7 +83,7 @@
<h2><a name="1.3"></a>1.3. Why the name change from TIP?</h2>
<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>
<h2><a name="1.4"></a>1.4. What is the current version of nano?</h2>
<blockquote><p>The current version of nano <i>should</i> be <b>2.8.3</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>2.8.5</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>
<h2><a name="1.5"></a>1.5. I want to read the man page without having to download the program!</h2>
<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%">
@@ -161,7 +161,7 @@
<blockquote><p>To use multiple file buffers, you must not have configured nano with <b>--disable-multibuffer</b> nor with <b>--enable-tiny</b> (use <b>nano -V</b> to check the compilation options). Then when you want to insert a file into its own buffer instead of into the current file, just hit <b>Meta-F</b> after typing <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
<p>You can move between the buffers you have open with the <b>Meta-&lt;</b> and <b>Meta-&gt;</b> keys, or more easily without holding Shift: <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say &quot;Close&quot;, instead of the normal &quot;Exit&quot; when only one buffer is open.</p></blockquote>
<h2><a name="3.8"></a>3.8. Tell me more about this verbatim input stuff!</h2>
<blockquote><p>When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b> (if you're not at a prompt, you'll get the message &quot;Verbatim Input&quot; on the statusbar), then press the key(s) that generate the character you want.</p>
<blockquote><p>When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b> (if you're not at a prompt, you'll get the message &quot;Verbatim Input&quot; on the status bar), then press the key(s) that generate the character you want.</p>
<p>Alternatively, if you've enabled Unicode support (see section <a href="#5.3">5.3</a>), you can press <b>Meta-V</b> and then type a six-digit hexadecimal code (from 000000 to 10FFFF, case-insensitive), and the character with the corresponding value will be inserted. The statubar will change to &quot;Unicode Input: ......&quot; when you do this.</p></blockquote>
<h2><a name="3.9a"></a>3.9a. How do I make a .nanorc file that will be read when I start nano?</h2>
<blockquote><p>It's not hard at all! But, your nano must <b>not</b> have been compiled with <b>--disable-nanorc</b>. Then simply copy the <b>sample.nanorc</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax of the file is simple. Flags are turned on and off by using the words <b>set</b> and <b>unset</b> plus the long option name for the feature. For example, &quot;set nowrap&quot; or &quot;set smarthome&quot;.</p></blockquote>

View File

@@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.TH NANO 1 "version 2.8.3" "May 2017"
.TH NANO 1 "version 2.8.5" "June 2017"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
@@ -113,7 +113,7 @@ Don't add newlines to the ends of files.
Disable automatic conversion of files from DOS/Mac format.
.TP
.BR \-O ", " \-\-morespace
Use the blank line below the titlebar as extra editing space.
Use the blank line below the title bar as extra editing space.
.TP
.BR \-P ", " \-\-positionlog
For the 200 most recent files, log the last position of the cursor,
@@ -144,7 +144,7 @@ Set the size (width) of a tab to \fInumber\fP columns. The value of
\fInumber\fP must be greater than 0. The default value is 8.
.TP
.BR \-U ", " \-\-quickblank
Do quick statusbar blanking: statusbar messages will disappear after 1
Do quick status-bar blanking: status-bar messages will disappear after 1
keystroke instead of 25. Note that \fB\-c\fP overrides this.
.TP
.BR \-V ", " \-\-version
@@ -164,7 +164,7 @@ Specify the name of the syntax highlighting to use from among the ones
defined in the \fInanorc\fP files.
.TP
.BR \-c ", " \-\-constantshow
Constantly show the cursor position on the statusbar.
Constantly show the cursor position on the status bar.
Note that this overrides \fB\-U\fP.
.TP
.BR \-d ", " \-\-rebinddelete

View File

@@ -6,8 +6,8 @@
@smallbook
@set EDITION 0.4
@set VERSION 2.8.3
@set UPDATED May 2017
@set VERSION 2.8.5
@set UPDATED June 2017
@dircategory Editors
@direntry
@@ -21,7 +21,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor
@subtitle version 2.8.3
@subtitle version 2.8.5
@author Chris Allegretta
@page
@@ -81,8 +81,9 @@ file locking, backup files, and internationalization support.
The original goal for @code{nano} was to be a complete bug-for-bug
emulation of Pico. But currently the goal is to be as compatible
as possible while offering a superset of Pico's functionality. See
@xref{Pico Compatibility}, for more info.
as possible while offering a superset of Pico's functionality.
@xref{Pico Compatibility} for more details on how @code{nano} and
Pico differ.
Please report bugs via @url{https://savannah.gnu.org/bugs/?group=nano}.
@@ -107,7 +108,7 @@ adding it with a comma. So a more complete command synopsis is:
@end quotation
Normally, however, you set your preferred options in a @file{.nanorc}
file (see @xref{Nanorc Files}). And when using @code{set positionlog}
file (@pxref{Nanorc Files}). And when using @code{set positionlog}
(making @code{nano} remember the cursor position when you close a file),
you will rarely need to specify a line number.
@@ -182,7 +183,7 @@ Disable automatic conversion of files from DOS/Mac format.
@item -O
@itemx --morespace
Use the blank line below the titlebar as extra editing space.
Use the blank line below the title bar as extra editing space.
@item -P
@itemx --positionlog
@@ -219,7 +220,7 @@ Set the displayed tab length to @var{number} columns. The value of
@item -U
@itemx --quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
Do quick status-bar blanking: status-bar messages will disappear after 1
keystroke instead of 25. Note that option @option{-c}
(@option{--constantshow}) overrides this.
@@ -240,12 +241,13 @@ should be considered as parts of words. This overrides option
@item -Y @var{name}
@itemx --syntax=@var{name}
Specify a specific syntax from the nanorc files to use for highlighting.
See @xref{Syntax Highlighting}, for more info.
Specify the syntax to be used for highlighting.
@xref{Syntax Highlighting} for more info.
@item -c
@itemx --constantshow
Constantly display the cursor position and line number on the statusbar.
Constantly display the cursor position (line number, column number,
and character number) on the status bar.
Note that this overrides option @option{-U} (@option{--quickblank}).
@item -d
@@ -351,7 +353,7 @@ Don't hard-wrap long lines at any length. This option conflicts with
@item -x
@itemx --nohelp
Expert Mode: don't show the Shortcut List at the bottom of the screen.
This affects the location of the statusbar as well, as in Expert Mode it
This affects the location of the status bar as well, as in Expert Mode it
is located at the very bottom of the editor.
Note: When accessing the help system, Expert Mode is temporarily
@@ -475,21 +477,21 @@ If necessary, it can be toggled off manually with another ^6 or M-A.
@section Screen Layout
The default screen of nano consists of five areas. From top to bottom
these are: the titlebar, a blank line, the edit window, the statusbar,
these are: the title bar, a blank line, the edit window, the status bar,
and two help lines.
The titlebar consists of
The title bar consists of
three sections: left, center and right. The section on the left
displays the version of @code{nano} being used. The center section
displays the current filename, or "New Buffer" if the file has not yet
been named. The section on the right displays "Modified" if the
file has been modified since it was last saved or opened.
The statusbar is the third line from the bottom of the screen. It
The status bar is the third line from the bottom of the screen. It
shows important and informational messages. Any error messages that
occur from using the editor will appear on the statusbar. Any questions
that are asked of the user will be asked on the statusbar, and any user
input (search strings, filenames, etc.) will be input on the statusbar.
occur from using the editor will appear on the status bar. Any questions
that are asked of the user will be asked on the status bar, and any user
input (search strings, filenames, etc.) will be input on the status bar.
The two help lines at the bottom of the screen show some of the most
essential functions of the editor. These two lines are called the
@@ -545,7 +547,7 @@ and ^V (Page Down) keys. ^X exits the help system.
Toggles allow you to change on-the-fly certain aspects of the editor
which would normally be specified via command-line options. They are
invoked via Meta-key sequences (see @xref{Commands}, for more info).
invoked via Meta-key sequences (@pxref{Commands} for more info).
The following global toggles are available:
@table @code
@@ -581,8 +583,7 @@ toggles the @code{-N} (@code{--noconvert}) command-line option.
toggles the @code{-O} (@code{--morespace}) command-line option.
@item Whitespace Display Toggle (Meta-P)
toggles the whitespace-display mode.
See @xref{Whitespace}, for more info.
toggles the whitespace-display mode (@pxref{Whitespace}).
@item Tabs to Spaces Toggle (Meta-Q)
toggles the @code{-E} (@code{--tabstospaces}) command-line option.
@@ -594,18 +595,18 @@ toggles the @code{-S} (@code{--smooth}) command-line option.
toggles the @code{-x} (@code{--nohelp}) command-line option.
@item Color Syntax Highlighting Toggle (Meta-Y)
toggles color syntax highlighting if you have color syntaxes in your
nanorc. See @xref{Syntax Highlighting}, for more info.
toggles color syntax highlighting (if your nanorc defines syntaxes
--- @pxref{Syntax Highlighting}).
@item Suspension Toggle (Meta-Z)
toggles the @code{-z} (@code{--suspend}) command-line option.
@item Soft Wrapping Toggle (Meta-$)
toggles the @code{-$} (@code{--softwrap}) command-line option.
@item Line Numbers Toggle (Meta-#)
toggles the @code{-l} (@code{--linenumbers}) command-line option.
@item Soft Wrapping Toggle (Meta-$)
toggles the @code{-$} (@code{--softwrap}) command-line option.
@end table
@@ -621,7 +622,7 @@ from @file{~/.nanorc}.
A nanorc file accepts a series of "set" and "unset" commands, which can
be used to configure @code{nano} on startup without using command-line
options. Additionally, there are some commands to define syntax highlighting
and to rebind keys --- @xref{Syntax Highlighting}, and @xref{Rebinding Keys}.
and to rebind keys --- @pxref{Syntax Highlighting} and @ref{Rebinding Keys}.
@code{nano} will read one command per line.
Options in nanorc files take precedence over @code{nano}'s defaults, and
@@ -671,7 +672,7 @@ The uniquely numbered files are stored in the specified directory.
Do backwards searches by default.
@item set boldtext
Use bold instead of reverse video for the titlebar, statusbar, key combos,
Use bold instead of reverse video for the title bar, status bar, key combos,
line numbers, and selected text. This can be overridden for the first four
by setting the options @code{titlecolor}, @code{statuscolor}, @code{keycolor},
and @code{numbercolor}.
@@ -687,7 +688,7 @@ closing brackets, can end sentences. The default value is
Do case-sensitive searches by default.
@item set constantshow
Constantly display the cursor position in the status bar.
Constantly display the cursor position on the status bar.
(The old form of this option, @code{set const}, is deprecated.)
@item set cut
@@ -728,7 +729,7 @@ come before the closing set, and the two sets must be in the same order.
The default value is @t{"(<[@{)>]@}"}.
@item set morespace
Use the blank line below the titlebar as extra editing space.
Use the blank line below the title bar as extra editing space.
@item set mouse
Enable mouse support, so that mouse clicks can be used to place the
@@ -779,7 +780,7 @@ specified closing punctuation, optionally followed by closing brackets
The default value is @t{"!.?"}.
@item set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
Do quick status-bar blanking: status-bar messages will disappear after 1
keystroke instead of 25.
@item set quiet
@@ -830,7 +831,7 @@ Use spelling checker "spellprog" instead of the built-in one, which
calls "spell".
@item set statuscolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the statusbar.
Specify the color combination to use for the status bar.
See @code{set titlecolor} for more details.
@item set suspend
@@ -847,7 +848,7 @@ Convert typed tabs to spaces.
Save automatically on exit, don't prompt.
@item set titlecolor @var{fgcolor},@var{bgcolor}
Specify the color combination to use for the titlebar.
Specify the color combination to use for the title bar.
Valid color names for foreground and background are:
white, black, blue, green, red, cyan, yellow, and magenta.
The name of the foreground color may be prefixed with 'bright'.
@@ -1271,7 +1272,7 @@ Toggles the presence of the two-line list of key bindings at the bottom of the s
Toggles the constant display of the current line, column, and character positions.
@item morespace
Toggles the presence of the blank line which 'separates' the titlebar from the file text.
Toggles the presence of the blank line that 'separates' the title bar from the file text.
@item smoothscroll
Toggles smooth scrolling (when moving around with the arrow keys).
@@ -1387,7 +1388,7 @@ searching via ^W (or 'w') and changing directories via ^_ (or 'g'). The
behavior of the Enter (or 's') key varies by what is currently selected.
If the currently selected object is a directory, the file browser will
enter and display the contents of the directory. If the object is a
file, this filename and path are copied to the statusbar, and the file
file, this filename and path are copied to the status bar, and the file
browser exits.
@@ -1419,6 +1420,16 @@ the .nanorc file), @code{nano} will store the position of the cursor
when you close a file, and will place the cursor in that position
again when you later reopen the file.
@item Current Cursor Position
The output of the "Display Cursor Position" command (^C) displays
not only the current line and character position of the cursor,
but also (between the two) the current column position.
@item Spell Checking
In the internal spell checker misspelled words are sorted alphabetically
and trimmed for uniqueness, such that the words 'apple' and 'Apple' will
be prompted for correction separately.
@item Writing Selected Text to Files
When using the Write-Out key (^O), text that has been selected using the
marking key (^^) can not just be written out to a new (or existing) file,
@@ -1444,18 +1455,8 @@ browser is just a file browser, not a file manager.
Many options which alter the functionality of the program can be
"toggled" on or off using Meta key sequences, meaning the program does
not have to be restarted to turn a particular feature on or off.
See the internal help function (^G) for a list of features that
can be toggled. Or see @xref{Feature Toggles} instead.
@item Current Cursor Position
The output of the "Display Cursor Position" command (^C) displays
not only the current line and character position of the cursor,
but also (between the two) the current column position.
@item Spell Checking
In the internal spell checker misspelled words are sorted alphabetically
and trimmed for uniqueness, such that the words 'apple' and 'Apple' will
be prompted for correction separately.
@xref{Feature Toggles} for a list of options that can be toggled.
Or see the list at the end the main internal help text (^G) instead.
@end table
@@ -1530,7 +1531,7 @@ option, which causes a file to be read into a separate buffer by default.
Disable support for reading the nanorc files at startup. With such
support, you can store custom settings in a system-wide and a per-user
nanorc file rather than having to pass command-line options to get
the desired behavior. See @xref{Nanorc Files}, for more info.
the desired behavior. @xref{Nanorc Files} for more info.
Disabling this also eliminates the @code{-I} and @code{-q} command-line
options; the first inhibits the reading of nanorcfiles, and the second
suppresses warnings about errors in those files.

View File

@@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.TH NANORC 5 "version 2.8.3" "May 2017"
.TH NANORC 5 "version 2.8.5" "June 2017"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
@@ -74,7 +74,7 @@ The uniquely numbered files are stored in the specified \fIdirectory\fR.
Do backwards searches by default.
.TP
.B set boldtext
Use bold instead of reverse video for the titlebar, statusbar, key combos,
Use bold instead of reverse video for the title bar, status bar, key combos,
line numbers, and selected text. This can be overridden for the first four
by setting the options \fBtitlecolor\fP, \fBstatuscolor\fP, \fBkeycolor\fP,
and \fBnumbercolor\fP.
@@ -130,7 +130,7 @@ come before the closing set, and the two sets must be in the same order.
The default value is "\fB(<[{)>]}\fP".
.TP
.B set morespace
Use the blank line below the titlebar as extra editing space.
Use the blank line below the title bar as extra editing space.
.TP
.B set mouse
Enable mouse support, if available for your system. When enabled, mouse
@@ -183,7 +183,7 @@ specfified closing punctuation, optionally followed by closing brackets
(see \fBbrackets\fP), can end sentences. The default value is "\fB!.?\fP".
.TP
.B set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
Do quick status-bar blanking: status-bar messages will disappear after 1
keystroke instead of 25.
.TP
.B set quiet
@@ -234,7 +234,7 @@ Use spelling checker \fIspellprog\fP instead of the built-in one, which
calls \fIspell\fP.
.TP
.B set statuscolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the statusbar.
Specify the color combination to use for the status bar.
See \fBset titlecolor\fR for more details.
.TP
.B set suspend
@@ -251,7 +251,7 @@ Convert typed tabs to spaces.
Save automatically on exit, don't prompt.
.TP
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the titlebar.
Specify the color combination to use for the title bar.
Valid names for the foreground and background colors are:
.BR white ", " black ", " blue ", " green ", " red ", " cyan ", " yellow ", and " magenta .
The name of the foreground color may be prefixed with \fBbright\fR.
@@ -666,7 +666,7 @@ Toggles the presence of the two-line list of key bindings at the bottom of the s
Toggles the constant display of the current line, column, and character positions.
.TP
.B morespace
Toggles the presence of the blank line which 'separates' the titlebar from the file text.
Toggles the presence of the blank line that 'separates' the title bar from the file text.
.TP
.B smoothscroll
Toggles smooth scrolling (when moving around with the arrow keys).

View File

@@ -16,7 +16,7 @@
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.TH RNANO 1 "version 2.8.3" "May 2017"
.TH RNANO 1 "version 2.8.5" "June 2017"
.\" Please adjust this date whenever revising the manpage.
.SH NAME

View File

@@ -44,7 +44,7 @@
## Do case-sensitive searches by default.
# set casesensitive
## Constantly display the cursor position in the statusbar. Note that
## Constantly display the cursor position in the status bar. Note that
## this overrides "quickblank".
# set constantshow
## (The old form, 'const', is deprecated.)
@@ -76,7 +76,7 @@
## come before the latter set, and both must be in the same order.
# set matchbrackets "(<[{)>]}"
## Use the blank line below the titlebar as extra editing space.
## Use the blank line below the title bar as extra editing space.
# set morespace
## Enable mouse support, if available for your system. When enabled,
@@ -124,7 +124,7 @@
## sentences.
# set punct "!.?"
## Do quick statusbar blanking. Statusbar messages will disappear after
## Do quick status-bar blanking. Status-bar messages will disappear after
## 1 keystroke instead of 26. Note that "const" overrides this.
# set quickblank

729
po/bg.po

File diff suppressed because it is too large Load Diff

732
po/ca.po

File diff suppressed because it is too large Load Diff

731
po/cs.po

File diff suppressed because it is too large Load Diff

732
po/da.po

File diff suppressed because it is too large Load Diff

731
po/de.po

File diff suppressed because it is too large Load Diff

729
po/eo.po

File diff suppressed because it is too large Load Diff

729
po/es.po

File diff suppressed because it is too large Load Diff

733
po/eu.po

File diff suppressed because it is too large Load Diff

731
po/fi.po

File diff suppressed because it is too large Load Diff

745
po/fr.po

File diff suppressed because it is too large Load Diff

729
po/ga.po

File diff suppressed because it is too large Load Diff

729
po/gl.po

File diff suppressed because it is too large Load Diff

729
po/hr.po

File diff suppressed because it is too large Load Diff

729
po/hu.po

File diff suppressed because it is too large Load Diff

732
po/id.po

File diff suppressed because it is too large Load Diff

729
po/it.po

File diff suppressed because it is too large Load Diff

729
po/ja.po

File diff suppressed because it is too large Load Diff

729
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

729
po/nb.po

File diff suppressed because it is too large Load Diff

729
po/nl.po

File diff suppressed because it is too large Load Diff

732
po/nn.po

File diff suppressed because it is too large Load Diff

731
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

729
po/ro.po

File diff suppressed because it is too large Load Diff

729
po/ru.po

File diff suppressed because it is too large Load Diff

729
po/sl.po

File diff suppressed because it is too large Load Diff

729
po/sr.po

File diff suppressed because it is too large Load Diff

732
po/sv.po

File diff suppressed because it is too large Load Diff

1034
po/tr.po

File diff suppressed because it is too large Load Diff

729
po/uk.po

File diff suppressed because it is too large Load Diff

729
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

@@ -57,6 +57,9 @@ bool have_palette = FALSE;
/* Whether the colors for the current syntax have been initialized. */
#endif
bool suppress_cursorpos = FALSE;
/* Should we skip constant position display for current keystroke? */
message_type lastmessage = HUSH;
/* Messages of type HUSH should not overwrite type MILD nor ALERT. */
@@ -146,9 +149,6 @@ char *quoteerr = NULL;
char *word_chars = NULL;
/* Nonalphanumeric characters that also form words. */
bool nodelay_mode = FALSE;
/* Are we checking for a cancel wile doing something? */
char *answer = NULL;
/* The answer string used by the statusbar prompt. */
@@ -493,11 +493,8 @@ void shortcut_init(void)
const char *whereis_next_tag = N_("WhereIs Next");
#ifdef ENABLE_HELP
#ifndef DISABLE_JUSTIFY
/* TRANSLATORS: The next long series of strings are shortcut descriptions;
* they are best kept shorter than 56 characters, but may be longer. */
const char *nano_justify_msg = N_("Justify the current paragraph");
#endif
const char *nano_cancel_msg = N_("Cancel the current function");
const char *nano_help_msg = N_("Display this help text");
const char *nano_exit_msg =
@@ -589,6 +586,7 @@ void shortcut_init(void)
N_("Cut from the cursor position to the end of the file");
#endif
#ifndef DISABLE_JUSTIFY
const char *nano_justify_msg = N_("Justify the current paragraph");
const char *nano_fulljustify_msg = N_("Justify the entire file");
#endif
#ifndef NANO_TINY
@@ -623,9 +621,6 @@ void shortcut_init(void)
const char *nano_next_history_msg =
N_("Recall the next search/replace string");
#endif
#ifdef ENABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
#endif
#ifndef NANO_TINY
const char *nano_dos_msg = N_("Toggle the use of DOS format");
const char *nano_mac_msg = N_("Toggle the use of Mac format");
@@ -639,6 +634,7 @@ void shortcut_init(void)
#endif
const char *nano_discard_buffer_msg = N_("Close buffer without saving it");
#ifdef ENABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
const char *nano_exitbrowser_msg = N_("Exit from the file browser");
const char *nano_firstfile_msg = N_("Go to the first file in the list");
const char *nano_lastfile_msg = N_("Go to the last file in the list");
@@ -671,7 +667,7 @@ void shortcut_init(void)
add_to_funcs(do_cancel, ((MMOST & ~MMAIN & ~MBROWSER) | MYESNO),
N_("Cancel"), IFSCHELP(nano_cancel_msg), BLANKAFTER, VIEW);
add_to_funcs(do_exit, MMAIN,
add_to_funcs(do_exit, MMAIN|MHELP,
exit_tag, IFSCHELP(nano_exit_msg), TOGETHER, VIEW);
/* Remember the entry for Exit, to be able to replace it with Close. */
exitfunc = tailfunc;
@@ -724,15 +720,10 @@ void shortcut_init(void)
#ifdef ENABLE_HELP
/* The description ("x") and blank_after (0) are irrelevant,
* because the help viewer does not have a help text. */
add_to_funcs(do_exit, MHELP, exit_tag, "x", 0, VIEW);
add_to_funcs(total_refresh, MHELP, refresh_tag, "x", 0, VIEW);
add_to_funcs(do_search, MHELP, whereis_tag, "x", 0, VIEW);
add_to_funcs(do_research, MHELP, whereis_next_tag, "x", 0, VIEW);
add_to_funcs(do_up_void, MHELP, prev_line_tag, "x", 0, VIEW);
add_to_funcs(do_down_void, MHELP, next_line_tag, "x", 0, VIEW);
#endif
add_to_funcs(do_cut_text_void, MMAIN,
@@ -841,9 +832,9 @@ void shortcut_init(void)
add_to_funcs(do_end_void, MMAIN,
N_("End"), IFSCHELP(nano_end_msg), BLANKAFTER, VIEW);
add_to_funcs(do_up_void, MMAIN|MBROWSER,
add_to_funcs(do_up_void, MMAIN|MHELP|MBROWSER,
prev_line_tag, IFSCHELP(nano_prevline_msg), TOGETHER, VIEW);
add_to_funcs(do_down_void, MMAIN|MBROWSER,
add_to_funcs(do_down_void, MMAIN|MHELP|MBROWSER,
next_line_tag, IFSCHELP(nano_nextline_msg), TOGETHER, VIEW);
#ifndef NANO_TINY
add_to_funcs(do_scroll_up, MMAIN,
@@ -1131,15 +1122,15 @@ void shortcut_init(void)
if (using_utf8()) {
add_to_sclist(MMOST, "\xE2\x86\x90", KEY_LEFT, do_left, 0);
add_to_sclist(MMOST, "\xE2\x86\x92", KEY_RIGHT, do_right, 0);
add_to_sclist(MMOST, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MMOST, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0);
add_to_sclist(MSOME, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MSOME, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0);
} else
#endif
{
add_to_sclist(MMOST, "Left", KEY_LEFT, do_left, 0);
add_to_sclist(MMOST, "Right", KEY_RIGHT, do_right, 0);
add_to_sclist(MMOST, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MMOST, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
add_to_sclist(MSOME, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
}
add_to_sclist(MMOST, "M-Space", 0, do_prev_word_void, 0);
add_to_sclist(MMOST, "^Space", 0, do_next_word_void, 0);

View File

@@ -59,6 +59,9 @@ static struct termios oldterm;
static struct sigaction act;
/* Used to set up all our fun signal handlers. */
static bool input_was_aborted = FALSE;
/* Whether reading from standard input was aborted via ^C. */
/* Create a new linestruct node. Note that we do not set prevnode->next
* to the new line. */
filestruct *make_new_node(filestruct *prevnode)
@@ -1100,54 +1103,26 @@ void do_cancel(void)
;
}
static struct sigaction pager_oldaction, pager_newaction;
/* Make a note that reading from stdin was concluded with ^C. */
RETSIGTYPE make_a_note(int signal)
{
input_was_aborted = TRUE;
}
/* Read whatever comes from standard input into a new buffer. */
bool scoop_stdin(void)
{
struct sigaction oldaction, newaction;
/* Original and temporary handlers for SIGINT. */
static bool pager_sig_failed = FALSE;
/* Did sigaction() fail without changing the signal handlers? */
static bool pager_input_aborted = FALSE;
/* Did someone invoke the pager and abort it via ^C? */
bool setup_failed = FALSE;
/* Whether setting up the SIGINT handler failed. */
FILE *stream;
int thetty;
/* Things which need to be run regardless of whether
* we finished the stdin pipe correctly or not. */
void finish_stdin_pager(void)
{
FILE *f;
int ttystdin;
/* Read whatever we did get from stdin. */
f = fopen("/dev/stdin", "rb");
if (f == NULL)
nperror("fopen");
read_file(f, 0, "stdin", TRUE, FALSE);
openfile->edittop = openfile->fileage;
ttystdin = open("/dev/tty", O_RDONLY);
if (!ttystdin)
die(_("Couldn't reopen stdin from keyboard, sorry\n"));
dup2(ttystdin,0);
close(ttystdin);
if (!pager_input_aborted)
tcgetattr(0, &oldterm);
if (!pager_sig_failed && sigaction(SIGINT, &pager_oldaction, NULL) == -1)
nperror("sigaction");
terminal_init();
doupdate();
}
/* Cancel reading from stdin like a pager. */
RETSIGTYPE cancel_stdin_pager(int signal)
{
pager_input_aborted = TRUE;
}
/* Let nano read stdin for the first file at least. */
void stdin_pager(void)
{
/* Exit from curses mode and put the terminal into its original state. */
endwin();
if (!pager_input_aborted)
tcsetattr(0, TCSANOW, &oldterm);
tcsetattr(0, TCSANOW, &oldterm);
fprintf(stderr, _("Reading from stdin, ^C to abort\n"));
#ifndef NANO_TINY
@@ -1156,23 +1131,59 @@ void stdin_pager(void)
enable_signals();
#endif
/* Set things up so that SIGINT will cancel the new process. */
if (sigaction(SIGINT, NULL, &pager_newaction) == -1) {
pager_sig_failed = TRUE;
/* Set things up so that SIGINT will cancel the reading. */
if (sigaction(SIGINT, NULL, &newaction) == -1) {
setup_failed = TRUE;
nperror("sigaction");
} else {
pager_newaction.sa_handler = cancel_stdin_pager;
if (sigaction(SIGINT, &pager_newaction, &pager_oldaction) == -1) {
pager_sig_failed = TRUE;
newaction.sa_handler = make_a_note;
if (sigaction(SIGINT, &newaction, &oldaction) == -1) {
setup_failed = TRUE;
nperror("sigaction");
}
}
/* Open standard input. */
stream = fopen("/dev/stdin", "rb");
if (stream == NULL) {
int errnumber = errno;
terminal_init();
doupdate();
statusline(ALERT, _("Failed to open stdin: %s"), strerror(errnumber));
return FALSE;
}
/* Read the input into a new buffer. */
open_buffer("", FALSE);
finish_stdin_pager();
read_file(stream, 0, "stdin", TRUE, FALSE);
openfile->edittop = openfile->fileage;
/* Reconnect the tty as the input source. */
thetty = open("/dev/tty", O_RDONLY);
if (!thetty)
die(_("Couldn't reopen stdin from keyboard, sorry\n"));
dup2(thetty, 0);
close(thetty);
/* If things went well, store the current state of the terminal. */
if (!input_was_aborted)
tcgetattr(0, &oldterm);
/* If it was changed, restore the handler for SIGINT. */
if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
nperror("sigaction");
terminal_init();
doupdate();
if (!ISSET(VIEW_MODE) && openfile->totsize > 0)
set_modified();
return TRUE;
}
/* Initialize the signal handlers. */
/* Register half a dozen signal handlers. */
void signal_init(void)
{
/* Trap SIGINT and SIGQUIT because we want them to do useful things. */
@@ -1196,25 +1207,23 @@ void signal_init(void)
sigaction(SIGWINCH, &act, NULL);
#endif
/* Trap normal suspend (^Z) so we can handle it ourselves. */
if (!ISSET(SUSPEND)) {
act.sa_handler = SIG_IGN;
#ifdef SIGTSTP
sigaction(SIGTSTP, &act, NULL);
#endif
} else {
if (ISSET(SUSPEND)) {
/* Block all other signals in the suspend and continue handlers.
* If we don't do this, other stuff interrupts them! */
sigfillset(&act.sa_mask);
act.sa_handler = do_suspend;
#ifdef SIGTSTP
/* Trap a normal suspend (^Z) so we can handle it ourselves. */
act.sa_handler = do_suspend;
sigaction(SIGTSTP, &act, NULL);
#endif
act.sa_handler = do_continue;
#ifdef SIGCONT
act.sa_handler = do_continue;
sigaction(SIGCONT, &act, NULL);
#endif
} else {
#ifdef SIGTSTP
act.sa_handler = SIG_IGN;
sigaction(SIGTSTP, &act, NULL);
#endif
}
}
@@ -1243,21 +1252,13 @@ RETSIGTYPE do_suspend(int signal)
/* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm);
/* Trap SIGHUP and SIGTERM so we can properly deal with them while
* suspended. */
act.sa_handler = handle_hupterm;
#ifdef SIGHUP
sigaction(SIGHUP, &act, NULL);
#endif
sigaction(SIGTERM, &act, NULL);
/* Do what mutt does: send ourselves a SIGSTOP. */
#ifdef SIGSTOP
/* Do what mutt does: send ourselves a SIGSTOP. */
kill(0, SIGSTOP);
#endif
}
/* The version of above function that is bound to a key. */
/* Put nano to sleep (if suspension is enabled). */
void do_suspend_void(void)
{
if (ISSET(SUSPEND))
@@ -1277,14 +1278,14 @@ RETSIGTYPE do_continue(int signal)
#endif
#ifndef NANO_TINY
/* Perhaps the user resized the window while we slept. So act as if,
* and restore the terminal to its previous state in the process. */
regenerate_screen();
/* Perhaps the user resized the window while we slept. */
the_window_resized = TRUE;
#else
/* Restore the state of the terminal and redraw the whole screen. */
/* Put the terminal in the desired state again. */
terminal_init();
total_refresh();
#endif
/* Tickle the input routine so it will update the screen. */
ungetch(KEY_F0);
}
#ifndef NANO_TINY
@@ -1336,21 +1337,16 @@ void regenerate_screen(void)
SLsmg_reset_smg();
SLsmg_init_smg();
#else
/* Do the equivalent of what Minimum Profit does: Leave and
* immediately reenter curses mode. */
/* Do the equivalent of what Minimum Profit does: leave and immediately
* reenter curses mode. */
endwin();
doupdate();
#endif
/* Restore the terminal to its previous state. */
/* Put the terminal in the desired state again, recreate the subwindows
* with their (new) sizes, and redraw the contents of these windows. */
terminal_init();
/* Do the equivalent of what both mutt and Minimum Profit do:
* Reinitialize all the windows based on the new screen
* dimensions. */
window_init();
/* Redraw the contents of the windows that need it. */
total_refresh();
}
@@ -1364,9 +1360,7 @@ void allow_sigwinch(bool allow)
sigaddset(&winch, SIGWINCH);
sigprocmask(allow ? SIG_UNBLOCK : SIG_BLOCK, &winch, NULL);
}
#endif /* !NANO_TINY */
#ifndef NANO_TINY
/* Handle the global toggle specified in flag. */
void do_toggle(int flag)
{
@@ -1900,8 +1894,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
int main(int argc, char **argv)
{
int optchr;
ssize_t startline = 0, startcol = 0;
/* Target line and column when specified on the command line. */
#ifndef DISABLE_WRAPJUSTIFY
bool fill_used = FALSE;
/* Was the fill option used on the command line? */
@@ -1911,9 +1903,9 @@ int main(int argc, char **argv)
#endif
#endif
#ifdef ENABLE_MULTIBUFFER
bool old_multibuffer;
/* The old value of the multibuffer option, restored after we
* load all files on the command line. */
bool is_multibuffer;
/* The actual value of the multibuffer option, restored after
* we've loaded all files given on the command line. */
#endif
const struct option long_options[] = {
{"boldtext", 0, NULL, 'D'},
@@ -2436,13 +2428,12 @@ int main(int argc, char **argv)
if (matchbrackets == NULL)
matchbrackets = mallocstrcpy(NULL, "(<[{)>]}");
/* If whitespace wasn't specified, set its default value. If we're
* using UTF-8, it's Unicode 00BB (Right-Pointing Double Angle
* Quotation Mark) and Unicode 00B7 (Middle Dot). Otherwise, it's
* ">" and ".". */
/* If the whitespace option wasn't specified, set its default value. */
if (whitespace == NULL) {
#ifdef ENABLE_UTF8
if (using_utf8()) {
/* A tab is shown as a Right-Pointing Double Angle Quotation Mark
* (U+00BB), and a space as a Middle Dot (U+00B7). */
whitespace = mallocstrcpy(NULL, "\xC2\xBB\xC2\xB7");
whitespace_len[0] = 2;
whitespace_len[1] = 2;
@@ -2479,8 +2470,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Main: set up windows\n");
#endif
/* Initialize all the windows based on the current screen
* dimensions. */
/* Create the three subwindows, based on the current screen dimensions. */
window_init();
editwincols = COLS;
@@ -2536,90 +2526,58 @@ int main(int argc, char **argv)
fprintf(stderr, "Main: open file\n");
#endif
/* If there's a +LINE or +LINE,COLUMN flag here, it is the first
* non-option argument, and it is followed by at least one other
* argument, the filename it applies to. */
if (0 < optind && optind < argc - 1 && argv[optind][0] == '+') {
if (!parse_line_column(&argv[optind][1], &startline, &startcol))
statusline(ALERT, _("Invalid line or column number"));
optind++;
}
/* If one of the arguments is a dash, read text from standard input. */
if (optind < argc && !strcmp(argv[optind], "-")) {
stdin_pager();
set_modified();
optind++;
}
#ifdef ENABLE_MULTIBUFFER
old_multibuffer = ISSET(MULTIBUFFER);
is_multibuffer = ISSET(MULTIBUFFER);
SET(MULTIBUFFER);
/* Read all the files after the first one on the command line into
* new buffers. */
{
int i = optind + 1;
ssize_t iline = 0, icol = 0;
for (; i < argc; i++) {
/* If there's a +LINE or +LINE,COLUMN flag here, it is followed
* by at least one other argument: the filename it applies to. */
if (i < argc - 1 && argv[i][0] == '+') {
if (!parse_line_column(&argv[i][1], &iline, &icol))
statusline(ALERT, _("Invalid line or column number"));
} else {
/* If opening fails, don't try to position the cursor. */
if (!open_buffer(argv[i], FALSE))
continue;
/* If a position was given on the command line, go there. */
if (iline > 0 || icol > 0) {
do_gotolinecolumn(iline, icol, FALSE, FALSE);
iline = 0;
icol = 0;
}
#ifndef DISABLE_HISTORIES
else if (ISSET(POS_HISTORY)) {
ssize_t savedposline, savedposcol;
/* If edited before, restore the last cursor position. */
if (has_old_position(argv[i], &savedposline, &savedposcol))
do_gotolinecolumn(savedposline, savedposcol,
FALSE, FALSE);
}
#endif
}
/* Read the files mentioned on the command line into new buffers. */
while (optind < argc && (!openfile || ISSET(MULTIBUFFER))) {
ssize_t givenline = 0, givencol = 0;
bool dash = FALSE;
/* If there's a +LINE[,COLUMN] argument here, eat it up. */
if (optind < argc - 1 && argv[optind][0] == '+') {
if (!parse_line_column(&argv[optind++][1], &givenline, &givencol))
statusline(ALERT, _("Invalid line or column number"));
}
/* If the filename is a dash, read from standard input; otherwise,
* open the file; skip positioning the cursor if either failed. */
if (strcmp(argv[optind], "-") == 0) {
if (!scoop_stdin())
continue;
dash = TRUE;
optind++;
} else if (!open_buffer(argv[optind++], FALSE))
continue;
/* If a position was given on the command line, go there. */
if (givenline != 0 || givencol != 0)
do_gotolinecolumn(givenline, givencol, FALSE, FALSE);
#ifndef DISABLE_HISTORIES
else if (ISSET(POS_HISTORY) && !dash) {
ssize_t savedline, savedcol;
/* If edited before, restore the last cursor position. */
if (has_old_position(argv[optind - 1], &savedline, &savedcol))
do_gotolinecolumn(savedline, savedcol, FALSE, FALSE);
}
#endif
}
#endif /* ENABLE_MULTIBUFFER */
/* Now read the first file on the command line into a new buffer. */
if (optind < argc)
open_buffer(argv[optind], FALSE);
/* If all the command-line arguments were invalid files like directories,
* or if there were no filenames given, we didn't open any file. In this
* case, load a blank buffer. Also, unset view mode to allow editing. */
/* If no filenames were given, or all of them were invalid things like
* directories, then open a blank buffer and allow editing. Otherwise,
* switch from the last opened file to the next, that is: the first. */
if (openfile == NULL) {
open_buffer("", FALSE);
UNSET(VIEW_MODE);
}
#ifdef ENABLE_MULTIBUFFER
if (!old_multibuffer)
UNSET(MULTIBUFFER);
#endif
else
openfile = openfile->next;
/* If a starting position was given on the command line, go there. */
if (startline > 0 || startcol > 0)
do_gotolinecolumn(startline, startcol, FALSE, FALSE);
#ifndef DISABLE_HISTORIES
else if (ISSET(POS_HISTORY)) {
ssize_t savedposline, savedposcol;
/* If the file was edited before, restore the last cursor position. */
if (has_old_position(argv[optind], &savedposline, &savedposcol))
do_gotolinecolumn(savedposline, savedposcol, FALSE, FALSE);
}
if (!is_multibuffer)
UNSET(MULTIBUFFER);
#endif
#ifdef DEBUG
@@ -2632,7 +2590,7 @@ int main(int argc, char **argv)
#ifdef ENABLE_LINENUMBERS
int needed_margin = digits(openfile->filebot->lineno) + 1;
/* Only enable line numbers when there is enough room for them. */
/* Suppress line numbers when there is not enough room for them. */
if (!ISSET(LINE_NUMBERS) || needed_margin > COLS - 4)
needed_margin = 0;

View File

@@ -542,6 +542,11 @@ enum
/* This is an abbreviation for all menus except Help and YesNo. */
#define MMOST (MMAIN|MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MWRITEFILE|MINSERTFILE|\
MEXTCMD|MBROWSER|MWHEREISFILE|MGOTODIR|MFINDINHELP|MSPELL|MLINTER)
#ifndef NANO_TINY
#define MSOME MMOST
#else
#define MSOME MMAIN|MBROWSER
#endif
/* Basic control codes. */
#define TAB_CODE 0x09

View File

@@ -411,8 +411,7 @@ void update_the_statusbar(void)
/* Work around a cursor-misplacement bug in VTEs. */
wmove(bottomwin, 0, 0);
wnoutrefresh(bottomwin);
doupdate();
wrefresh(bottomwin);
/* Place the cursor at statusbar_x in the answer. */
column = base + statusbar_xplustabs();

View File

@@ -47,6 +47,8 @@ extern int editwincols;
extern bool have_palette;
#endif
extern bool suppress_cursorpos;
extern message_type lastmessage;
extern filestruct *pletion_line;
@@ -119,8 +121,6 @@ extern char *quoteerr;
extern char *word_chars;
extern bool nodelay_mode;
extern char *answer;
extern ssize_t tabsize;
@@ -677,8 +677,8 @@ void spotlight(bool active, const char *word);
void xon_complaint(void);
void xoff_complaint(void);
void do_suspend_void(void);
void enable_nodelay(void);
void disable_nodelay(void);
void disable_waiting(void);
void enable_waiting(void);
#ifndef DISABLE_EXTRA
void do_credits(void);
#endif

View File

@@ -350,7 +350,9 @@ bool is_universal(void (*func))
{
if (func == do_left || func == do_right ||
func == do_home_void || func == do_end_void ||
#ifndef NANO_TINY
func == do_prev_word_void || func == do_next_word_void ||
#endif
func == do_verbatim_input || func == do_cut_text_void ||
func == do_delete || func == do_backspace ||
func == do_tab || func == do_enter)

View File

@@ -234,8 +234,10 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
size_t found_x;
/* The x coordinate of a found occurrence. */
time_t lastkbcheck = time(NULL);
/* The time we last looked at the keyboard. */
enable_nodelay();
/* Set non-blocking input so that we can just peek for a Cancel. */
disable_waiting();
if (begin == NULL)
came_full_circle = FALSE;
@@ -252,7 +254,7 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
while (input) {
if (func_from_key(&input) == do_cancel) {
statusbar(_("Cancelled"));
disable_nodelay();
enable_waiting();
return -2;
}
input = parse_kbinput(NULL);
@@ -303,7 +305,7 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
/* If we're back at the beginning, then there is no needle. */
if (came_full_circle) {
not_found_msg(needle);
disable_nodelay();
enable_waiting();
return 0;
}
@@ -317,7 +319,7 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
* but stop when spell-checking or replacing in a region. */
if (line == NULL) {
if (whole_word_only || have_region) {
disable_nodelay();
enable_waiting();
return 0;
}
@@ -343,16 +345,15 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
found_x = found - line->data;
enable_waiting();
/* Ensure that the found occurrence is not beyond the starting x. */
if (came_full_circle && ((!ISSET(BACKWARDS_SEARCH) && found_x > begin_x) ||
(ISSET(BACKWARDS_SEARCH) && found_x < begin_x))) {
not_found_msg(needle);
disable_nodelay();
return 0;
}
disable_nodelay();
/* Set the current position to point at what we found. */
openfile->current = line;
openfile->current_x = found_x;
@@ -361,8 +362,11 @@ int findnextstr(const char *needle, bool whole_word_only, bool have_region,
if (match_len != NULL)
*match_len = found_len;
if (feedback > 0)
/* Wipe the "Searching..." message and unset the suppression flag. */
if (feedback > 0) {
blank_statusbar();
suppress_cursorpos = FALSE;
}
return 1;
}
@@ -855,10 +859,10 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
return;
}
} else {
if (line < 1)
if (line == 0)
line = openfile->current->lineno;
if (column < 1)
if (column == 0)
column = openfile->placewewant + 1;
}

View File

@@ -1140,7 +1140,9 @@ bool execute_command(const char *command)
void discard_until(const undo *thisitem, openfilestruct *thefile)
{
undo *dropit = thefile->undotop;
#ifdef ENABLE_COMMENT
undo_group *group;
#endif
while (dropit != NULL && dropit != thisitem) {
thefile->undotop = dropit->next;
@@ -2446,10 +2448,8 @@ void do_justify(bool full_justify)
} while (kbinput == KEY_WINCH);
#endif
/* If needed, unset the cursor-position suppression flag, so the cursor
* position /will/ be displayed upon a return to the main loop. */
if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE);
/* Unset the suppression flag after showing the Unjustify message. */
suppress_cursorpos = FALSE;
func = func_from_key(&kbinput);
@@ -3566,7 +3566,7 @@ void do_verbatim_input(void)
/* Unsuppress cursor-position display or blank the statusbar. */
if (ISSET(CONSTANT_SHOW))
do_cursorpos(FALSE);
suppress_cursorpos = FALSE;
else {
blank_statusbar();
wnoutrefresh(bottomwin);

View File

@@ -45,10 +45,10 @@ static size_t key_buffer_len = 0;
/* The length of the keystroke buffer. */
static bool solitary = FALSE;
/* Whether an Esc arrived by itself -- not as leader of a sequence. */
static bool waiting_mode = TRUE;
/* Whether getting a character will wait for a key to be pressed. */
static int statusblank = 0;
/* The number of keystrokes left before we blank the statusbar. */
static bool suppress_cursorpos = FALSE;
/* Should we skip constant position display for one keystroke? */
#ifdef USING_OLD_NCURSES
static bool seen_wide = FALSE;
/* Whether we've seen a multicolumn character in the current line. */
@@ -135,7 +135,7 @@ void get_key_buffer(WINDOW *win)
}
#endif
if (input == ERR && nodelay_mode)
if (input == ERR && !waiting_mode)
return;
while (input == ERR) {
@@ -144,7 +144,7 @@ void get_key_buffer(WINDOW *win)
* check if errno is set to EIO ("Input/output error") and die in
* that case, but it's not always set properly. Argh. */
if (++errcount == MAX_BUF_SIZE)
handle_hupterm(0);
die(_("Too many errors from stdin"));
#ifndef NANO_TINY
if (the_window_resized) {
@@ -188,7 +188,7 @@ void get_key_buffer(WINDOW *win)
}
/* Restore waiting mode if it was on. */
if (!nodelay_mode)
if (waiting_mode)
nodelay(win, FALSE);
#ifdef DEBUG
@@ -327,7 +327,7 @@ int parse_kbinput(WINDOW *win)
/* Read in a character. */
kbinput = get_input(win, 1);
if (kbinput == NULL && nodelay_mode)
if (kbinput == NULL && !waiting_mode)
return 0;
while (kbinput == NULL)
@@ -703,8 +703,9 @@ int parse_kbinput(WINDOW *win)
#ifdef KEY_RESIZE
/* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */
case KEY_RESIZE:
return ERR;
#endif
case KEY_F0:
return ERR;
}
return retval;
@@ -2070,8 +2071,7 @@ void titlebar(const char *path)
wattroff(topwin, interface_color_pair[TITLE_BAR]);
wnoutrefresh(topwin);
doupdate();
wrefresh(topwin);
}
/* Display a normal message on the statusbar, quietly. */
@@ -2163,8 +2163,7 @@ void statusline(message_type importance, const char *msg, ...)
wattroff(bottomwin, interface_color_pair[STATUS_BAR]);
/* Push the message to the screen straightaway. */
wnoutrefresh(bottomwin);
doupdate();
wrefresh(bottomwin);
suppress_cursorpos = TRUE;
@@ -2242,8 +2241,7 @@ void bottombars(int menu)
/* Defeat a VTE bug by moving the cursor and forcing a screen update. */
wmove(bottomwin, 0, 0);
wnoutrefresh(bottomwin);
doupdate();
wrefresh(bottomwin);
}
/* Write a shortcut key to the help area at the bottom of the window.
@@ -3145,17 +3143,19 @@ void total_redraw(void)
#endif
}
/* Unconditionally redraw the entire screen, and then refresh it using
* the current file. */
/* Redraw the entire screen, then refresh the title bar and the content of
* the edit window (when not in the file browser), and the bottom bars. */
void total_refresh(void)
{
total_redraw();
titlebar(title);
if (currmenu != MBROWSER && currmenu != MWHEREISFILE && currmenu != MGOTODIR)
titlebar(title);
#ifdef ENABLE_HELP
if (inhelp)
wrap_the_help_text(TRUE);
else
#endif
if (currmenu != MBROWSER && currmenu != MWHEREISFILE && currmenu != MGOTODIR)
edit_refresh();
bottombars(currmenu);
}
@@ -3185,7 +3185,14 @@ void do_cursorpos(bool force)
size_t cur_lenpt = strlenpt(openfile->current->data) + 1;
int linepct, colpct, charpct;
assert(openfile->fileage != NULL && openfile->current != NULL);
/* If the showing needs to be suppressed, don't suppress it next time. */
if (suppress_cursorpos && !force) {
suppress_cursorpos = FALSE;
return;
}
/* Hide the cursor while we are calculating. */
curs_set(0);
/* Determine the size of the file up to the cursor. */
saved_byte = openfile->current->data[openfile->current_x];
@@ -3199,12 +3206,6 @@ void do_cursorpos(bool force)
if (openfile->current != openfile->filebot)
sum--;
/* If the showing needs to be suppressed, don't suppress it next time. */
if (suppress_cursorpos && !force) {
suppress_cursorpos = FALSE;
return;
}
/* Display the current cursor position on the statusbar. */
linepct = 100 * openfile->current->lineno / openfile->filebot->lineno;
colpct = 100 * cur_xpt / cur_lenpt;
@@ -3227,15 +3228,15 @@ void do_cursorpos_void(void)
do_cursorpos(TRUE);
}
void enable_nodelay(void)
void disable_waiting(void)
{
nodelay_mode = TRUE;
waiting_mode = FALSE;
nodelay(edit, TRUE);
}
void disable_nodelay(void)
void enable_waiting(void)
{
nodelay_mode = FALSE;
waiting_mode = TRUE;
nodelay(edit, FALSE);
}

View File

@@ -1,11 +1,17 @@
## A default syntax, which is used
## for files that do not match any other syntax.
## An example of a default syntax. The default syntax is used for
## files that do not match any other syntax.
syntax "default"
comment "#"
# Comments.
color cyan "^[[:space:]]*#.*"
# Spaces in front of tabs.
color ,red " + +"
# Nano's name, including version.
color brightred "(GNU )?nano [1-9]\.[0-9]\.[^[:space:][:punct:]]+"
# Email addresses.
color yellow "<[[:alnum:].%_+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,}>"

View File

@@ -13,10 +13,10 @@ color white "\<[a-z_]*\("
color cyan "\$[a-z_]+"
# Types.
color green "\<(array|bool|callable|const|float|global|int|object|static|string|var)\>"
color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>"
# Directives and structure.
color brightyellow "\<(abstract|as|class|clone|declare|enddeclare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|trait|use|yield)\>"
color brightyellow "\<(abstract|as|class|clone|(end)?declare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|static|trait|use|yield)\>"
color brightyellow "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>"
# Operators.
color brightyellow "\<(and|or|xor)\>"