Commit Graph

1499 Commits (399a024857a0d72a11dcfa747d6387d90698b97b)

Author SHA1 Message Date
Benno Schulenberg 399a024857 minibar: suppress the toggling feedback for M-C, but show it for M-Y/M-P
In addition, suppress the feedback for M-C also when --minibar
isn't used, as the feedback obscures the effect of the toggle:
showing information about the cursor position on the status bar.

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

Bug existed since commit 7545eb5b from one week ago.
2021-02-08 10:27:29 +01:00
Benno Schulenberg 7bf253702e options: remove --markmatch and 'set markmatch', as the behavior is gone 2021-02-07 09:18:15 +01:00
Benno Schulenberg 37717baeed search: just highlight the found occurrence, instead of marking it
Requested-by: Peter Passchier <peter@passchier.net>
2021-02-07 09:18:15 +01:00
Benno Schulenberg 7545eb5bbf minibar: show the state flags only when --stateflags is used
For users who always have auto-indent or hardwrap or softwrap on
and do not need to see this continuously advertised at the bottom.
2021-02-02 11:10:09 +01:00
Benno Schulenberg e0a4ee0148 scrolling: keep centering after large paste, also when line numbers widen
If a paste (or insertion) is more than a screenful, it will not set
'focusing' to FALSE.  In that case, and when line numbers are already
active, then 'focusing' should be kept set to TRUE, despite it getting
set to FALSE by ensure_firstcolumn_is_aligned().  That latter action
is meant to cushion size changes of the edit window, but in this case
the large paste (or insertion) should trump the size change.

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

Bug existed since version 2.8.3, commit 2b385478.
2021-02-01 12:42:55 +01:00
Benno Schulenberg 9bd7d62c10 tweaks: do not change the pointer, but move the content of the string 2021-01-11 19:22:40 +01:00
Benno Schulenberg 735a608e80 speller: strip leading whitespace from command, to avoid a sneaky crash
This completes the fix for https://savannah.gnu.org/bugs/?59855.
2021-01-11 19:15:35 +01:00
Benno Schulenberg 6360e4170a copyright: update the years for the FSF 2021-01-11 14:22:51 +01:00
Benno Schulenberg e66c7d0f8d tweaks: put the new options in a consistent order in the code 2021-01-07 14:27:49 +01:00
Benno Schulenberg 7b9567719c tweaks: reshuffle an option, to have two related ones grouped together
Options --stateflags and --minibar are slightly related; it looks
better to not have them separated by an unrelated option.
2021-01-07 14:27:49 +01:00
Benno Schulenberg 04d33e7981 tweaks: reword the description of an option
Avoid using the word "state" in the description of --minibar,
as it could cause confusion with the --stateflags option.
2021-01-07 14:27:49 +01:00
Benno Schulenberg 7b48458380 minibar: suppress some elements when there is no room to show them
This fixes https://savannah.gnu.org/bugs/?59767.

Bug existed since last week, since the mini-bar code was merged.
2020-12-29 15:54:28 +01:00
Benno Schulenberg d0bceb1449 options: add --markmatch and -^ for activating the select-match behavior
And add, of course, the 'set markmatch' nanorc option.
2020-12-24 11:49:22 +01:00
Benno Schulenberg caef3128eb search: suppress the cursor when highlighting a match
Having a block cursor present when highlighting a match...
does not look nice.  So... hide the cursor until the next
keystroke, unless --showcursor or 'set showcursor' is used.
2020-12-24 11:49:22 +01:00
Benno Schulenberg b86f7868d1 feedback: differentiate between remarks, mistakes, and information
Remarks are about unsurprising things but it's good to give feedback
on them; "mistakes" are unexpected things, and get colored like an
error; and information is something that the user requested and thus
needs to stay on the status bar until the next keystroke.
2020-12-23 12:17:06 +01:00
Benno Schulenberg b89bc2cce6 minibar: show the info bar again some 0.8 seconds after a message
Instead of redisplaying the minibar only upon the next keystroke
(when some feedback message is shown on the status bar), time the
waiting for the keystroke out after four fifths of a second, then
redisplay the minibar and continue the wait.
2020-12-23 12:17:06 +01:00
Benno Schulenberg 8f24ffaaef options: add --minibar and -_ for activating basic state-information bar 2020-12-23 12:17:05 +01:00
Benno Schulenberg d31cc373de display: add code for showing minimal state-information bar at the bottom
When activated, it suppresses the title bar, and suppresses feedback
on the status bar for toggles whose effect is obvious or whose state
is already shown in the minibar.

This addresses https://savannah.gnu.org/bugs/?58152,
and addresses https://savannah.gnu.org/bugs/?58789.
2020-12-23 12:17:05 +01:00
OIX d1c412d200 mouse: update title bar (the M flag) when the click is on the cursor
Clicking on the cursor toggles the mark, meaning that the flags in
the title bar should be updated when --stateflags is active.

This fixes https://savannah.gnu.org/bugs/?59747.
Indirectly-reported-by: ObeliX <ObeliX-@gmx.de>

Signed-off-by: OIX <ObeliX-@gmx.de>
2020-12-22 14:21:28 +01:00
Benno Schulenberg 96e4fec31c tweaks: use a boolean instead of an enumeration of two values 2020-12-19 16:40:21 +01:00
Benno Schulenberg b87d7f69fc options: accept 'set promptcolor' for setting the color of the prompt bar
When it is not specified, it defaults to the value for 'titlecolor'.
2020-12-06 16:34:42 +01:00
Benno Schulenberg 7ebf5f52b8 tweaks: clean up after the previous change 2020-12-05 12:12:11 +01:00
Benno Schulenberg 4f7593b704 general: remove support for Slang
Slang has too many bugs to be useful.

This addresses https://savannah.gnu.org/bugs/?59210.
2020-12-05 11:57:08 +01:00
Benno Schulenberg 16dff06a4c tweaks: simplify a bit of logic 2020-12-04 16:27:34 +01:00
Benno Schulenberg 743100feab options: do not spew out the help text when an option is not recognized
When getopt() does not recognize an option, it returns '?', which means
that '-?' cannot be used as a valid option because any invalid option
would be treated the same way as '-?'.

Spewing out the full help text drowns the "invalid option" message at
the beginning.

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

Bug existed since version 5.3, commit 5bd92d4c.
2020-11-24 10:09:41 +01:00
Benno Schulenberg 925a1a11f9 feedback: abort when user tries to open multiple files in tiny version
This fixes https://savannah.gnu.org/bugs/?56227.
2020-11-17 19:08:12 +01:00
Benno Schulenberg e1601d2eb5 tweaks: use the standard symbols for the three standard file descriptors
Also, take into account (as elsewhere) that dup2() could fail,
and harmonize their error checks.
2020-10-10 12:32:02 +02:00
Benno Schulenberg 1572248866 build: exclude the three --help column headers from the tiny version 2020-10-03 12:15:38 +02:00
Benno Schulenberg d26916199b tweaks: reshuffle some lines after the previous change 2020-10-03 11:58:43 +02:00
Benno Schulenberg 2e9fb7d840 build: exclude option --tabsize (-T) from the tiny version
An unneeded option when wanting nano to be small.  Excluding it saves
roughly 120 bytes.  It also makes the output of --help nice and clean.
2020-10-03 11:25:43 +02:00
Benno Schulenberg a4e3d88c67 version: remove URL and email address from the --version output
Web links and email addresses do not belong in the version information.
This has bothered me for a long time.  The URL is in the man page, and
bug reports should go to Savannah.
2020-10-02 10:23:40 +02:00
Benno Schulenberg 072c8aa39b options: move --stateflags (-%) and --magic (-!) to the end of the list
It's nicer to start the list with -A, -B, -C.  And, when the user
does 'nano --help', these new flags are more likely to be noticed.
2020-10-01 11:24:39 +02:00
Benno Schulenberg 5bd92d4c60 options: add -? as a synonym of -h (--help), but leave it undocumented
This option was lost six years ago in commit 43019189, without giving a
reason for it.  It's not really needed, but it doesn't hurt to have it.
2020-10-01 10:45:22 +02:00
Benno Schulenberg d6c194265f build: exclude excessive version information from the tiny version
The tiny version is about being tiny.  Copyright information and
website links are not essential.
2020-10-01 10:44:37 +02:00
Benno Schulenberg 58a3293efc options: require --magic or 'set magic' to enable the use of libmagic
Trying to determine which syntax to apply with the help of libmagic
can be a somewhat time-consuming and yet often still fruitless affair.
Therefore using libmagic should not be the default; it should require
an option to tell nano to try using libmagic when it can't determine
the applicable syntax from the file's name or first line.

This is better than having a --nomagic option (and using libmagic by
default), because when the user has 'set nomagic' in their nanorc or
--nomagic in their alias, then switching the use of libmagic back on
is troublesome.  But with --magic (and not using libmagic by default),
when nano fails to recognize a file, it is a simple ^X, add -! to the
command line, and restart.

The short form of the option is -! because we have run out of letters.

This addresses https://savannah.gnu.org/bugs/?59028.
2020-09-25 16:34:01 +02:00
Benno Schulenberg d679bbc802 new feature: option --stateflags to show some states in top-right corner
With --stateflags (short form: -%) or 'set stateflags', nano reserves
the righthand end of the title bar not for showing "Modified" but for
showing the state of auto-indentation (I), the mark (M), the breaking
of long lines (L), macro recording (R), and softwrapping (S).

When the buffer is modified, this is indicated with a star (*) after
the file name (shown in the center of the title bar).

This fulfills https://savannah.gnu.org/bugs/?57953.
Requested-by: Sébastien Desreux <seb@h-k.fr>
2020-09-23 19:48:03 +02:00
Benno Schulenberg c3e74f02c2 build: exclude --emptyline, --jumpyscrolling, and --noread from tiny nano
When looking at the output of 'nano --help', why confuse the user with
a cosmetic option, an awkward behavioral one, and an obscure one?
2020-09-21 19:02:07 +02:00
Benno Schulenberg 89f8d71001 feedback: don't give a hint for <Bsp>, and not after an Alt+key was used 2020-09-19 12:15:07 +02:00
Benno Schulenberg 37f1d43ce3 tweaks: elide a one-line function, after reducing it to a single call 2020-09-18 15:22:12 +02:00
Benno Schulenberg cb841de3fc feedback: make an "Unbound key" message disappear on the next keystroke
When nano reports "Unbound key" or "Unknown sequence", this message
should stay onscreen only for the relevant keystroke, not for any
succeeding keystroke.

This addresses https://savannah.gnu.org/bugs/?59119.

Bug existed since before version 2.0.6.
2020-09-17 19:36:04 +02:00
Benno Schulenberg e12f397140 build: do not let Slang translate escape sequences to key codes
Slang fails to translate the longer sequences, and then truncates
these sequences to just four bytes, effectively destroying them.

Therefore, when built with --with-slang, always activate --raw-sequences.

This avoids https://savannah.gnu.org/bugs/?49771.

Bug was visible since version 2.5.0, since bindings
for Ctrl+Left/Ctrl+Right were added.
2020-09-17 16:54:41 +02:00
Benno Schulenberg e8abbc7045 build: stop using an obsolete macro, and use 'void' for signal handlers
The Autoconf manual says that 'AC_TYPE_SIGNAL' is obsolete and
that it is fine to simply use 'void' instead of 'RETSIGTYPE'.
2020-09-16 16:27:32 +02:00
Benno Schulenberg 93b25ce014 tweaks: adjust some whitespace in the docs, and improve a comment 2020-09-12 12:21:24 +02:00
Benno Schulenberg f883465263 build: exclude reading a file from standard input from the tiny version
The tiny version is about being small, not about convenience features
that hardly anyone uses anyway.

Also exclude the description of the "+line[,column]" feature -- it is
unneeded verbosity.

This addresses https://savannah.gnu.org/bugs/?59101.
2020-09-12 11:44:22 +02:00
Benno Schulenberg b9a1a586c0 display: force the cursor to reappear in a better way (when using Slang)
The cursor would disappear after any message on the status bar --
for example, also when M-W is typed and nothing is found -- so the
mitigation trick needs to be performed in statusline() itself.

This addresses https://savannah.gnu.org/bugs/?59091.
2020-09-11 18:54:49 +02:00
Benno Schulenberg d2d0c665b1 display: force the cursor to reappear after a message (when using Slang)
For some reason, when running a tiny nano built with Slang on the bterm
of a Debian installer image, the cursor disappears when certain things
are written to the status bar.  Make the cursor reappear by rewriting
the two help lines with dummy items (and then rewriting it again with
the normal menu in the central loop).  Of course, this does not help
when the user uses -x or --nohelp to suppress the help lines, but at
least in the default setup the cursor doesn't get hidden now and then.

This mitigates https://savannah.gnu.org/bugs/?59091.

Bug existed since before version 2.2.4.
2020-09-10 18:46:48 +02:00
Benno Schulenberg dd24f6a18d suspension: resume properly from an external SIGSTOP (when using Slang)
Slang apparently needs a call to SLsmg_refresh() to restore the screen
content and put the cursor in the right place.  But call this function
only when the suspension was actually caused by an external SIGSTOP,
because otherwise the original screen (from which nano was invoked)
gets plastered with nano's interface and content -- upon exit, this
is annoying and confusing.

Do not stuff a dummy keystroke into the input stream, as it seems to
get placed *after* the first byte of the next keystroke from the user.
That would cause an "Unknown sequence" for some keystrokes.

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

Bug existed since version 2.8.5, commit 84ff9ebb.
2020-09-08 16:54:06 +02:00
Benno Schulenberg 462e9d4822 suspension: switch off flow control at the right moment (for Slang)
This fixes https://savannah.gnu.org/bugs/?59078.

Bug existed since version 4.8, commit c09e96f2.
2020-09-08 09:15:12 +02:00
Benno Schulenberg 9f20fadee1 tweaks: normalize the indentation after the previous change 2020-09-07 11:44:29 +02:00
Benno Schulenberg 0f7a309adc suspension: properly resume from an external SIGSTOP
Trying to ignore an external SIGSTOP/SIGTSTP with SIG_IGN does not work,
so always install the SIGCONT handler so that it is possible to continue
from a SIGSTOP.

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

Bug existed since before version 2.0.6.
2020-09-07 11:26:04 +02:00