Commit Graph

9044 Commits

Author SHA1 Message Date
Benno Schulenberg
f21508f071 tweaks: improve some comments, and reshuffle an assignment 2020-07-03 19:10:48 +02:00
Benno Schulenberg
2c228796a8 docs: improve some descriptions concerning the file browser 2020-07-03 18:45:09 +02:00
Benno Schulenberg
a84653dc19 feedback: show the cursor position also at startup in an empty buffer
When using --constantshow and --nohelp and opening a new buffer,
the cursor location should be shown on the status bar right away.

Bug existed since commit 2e688640 from a few hours ago.
2020-07-03 13:03:44 +02:00
Benno Schulenberg
1388af2bdc tweaks: elide a wrapper function, by checking a precondition earlier 2020-07-03 12:41:40 +02:00
Benno Schulenberg
2e6886406c tweaks: elide an unneeded global variable
The constant cursor display must be suppressed whenever a message
was printed to the status bar.  That is: whenever 'lastmessage' is
something other than 'VACUUM'.
2020-07-03 12:41:40 +02:00
Benno Schulenberg
80ff5e76d6 help: pair the items in the two bottom lines better in the tiny version
This fixes https://savannah.gnu.org/bugs/?58693.

Bug existed since commit 9b8930cc from ten days ago.
2020-07-03 11:28:41 +02:00
Benno Schulenberg
1a2d0c1770 scrolling: add a function and a key binding to center the cursor line
By default, this function is bound to ^L, to make that keystroke do
something actually useful.  To not lose the Refresh function that this
keystroke had, the centering function additionally does a full redraw
and refresh of the screen.
2020-07-02 11:11:44 +02:00
Benno Schulenberg
eb413a99f2 tweaks: do not use the string "stat()" in any of the comments 2020-06-30 10:56:37 +02:00
Benno Schulenberg
fcb9e58b2d history: take into account that statting a file can fail too 2020-06-30 10:53:28 +02:00
Benno Schulenberg
675a8e4899 history: take into account that closing a file can fail 2020-06-29 13:47:20 +02:00
Benno Schulenberg
3344571227 tweaks: reshuffle some conditions, to straighten the logic 2020-06-29 12:39:46 +02:00
Benno Schulenberg
f9b1306adf tweaks: normalize the indentation after the previous change 2020-06-29 12:35:17 +02:00
Benno Schulenberg
722467cb6b tweaks: add four early returns for read/write errors of history files
Also rewrap a comment and rename a variable.
2020-06-29 12:23:59 +02:00
Benno Schulenberg
b3b3d04552 tweaks: rename a variable, to better fit related ones
Since commit c16e79b6 from nearly three years ago, the string "histfile"
does not occur in other variables any more, so it is fine to use it.
2020-06-29 12:04:15 +02:00
Benno Schulenberg
b9e3e4edb8 history: don't send error messages to the screen; store them in the queue 2020-06-29 11:56:36 +02:00
Benno Schulenberg
2d204bcbfd rcfile: restore terminal settings when exiting upon excessive unbindings
This fixes https://savannah.gnu.org/bugs/?58671.

Bug existed since commit 24cdf78a from two weeks ago.
2020-06-29 11:25:57 +02:00
Benno Schulenberg
3e609ee4c7 rcfile: complain when an essential key binding is missing
This fixes https://savannah.gnu.org/bugs/?58670.

Bug existed since commit 009fb2fa from two days ago.
2020-06-29 11:09:12 +02:00
Benno Schulenberg
13327203e0 build: use a more dependable method for detecting a build from git
The Haiku recipe seems to detect a .git directory somewhere, even though
they are building from a tarball.  So, check instead for the presence of
nano's release script, which ought to be present only in a git checkout,
not in a released tarball.
2020-06-28 15:21:04 +02:00
Benno Schulenberg
da0ac58ecc docs: document the new -O/--bookstyle and 'set bookstyle' options 2020-06-27 11:12:21 +02:00
Benno Schulenberg
712f68c697 options: add -O/--bookstyle to make leading whitespace mean new paragraph
Before version 2.9.8, nano would consider any line that started with
leading whitespace as the beginning of a new paragraph, and would thus
be unable to justify an indented piece of text (unless autoindent was
switched on).  I thought that this was too limiting and changed the
way nano detects and parses paragraphs.  It works fine in texts where
paragraphs occupy multiple lines, but breaks down for paragraphs of
a single line: nano merges those with adjoining lines.

Now, when -O or --bookstyle or 'set bookstyle' is used, nano will again
consider a line that begins with whitespace as the start of a paragraph
-- when 'autoindent' is OFF.

This addresses https://savannah.gnu.org/bugs/?57402.
Indirectly-reported-by: Sébastien Desreux <seb@h-k.fr>
Also-reported-by: Bill Kendrick <nbs@sonic.net>
2020-06-27 11:12:21 +02:00
Benno Schulenberg
331bd7662e tweaks: delete a now-unused function 2020-06-27 10:23:03 +02:00
Benno Schulenberg
009fb2fae6 tweaks: make three hard-bindings of special keys more efficiently
Instead of calling a function that tries to find the relevant operation,
just add three hidden hard-bindings at the end of the shortcuts list.

They are hidden because we don't want them to show up in the help text,
because we don't know what to call them (as a Cancel and Suspend key
don't exist on normal keyboards) or naming the key would be confusing
(Sh-Ins is grabbed by the desktop manager and doesn't reach nano).
2020-06-27 10:20:45 +02:00
Benno Schulenberg
7fa6e95ce1 tweaks: avoid a function call when a simple boolean will do 2020-06-26 19:44:19 +02:00
Benno Schulenberg
8bce70e038 tweaks: rename a variable, to better describe what it holds 2020-06-26 19:27:28 +02:00
Benno Schulenberg
b55153524a tweask: adjust the indentation after the previous change
Also improve a comment.
2020-06-26 19:18:05 +02:00
Benno Schulenberg
a9ce488cc5 tweaks: drop a superfluous check for a non-zero length
The get_history_completion() function is called in just one place,
and gets called only when the length parameter is larger than zero.

Also, improve a few comments.
2020-06-26 19:07:47 +02:00
Benno Schulenberg
8061a981b1 tweaks: correct two spelling mistakes [codespell] 2020-06-26 11:27:07 +02:00
Benno Schulenberg
e64c950896 tweaks: close opened files when something goes wrong [coverity] 2020-06-26 10:24:52 +02:00
Benno Schulenberg
69b12d907e tweaks: avoid unneeded calls of free() by reallocating the full name 2020-06-26 09:57:38 +02:00
Benno Schulenberg
c0c4a1b2b5 tweaks: plug a leak, by always freeing the full filename [valgrind] 2020-06-26 09:47:38 +02:00
Benno Schulenberg
18659f3485 build: fix the Makefile after two header files were renamed
Reported-by: Kamil Dudka <kdudka@redhat.com>
2020-06-25 21:11:26 +02:00
Benno Schulenberg
94f49e208f tabbing: beep at the first listing, and when there are zero possibilities
A successful single completion is silent, but when there are zero
or multiple possibilities, nano beeps.
2020-06-25 10:26:01 +02:00
Benno Schulenberg
3f63982593 tweaks: rewrap a few lines in old news items, for more balanced lines 2020-06-25 10:09:13 +02:00
Benno Schulenberg
7f77cad1b4 tweaks: condense the code a little further, by grouping things better 2020-06-25 10:03:56 +02:00
Benno Schulenberg
e7511abd86 tweaks: avoid checking a variable three times for each pass in the loop 2020-06-25 09:57:41 +02:00
Benno Schulenberg
b1b89f01b7 docs: mention that M-X toggle is special, because available in most menus 2020-06-24 09:30:08 +02:00
Benno Schulenberg
24740815f6 files: make better use of the last row when there are many completions
Put the "(more)" not in the first column of the last row but in the
last column.
2020-06-23 08:28:47 +02:00
Benno Schulenberg
c7356c2d85 files: show possible tab completions near the bottom of the edit window
Especially when it are just a handful of possible completions, it is
much nicer to have them listed close to the prompt bar where the eyes
of the user are.

This fulfills https://savannah.gnu.org/bugs/?58620.
2020-06-23 08:28:47 +02:00
Benno Schulenberg
91ba76e1e0 tweaks: normalize the indentation after the previous change
Also, improve five comments.
2020-06-23 08:28:47 +02:00
Benno Schulenberg
3dcabd6d03 tweaks: make an early return for zero matches, and rename a variable 2020-06-23 08:28:47 +02:00
Benno Schulenberg
0f843b007a tweaks: avoid an unnecessary refresh for zero or just one completion 2020-06-23 08:28:47 +02:00
Benno Schulenberg
ff11ab6b66 files: list possible completions after just one <Tab> instead of two
This gives quicker feedback, and spares the user unnecessary beeps
and typing.  Also, now a beep after a <Tab> means just one thing:
there are NO completions.

This fulfills https://savannah.gnu.org/bugs/?58627.
2020-06-23 08:28:47 +02:00
Benno Schulenberg
096e36279f build: fix compilation for --enable-tiny --enable-color --enable-nanorc 2020-06-22 14:03:48 +02:00
Benno Schulenberg
5eb3b8feb5 tweaks: add a helpful message for when pkg.m4 is missing during a build 2020-06-22 14:03:32 +02:00
Benno Schulenberg
f601eeda57 build: fix compilation when configured with --disable-color 2020-06-22 12:49:04 +02:00
Benno Schulenberg
2430c5b230 build: allow compilation to succeed on curses without italic support
The OpenBSD system that I have access to still uses ncurses-5.7,
and support for A_ITALIC appeared in version 6.0.
2020-06-22 11:19:05 +02:00
Benno Schulenberg
9b8930cc13 tweaks: adjust the conditional help-item pairing for absence of speller
The Spell Checker is no longer among the first twelve items of the
main menu, so the conditional placing of the Go To Line item should
no longer depend on it.
2020-06-22 09:09:05 +02:00
Benno Schulenberg
0f0b620c65 build: fix compilation when configured with --disable-speller
Move two functions that are used by the formatter too
to between the proper #ifdef.

Problem existed since commit 8089f5ad from a month ago.
2020-06-22 08:42:49 +02:00
Benno Schulenberg
a7aab18dfe colors: move purple one step away from magenta, and use a darker mauve 2020-06-21 19:21:07 +02:00
Benno Schulenberg
a9e171de52 tweaks: update three translator hints, add two, and frob three strings 2020-06-21 14:10:37 +02:00