Commit Graph

1652 Commits (b5448615b952aced295da1f401430a6c97ded7f0)

Author SHA1 Message Date
Benno Schulenberg c75a3839da tweaks: elide a small function that is used just once 2021-04-07 17:08:05 +02:00
Benno Schulenberg 09e4c86606 tweaks: improve a couple of comments 2021-04-07 12:28:48 +02:00
Benno Schulenberg 20eb422829 tweaks: avoid converting a file name for more than will fit on screen 2021-04-07 12:12:06 +02:00
Benno Schulenberg 90c6b572d0 display: avoid determining twice from and until where to draw each row
The two calls of draw_row() are each immediately preceded by a call to
display_string(), which has already determined from which x position
and until which x position in the relevant line the current row will
be drawn -- doing this again in draw_row() is a waste of time.  Even
though it is ugly, pass the two data points from one function to the
other via global variables.

For normal files (without overlong lines), this saves on average some
fifty calls of advance_over() per row.  When softwrapping a file with
overlong lines, the savings for each softwrapped chunk are much higher.
2021-04-07 11:27:10 +02:00
Benno Schulenberg 712b574fb7 tweaks: rename a variable, away from an abbreviation 2021-04-06 16:27:46 +02:00
Benno Schulenberg 9c16be32d7 tweaks: reshuffle two conditions, to have the most unlikely one first
This also better fits the preceding comment.
2021-04-05 16:10:44 +02:00
Benno Schulenberg 929770191e chars: work around a UTF-8 bug in glibc, to display invalid codes right
The mblen() and mbtowc() functions will happily return 4 or 5 or 6
for byte sequences that start with 0xF4 0x90 or higher.  But those
sequences encode for U+110000 or higher, which are not valid Unicode
code points.  The libc of FreeBSD and OpenBSD and Alpine correctly
return -1 for such sequences.  Make nano behave correctly also when
linked against glibc, so that invalid sequences are always presented
as a series of invalid bytes and never as a single invalid code.

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

Bug existed since before version 2.0.0.
2021-03-26 11:07:05 +01:00
Benno Schulenberg 66d9d6c6d2 tweaks: elide the pointless is_valid_unicode() function
The call of this function in make_mbchar() does not add anything,
because wctomb() already returns -1 for codes U+D800 to U+DFFF,
and parse_verbatim_kbinput() already rejects anything that starts
with U+11.... or higher, so make_mbchar() is never called for codes
beyond U+10FFFF.

And the call in display_string() just needs to check for wc <= 0x10FFFF
because mbtowc() already returns -1 for codes U+D800 to U+DFFF.
2021-03-25 11:24:41 +01:00
Benno Schulenberg 77da54c6c6 startup: do not store an error message in the record of another buffer
Set the 'format' of a file only when it has been fully read in,
so that this field can be used to indicate that any later error
message cannot be meant for this buffer.

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

Bug existed since commit 6bf52dcc from yesterday.
2021-03-23 16:19:07 +01:00
Benno Schulenberg 6bf52dcc8d startup: do not crash when trying to open a device or directory
Make sure there is an 'openfile' record before trying to save an
error message in this record.

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

Bug existed since commit ede64d7e from yesterday.
2021-03-22 15:50:31 +01:00
Benno Schulenberg ede64d7ea0 feedback: upon first switch to a buffer, show its error message (if any)
When opening multiple files and some of them had an error, only the
first message was shown and the others were lost -- indicated only
by three dots.  Improve upon this by storing the first error message
for each buffer and showing this message when the buffer is first
switched to.

Requested-by: Mike Frysinger <vapier@gentoo.org>
2021-03-21 16:52:29 +01:00
Benno Schulenberg e8db390d6f tweaks: reshuffle a fragment of code, to prepare for the next change
Also, don't reserve MAXCHARLEN bytes for the terminating NUL byte.
2021-03-21 16:52:29 +01:00
Benno Schulenberg 0c1bf429e8 display: make the output of --constantshow less jittery
That is: reserve for the current line and current character the number
of positions needed for the total number of lines and characters, and
reserve two positions for both the current column and the total number
of columns.  This will keep all nine numbers in the output in the same
place -- as long as there are no lines with more than 99 columns.  In
this latter case there will still be some jitter, but all-in-all the
output is much stabler than it was.

Suggested-by: Mike Frysinger <vapier@gentoo.org>
2021-03-18 16:20:04 +01:00
Benno Schulenberg a9ccd99b90 tweaks: rename a symbol, to better match the corresponding option 2021-03-03 09:39:49 +01:00
Benno Schulenberg a543f8cd8f search: correctly colorize a match also when softwrapping is active
This fixes https://savannah.gnu.org/bugs/?60149.
Reported-by: Peter Passchier <peter@passchier.net>
Reported-by: Liu Hao <lh_mouse@126.com>

Bug existed since version 5.6, since a special color for highlighting
search matches was introduced in commit 87fe73dd.
2021-03-01 10:43:28 +01:00
Benno Schulenberg 87fe73ddaa color: give highlighted text its own color, to not look like marked text
Now that a search match gets highlighted, the unsuspecting user might
think that the text is selected, because it is colorized the same way
as selected text.  Avoid this by colorizing a highlighted search match
with its own specific color, black on yellow by default.
2021-02-14 12:51:09 +01:00
Benno Schulenberg d131c2d438 minibar: show a message a little longer when --quickblank isn't used
The --minibar option made --quickblank a no-op.  Now the use of the
latter together with --minibar still has some effect.
2021-02-07 12:09:38 +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 7e04fea92b painting: when finding an end match, set its multidata right away
When leaving the multidata unset (as was done until now) and the
end match is offscreen, then this could lead to miscolorings later
when jumping over this end match instead of scrolling past it.

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

Bug existed since before version 2.1.10.
2021-02-05 17:25:03 +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 878bd53d11 minibar: show cursor position + character code only with --constantshow
This allows having an even leaner interface, and gives the M-C toggle
an appropriate function (instead of leaving it a "dead" keystroke).

Suggested-by: Sébastien Desreux <seb@h-k.fr>
2021-02-02 11:10:09 +01:00
Benno Schulenberg 36855544d1 tweaks: rewrap and reindent a few lines 2021-01-29 10:52:40 +01:00
Benno Schulenberg dc745c0b77 tweaks: elide a function that is now just one line 2021-01-29 10:30:05 +01:00
Benno Schulenberg 3ea2694d9c tweaks: rename six symbols, to be more straightforward 2021-01-28 16:11:57 +01:00
Benno Schulenberg befe4ea5de tweaks: frob some comments, and adjust indentation after previous change 2021-01-28 11:57:33 +01:00
Benno Schulenberg 43d94692ce painting: always do backtracking for the first row of the screen
Backtracking from the first row is needed in case a start match was
added recently somewhere offscreen and the user jumped to the current
location (instead of scrolling) so that the CWOULDBE markings did not
reach the current lines.

Also, search for an end match only for the first screen row.  For the
other rows, rely on the CENDAFTER, CWHOLELINE, and CWOULDBE values to
indicate whether there *is* an end match (the first two values) or not.
This saves considerable time when there is no end match in the large
remainder of a buffer: it will search in vain for the end match just
once, instead of for every row of the screen.

This fixes https://savannah.gnu.org/bugs/?59948,
and addresses https://savannah.gnu.org/bugs/?59945.

Bug existed since version 2.7.5, commit b3bcc8ee.
2021-01-27 17:01:17 +01:00
Benno Schulenberg 1364b41dc9 debug: add timing instruments to cache precalculation and screen refresh 2021-01-26 16:06:31 +01:00
Benno Schulenberg 7d3a555464 tweaks: avoid the vague possibility of advancing beyond end-of-line
Like the other two fragments that advance over a zero-length match,
also this fragment should avoid the possibility of stepping beyond
the end of the line.
2021-01-24 17:19:44 +01:00
Benno Schulenberg 0508520b47 tweaks: reshuffle three conditions into a better order
When a zero-length match is beyond the width of the screen, there
is no point in continuing evaluating the rule, so the check for
"offscreen to the right" needs to come first.  The check for a
zero-width match needs to come second because otherwise we would
get stuck on such a match when it is offscreen to the left.
2021-01-24 17:19:37 +01:00
Benno Schulenberg 6cbb7bc443 tweaks: frob two fragments of code, to be more readable 2021-01-24 16:44:38 +01:00
Benno Schulenberg 055e262b56 tweaks: stop evaluating a rule when the match is offscreen to the right
When the match of a coloring regex is beyond the width of the screen,
there is no point in continuing to evaluate the regex for the rest of
the line, because any other matches will be offscreen too.

This will save some time when there are several overlong lines.
2021-01-24 12:40:34 +01:00
Benno Schulenberg 9d8388e836 tweaks: call wattron()/wattroff() only when actually painting something
A syntax has on average a dozen coloring rules, but on average maybe
three or four pieces of text (rough estimate) in a line get painted.
So, on average, it is cheaper to call wattron() and wattroff() only
when actually coloring a piece of text, instead of calling wattron()
before starting to evaluate each rule and wattroff() after finishing
its evaluation.
2021-01-23 19:28:08 +01:00
Benno Schulenberg 895de17a58 color: do not look for another 'end' match after already finding one
When reaching end-of-line after having found a zero-width end match,
nano should not continue at 'seek-an-end' but instead at 'step_two':
going on to seek a start match in the current line.

(There is no bug report, because I cannot figure out how to trigger
this issue and cause nano to misbehave.  The problem was found while
reviewing the comments.)

Bug existed since commit 9a4a5454 from four years ago,
but the behavior was poorer before that commit.
2021-01-22 16:40:53 +01:00
Benno Schulenberg b202966d30 tweaks: correct a comment, improve another, and trim some verbosity 2021-01-22 11:58:53 +01:00
Benno Schulenberg 71402bb7e9 feedback: wipe the status bar by default after 20 keystrokes
The 26 keystrokes inherited from Pico is a weird number, and too long.
2021-01-11 16:18:35 +01:00
Benno Schulenberg 6360e4170a copyright: update the years for the FSF 2021-01-11 14:22:51 +01:00
Benno Schulenberg 4c6ce3c39d minibar: when the overnext character has zero width too, show its code
Requested-by: Peter Passchier <peter@passchier.net>
2021-01-09 12:44:10 +01:00
Benno Schulenberg 41fd09706d minibar: when the next character has zero width, show its code too
This allows seeing that an accented character is not a single code point
but composed from a base character plus a combining character.
2021-01-09 12:44:10 +01:00
Benno Schulenberg 24e5f956d0 build: fix compilation when configured with --disable-utf8
This fixes https://savannah.gnu.org/bugs/?59842.
Reported-by: Ruben van Wyk <admin@knwip.com>

Bug existed since commit 5129e718 from two days ago.
2021-01-08 12:05:55 +01:00
Benno Schulenberg f602613a9a tweaks: avoid compilation warnings on 32-bit machine plus newer compiler 2021-01-07 16:17:17 +01:00
Benno Schulenberg c62d12ca93 tweaks: drop a small optimization for invalid UTF-8 starter bytes 2021-01-07 10:37:35 +01:00
Benno Schulenberg 297633d086 minibar: show Unicode codes when in a UTF-8 locale
The only exception is 0x00.  But that code should really not occur
in a normal text.  And if it does, it is fine that it stands out.
2021-01-07 10:36:14 +01:00
Benno Schulenberg 0693d6974a minibar: represent bytes as 0xNN and valid Unicode code points as U+NNNN
An invalid UTF-8 starter byte should not be represented in the same way
as a valid Unicode character.

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

Bug existed since two weeks ago, since the mini-bar code was merged.
2021-01-06 15:10:11 +01:00
Benno Schulenberg 5129e718d7 chars: speed up the handling of invalid UTF-8 starter bytes
The first byte of a multi-byte UTF-8 sequence must be in the range
0xC2...0xFF.  Any other byte cannot be a starter byte and can thus
immediately be treated as a single byte.
2021-01-06 12:41:49 +01:00
Benno Schulenberg 8c406bc875 tweaks: change an intermediate variable to a better one 2021-01-06 10:05:35 +01:00
Benno Schulenberg c53da9aa5b tweaks: fold some conditions into bitwise masks, for efficiency 2021-01-05 11:49:03 +01:00
Benno Schulenberg 45efe28f05 minibar: drop the side spaces before suppressing the state flags
Also, consistently keep the right-side elements at least two spaces
away from the modification asterisk.
2020-12-30 19:03:27 +01:00
Benno Schulenberg c8c7986f65 minibar: allow the number-of-lines to overrule also the state flags 2020-12-30 16:14:38 +01:00
Benno Schulenberg f437117bf2 tweaks: avoid hitting negative values when using size_t 2020-12-30 16:07:29 +01:00
Benno Schulenberg 33e882e6f8 minibar: allow the number-of-lines to overrule location + character code
When space is too tight to show all three elements, show the report on
the number of lines in preference to the current location and character
code.  The latter two will be shown again upon the next keystroke, so
there is little harm in hiding them for a moment.
2020-12-29 20:10:18 +01:00
Benno Schulenberg bad591d43d tweaks: adjust the indentation after the previous change
Also, reduce the scope of a variable, and rehuffle two lines.
2020-12-29 15:55:14 +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 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 f1fc66060f minibar: add a percentage that shows how far the cursor is into the file
Requested-by: Peter Passchier <peter@passchier.net>
2020-12-23 12:17:06 +01:00
Benno Schulenberg ba4f4bdc64 minibar: show the line count in the bar (at startup and when saving)
Show the line count too when switching between buffers.
2020-12-23 12:17:06 +01:00
Benno Schulenberg 2b6c08b955 minibar: add an [x/y] "counter" when multiple files are open 2020-12-23 12:17:06 +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 54995defd2 input: intercept ^Z also when --minibar is active
For some reason, calling halfdelay() undoes the ISIG mask.
So, mask keyboard interrupts again immediately after the call.

Reported-by: Peter Passchier <peter@passchier.net>
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 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
Benno Schulenberg f52f503c38 tweaks: move the displaying of the state letters into a separate function 2020-12-23 12:17:05 +01:00
Benno Schulenberg 8939163659 tweaks: reshuffle two lines, and rename a variable to a plain word 2020-12-22 19:23:40 +01:00
Benno Schulenberg 265bdd94f1 mouse: do not offset the shortcuts by 'margin' when using --linenumbers
The bottom window (the prompt bar and the shortcuts) does not shift
its position when line numbers are active, so mouse clicks in this
window should be not be compensated for the line-numbers margin.

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

Bug existed since version 2.7.0, since line numbers were introduced.
2020-12-22 19:15:32 +01:00
Benno Schulenberg 5c4c30e26b display: do not show the state flags in the help viewer or file browser
The state flags are relevant only when editing.

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

Bug existed since version 5.3, since --stateflags was introduced.
2020-12-21 14:59:18 +01:00
Benno Schulenberg d8500f0467 tweaks: remove some #ifdefs that were there only for Slang 2020-12-05 12:34:17 +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 2157738a18 tweaks: correct two comments after the previous changes 2020-12-04 17:03:10 +01:00
Benno Schulenberg 681d11c0cf tweaks: rename a variable, to be similar to its sister 2020-12-04 16:57:17 +01:00
Benno Schulenberg d96f296b8e input: interpret a keystroke as Meta only when an earlier escape was solo
This allows using <Esc> <Esc> <letter> in a macro as an alternative
for <Ctrl+letter>, but it does require that one does not type <Esc>
by accident when recording a macro as it might modify the subsequent
keystroke when the macro is replayed.

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

Bug existed since version 3.0, commit ecc9211a.
2020-12-04 16:35:28 +01:00
Benno Schulenberg 048ab0ee0b tweaks: reduce the scope of a static variable 2020-12-04 16:30:28 +01:00
Benno Schulenberg a3a1391a51 tweaks: rename two variables, one for contrast, another for visibility
Also normalize two bits of whitespace.
2020-11-30 13:32:22 +01:00
Benno Schulenberg a4675acdba copyright: update to the current year for significantly changed files 2020-11-30 12:01:47 +01:00
Benno Schulenberg 00ac41f632 weeding: remove another unneeded workaround for VTE
The issue is only reproducible when lying about the width
of the terminal.

It was a workaround for https://savannah.gnu.org/bugs/?49106.
2020-11-28 16:12:20 +01:00
Benno Schulenberg fe22da6b2a build: exclude a workaround for VTE/Konsole when using a recent ncurses
The workaround was for https://savannah.gnu.org/bugs/?51335
(a cursor-misplacement bug), but both an recent Xfce Terminal
and a recent Konsole appear unaffected by the issue.  So, drop
the workaround for modern systems.
2020-11-27 14:15:42 +01:00
Benno Schulenberg 0c87a4ba41 build: include a workaround for VTE only when using an older libvte
Checking for the actual version of libvte is too complicated, so
assume that libvte is 0.58 or newer (where the problem is fixed)
when ncurses is 6.2 or newer.
2020-11-27 12:31:41 +01:00
Benno Schulenberg 9da23799ff tweaks: reshuffle a fragment of code, for clarity 2020-11-26 17:32:30 +01:00
Benno Schulenberg 29276d1d3a help: allow the penultimate item extra space when the number is uneven
This avoids unnecessarily truncating the last help item on the
very bottom row when there is still plenty of room.

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

Bug has been visible since at least version 2.5.1.
2020-11-26 17:12:09 +01:00
Benno Schulenberg b7539ea985 weeding: remove a workaround for versions of ncurses before 5.9
(Yes, the test is for 6.0, but the bug was actually fixed in 5.9,
as far as I remember -- I just wasn't sure and didn't want to bother
building different versions of ncurses myself.)
2020-11-15 10:27:22 +01:00
Benno Schulenberg d2869ab348 build: include some raw sequences for the graphical Debian installer
The terminal window in the graphical Debian installer (the default)
produces the same escape sequences as xterm for F1 to F4.  Though
TERM is set to xterm, the xterm terminfo data is not available, so
ncurses is unable to translate the sequences for us.  :|  Therefore,
recognize the relevant raw escape sequences.

Also, eat all bytes of the non-recognized modified function and arrow
keys, so that they do not enter junk into the buffer.
2020-10-01 14:43:34 +02:00
Benno Schulenberg 3f938e29b6 build: exclude bunches of raw escape sequences from the tiny version
The tiny version is probably only ever used in the Debian installer,
on the bterm terminal, which produces escape sequences like those of
a Linux console.  So, exclude all other raw sequences.

(After support for Slang has been removed, we can maybe even exclude
ALL raw sequences from the tiny version, and the corresponding option
(-K/--rawsequences) too.)
2020-10-01 09:06:12 +02:00
Benno Schulenberg 037b77555e tweaks: condense a bit of code after the previous change 2020-09-30 19:51:29 +02:00
Benno Schulenberg 51b9e86d13 tweaks: remove mistaken escape sequences for function keys on xterm
At least since version 229 of xterm (from August 2007), the escape
sequences for F1 to F4 have been "Esc O P" to "Esc O S".  There is
no bracket in those sequences, and there probably never was -- most
likely the extra "[" in nano's code was a slip of the fingers.
2020-09-30 19:46:48 +02:00
Benno Schulenberg 4a403ae00f display: do not unnecessarily wipe the status bar
It would wipe the edit window if there is just one row.

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

Bug existed since version 2.9.3.
2020-09-25 16:52:31 +02:00
Benno Schulenberg 0906181d75 tweaks: reshuffle a condition, to elide a blank string 2020-09-24 16:24:34 +02:00
Benno Schulenberg 7ff6b97e5c tweaks: reshuffle some lines and adjust indentation after previous change
Also, exclude the state-flag stuff from the tiny version.
2020-09-23 19:48:03 +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 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 93b25ce014 tweaks: adjust some whitespace in the docs, and improve a comment 2020-09-12 12:21:24 +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 cf4901da2d suspension: do not enter an invalid byte upon resume (when using Slang)
Instead of stuffing 0x91 into the input stream, use 0xFF when built
with Slang -- the same code that Slang itself produces when resuming
from an externally induced suspension.  This byte is ignored.

In a UTF-8 locale, it should be safe to ignore the byte 0xFF coming
from the keyboard, as no valid UTF-8 sequence can contain 0xFF.

In an ISO8859 locale, this change prevents ÿ from being typed on the
keyboard -- it can still be entered with <Esc> <Esc> 255, though.
My apologies to the people of Pierre Louÿs and L'Haÿ-les-Roses.
2020-09-07 17:09:57 +02:00
Benno Schulenberg 46e769a113 rcfile: add 'set scrollercolor', for changing the color of the indicator
This fulfills https://savannah.gnu.org/bugs/?59041.
2020-09-02 19:55:24 +02:00
Hussam al-Homsi c87bc1d55f tweaks: stop casting the return of malloc() and friends
Those casts are redundant, and sometimes ugly.  And as the types of
variables are extremely unlikely to change any more at this point,
the protection they offer against miscompilations is moot.

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2020-08-31 12:17:27 +02:00
Benno Schulenberg 7ffbf01607 tweaks: improve three comments and an indentation 2020-08-21 16:06:38 +02:00
Benno Schulenberg f6b4c243d8 tweaks: reshuffle four declarations, and rename two variables 2020-08-21 16:03:59 +02:00
Benno Schulenberg 8daa7cbda0 tweaks: remove a variable and two functions that have become redundant 2020-08-20 09:17:48 +02:00
Benno Schulenberg bc6b9bf955 tweaks: rename a variable, to not seem to refer to the scrollbar 2020-08-17 13:36:03 +02:00
Benno Schulenberg fb98f0ced7 tweaks: adjust a comment, and reshuffle the setting of a boolean 2020-08-15 16:07:30 +02:00