Commit Graph

362 Commits (5c8de3e39f77cca37e75eea3b09550e3bad687bb)

Author SHA1 Message Date
Benno Schulenberg b92b9e5cac browser: with --zero, do not use the bottom row for displaying filenames
Otherwise the prompt bar or status bar could hide the highlighted item.

This addresses the first issue mentioned in commit 03637030.
2021-11-15 10:44:06 +01:00
Benno Schulenberg d19842ed73 tweaks: add an auxiliary variable, to prepare for handling --zero 2021-11-15 10:44:06 +01:00
Benno Schulenberg 0655c8aa6c tweaks: rename a variable, to be distinctive and less confusing
Also rewrap three lines, to keep related things closer together.
2021-11-15 10:44:06 +01:00
Benno Schulenberg 30595dd2bb tweaks: frob a couple of comments, and drop two, for conciseness 2021-11-15 10:44:06 +01:00
Benno Schulenberg ea4bbf4285 tweaks: rename two functions, to get rid of the senseless suffix of one 2021-11-08 16:16:35 +01:00
Benno Schulenberg f9468fa987 history: process file faster by not filtering out hypothetical duplicates
When the history file has been created by nano, it will not contain
any duplicate search or replace strings, nor duplicate commands, so
checking for such a duplicate for each read item was a waste of time.

And if the user edited the history file and created duplicates, who
are we to filter them out?  They will not cause the history mechanism
to malfunction; they just take a little extra memory.
2021-10-14 09:58:07 +02:00
Benno Schulenberg 508301a2ef browser: make the keystrokes ^W^Y and ^W^V work again
The functions to_first_file() and to_last_file() can get called from
do_statusbar_input(), which is called indirectly from do_prompt(),
and are expected to make the corresponding adjustment.

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

Bug existed since version 5.0, commit 07c1ac90.
2021-10-04 11:38:30 +02:00
Benno Schulenberg 6360e4170a copyright: update the years for the FSF 2021-01-11 14:22:51 +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 2289bb7c19 tweaks: reshuffle two lines and a function name, for a consistent order
Also rewrap a a line.
2020-09-20 20:03:18 +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 accb645d3f browser: wipe the status bar before searching again with M-W or M-Q
In this way, any message that is on the status bar after the search
will be a response to this search and not some leftover.

This fixes https://savannah.gnu.org/bugs/?59109.
2020-09-14 11:15:00 +02:00
Benno Schulenberg 79545187b8 tweaks: move two more functions, to before the ones that call them 2020-09-02 10:19:04 +02:00
Benno Schulenberg 413a83c2e2 tweaks: move two more functions, to before the one that calls them 2020-09-02 10:09:20 +02:00
Benno Schulenberg ab08eebfc1 tweaks: move three functions, to before the ones that call them 2020-09-02 10:02:55 +02:00
Benno Schulenberg ac4c56f636 tweaks: fold one function into another, to elide an unneeded return value 2020-09-02 09:55:08 +02:00
Benno Schulenberg 1db7d57a24 browser: make M-W/M-Q functional right after startup, if there is history
Do the same what the normal "research" code does: if nothing was
searched for yet during this session, and there is a history of
search items, then search for the last item in that history.
2020-09-02 09:22:50 +02:00
Benno Schulenberg e32ca98ccf tweaks: condense a bit of code
Make it equal to what the normal search code does.
2020-09-02 09:15:23 +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 a2fdf6c486 tweaks: remove an unneeded cursor movement, and rename a variable
There is no need to place the cursor up front, as the drawing of
each name includes the coordinates where the name must be drawn.

Also, trim two comments and reshuffle a free().
2020-07-05 19:29:05 +02:00
Benno Schulenberg cb1675dac7 tweaks: rename two functions and a variable, and improve two comments 2020-07-04 17:43:16 +02:00
Benno Schulenberg 808d0894f1 tweaks: condense a comment, and reshuffle a few lines 2020-07-04 17:25:32 +02:00
Benno Schulenberg 07c1ac9035 tweaks: delete two functions that are never executed
Those two operations are performed directly in do_browser().
2020-07-04 17:14:52 +02:00
Benno Schulenberg 2b9c0c5724 tweaks: rename a variable, and reduce the scope of two others 2020-07-04 15:12:04 +02:00
Benno Schulenberg abfde53945 tweaks: drop an unneeded assignment, and reshuffle a few lines
And reset the 'lastmessage' variable to a more fitting value.
2020-07-04 09:36:17 +02:00
Benno Schulenberg b086d0bad0 tweaks: elide another parameter, relevant in just three menus
The parameter was referenced in just one place.  So, simply check for
the three relevant menus (and unrestricted mode) and be done with it.

This also has the pleasant effect that the menu name is now the first
parameter of do_prompt(), thus clearly indicating what prompt it is,
instead of having an opaque TRUE or FALSE value at the beginning.
2020-06-20 17:19:23 +02:00
Benno Schulenberg 90f6342fd1 tweaks: rename two header files, to be distinct and not an abbreviation 2020-06-20 12:09:31 +02:00
Benno Schulenberg 499b926b74 tweaks: elide a parameter that is relevant for only one menu (Goto Dir)
Instead of burdening seven other calls of do_prompt() with a useless
parameter, just check for MGOTODIR in the appropriate place.  It also
saves having to pass the parameter down through three more functions.
2020-06-19 10:55:28 +02:00
Benno Schulenberg d8249917c3 bindings: allow toggling the help lines at several prompts and in browser
Now the help lines can be toggled not only while editing, but also at
the Read (^R), Write (^O), Execute (^T), Search (^W), Replace (M-R),
Goto (^/), and Yesno prompts, and also in the file browser and when
searching for a file name.  The help lines cannot be toggled in the
help viewer, nor when searching in a help text, nor in the linter,
as these three things force the help lines to be on.

Furthermore, the 'nohelp' function can be rebound in all relevant
menus (default binding: M-X).

This fulfills https://savannah.gnu.org/bugs/?58471.
2020-06-18 15:36:10 +02:00
Benno Schulenberg 2a44cb2ed8 tweaks: rename a function, to leave the old names behind
What the function does has changed, so better change the name too.
2020-06-01 09:43:08 +02:00
Benno Schulenberg 19a124e806 display: avoid an additional redrawing when redrawing the screen
When resizing the screen or toggling the help lines or refreshing
the screen with ^L, what used to be total_refresh() would first call
what used to be total_redraw(), to tell ncurses to redraw whatever
had been on the screen so far, before proceeding to fully redraw the
content of the title bar and the edit window and the bottom bars.
That was duplicate work.

Thus, rename total_redraw() to total_refresh(), so that ^L in the
edit window, help viewer, and file browser will redraw the screen
just once.  This also preserves whatever was on the status bar
(when --quickblank isn't used).

Rename the old total_refresh() to draw_all_subwindows() and call
this routine when resizing the screen or toggling the help lines
or returning from the credits crawl.
2020-06-01 09:40:09 +02:00
Benno Schulenberg 304548ef82 tweaks: rename two functions, to match the style of others 2020-03-11 19:45:06 +01:00
Benno Schulenberg dd6f129c3c tweaks: rename two functions, for shortness 2020-03-11 19:43:03 +01:00
Benno Schulenberg c64f506933 tweaks: reshuffle some declarations, and expand a few variable names 2020-01-28 10:21:34 +01:00
Benno Schulenberg e0213b1a41 tweaks: drop a pointless suffix from two function names 2020-01-26 16:36:23 +01:00
Benno Schulenberg b8ba27bbc0 tweaks: fuse two nearly identical functions into a single one
The plain keys that are valid in the help viewer are a perfect subset of
those that are valid in the file browser, so just use the same function
to do the interpretation for both.  It is not a problem that it returns
function pointers for some keystrokes that have no meaning in the help
viewer, because both NULL and an unhandled function pointer result in
the "Unbound key" message.
2020-01-26 16:20:37 +01:00
Benno Schulenberg a78da18aa4 input: ignore bracketed pastes in help viewer and file browser
This partially fixes https://savannah.gnu.org/bugs/?57623.
Reported-by: Brand Huntsman <alpha@qzx.com>
2020-01-24 19:20:21 +01:00
Benno Schulenberg 04e557fdaf tweaks: avoid fiddling with the keybuffer when it's not needed
Just change KEY_MOUSE directly into KEY_ENTER for a double click.
2020-01-17 17:06:17 +01:00
Benno Schulenberg afa4c6b9fc copyright: update the years for the FSF 2020-01-15 11:42:38 +01:00
Benno Schulenberg 413b9cb774 tweaks: rename a function, to get rid of a useless suffix 2019-12-15 19:47:05 +01:00
Benno Schulenberg bc91af2e3c tweaks: pass an empty string as an answer instead of a NULL pointer
Also, rename a parameter, to be more distinct and to avoid an abbrev.
2019-10-15 13:39:57 +02:00
Benno Schulenberg 31d5cb1118 build: slightly speed up the compilation of the tiny version
Don't include header files when they won't actually be needed.

(Also, remove a superfluous #ifdef.)
2019-10-13 18:55:49 +02:00
Benno Schulenberg d256d0cbc0 tweaks: add a helper function without the ubiquitous NULL argument
For conciseness and clarity.
2019-10-13 12:24:27 +02:00
Benno Schulenberg ff0e01a69e bindings: don't hard-bind ^H in the help viewer or the file browser
Hard-binding the ^H control code prevents the user from rebinding
the keystroke.

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

Bug existed since version 4.0, commit 72a49dbb.
2019-10-05 12:43:46 +02:00
Benno Schulenberg 23c8ef70aa tweaks: reshuffle some lines, to have the same order as elsewhere 2019-10-02 15:20:49 +02:00
Benno Schulenberg e0d9b7a8af tweaks: add a translator hint, and correct two others 2019-09-29 15:08:57 +02:00
Benno Schulenberg 3422ec3419 browser: draw a bar of spaces only where needed -- for the selected item
The edit window has been fully cleared just before the list-drawing
loop has started, so there is no need to wipe anything.  Only for the
highlighting bar all its characters need to be drawn with the correct
attributes.
2019-06-25 11:25:03 +02:00
Benno Schulenberg f3a441043d display: where needed, use slow blanking, but elsewhere do it much faster
Where the row needs to be filled with spaces with the attributes that
were set (title bar, prompt bar, and browser highlight), use printw().
But when the row needs to be actually cleared, use the much faster
clrtoeol().

This reduces the time needed to clear a full row with 95 percent.
2019-06-25 11:12:27 +02:00
Benno Schulenberg 6dc8570d55 tweaks: reshuffle a few things, partly to make two chunks more alike 2019-05-30 16:00:11 +02:00