Commit Graph

284 Commits (a5974bd1ec63cfa18b1aa85a4cf817cfd5cd6b0d)

Author SHA1 Message Date
Benno Schulenberg ff35a61355 tweaks: transform the token DISABLE_HISTORIES to ENABLE_HISTORIES 2017-10-29 19:43:05 +01:00
Benno Schulenberg 3f27c312c4 tweaks: get rid of some cluttering conditional compilation
In the tiny version, do_prompt() will now have an extra NULL
parameter, which will cost maybe twenty extra bytes of code.
That is acceptable when it saves thirty lines in the source.
2017-10-29 11:39:27 +01:00
Benno Schulenberg e1e6c5f612 bindings: make the search function rebindable again in help and browser
Adjust to the changed meaning of 'whereis': it is no longer do_search()
but do_search_forward().

Hinted-at-by: Brand Huntsman <alpha@qzx.com>
2017-10-18 20:55:09 +02:00
Benno Schulenberg b27ab4f0a1 browser: place the cursor properly on the selected file when -g is used
Simply redraw the browser screen upon every keystroke when --showcursor
is in effect, to be certain that the cursor will be placed again at the
correct spot.

This fixes https://savannah.gnu.org/bugs/?52078
and fixes https://savannah.gnu.org/bugs/?52079.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-09-22 21:52:41 +02:00
Benno Schulenberg c74d2632bb tweaks: make the switching on and off of the cursor a bit more compact 2017-09-22 21:31:01 +02:00
Benno Schulenberg ae34825f58 display: rework the switching on and off of the cursor
The basic idea is that the cursor is always off, except when it needs
to be on: when waiting for text input, and in a few other cases: when
something was searched and found in the help viewer, and in the file
browser when option -g is in effect.

This fixes https://savannah.gnu.org/bugs/?51923.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2017-09-20 21:35:25 +02:00
Benno Schulenberg a56a881c4b browser: correct the inverted search behavior for Alt+Up/Alt+Down
This should have been added and amended in the previous commit --
my mistake.
2017-08-20 09:22:19 +02:00
David Lawrence Ramsey 633343de24 browser: allow backward/forward re-searches with Alt+Up/Alt+Down
Also bind 'N' to a backward re-search, while retaining 'n' for a
forward one,  This matches the functionality in the help viewer.
2017-08-19 21:49:32 +02:00
Benno Schulenberg ec20e3a7a8 tweaks: rename a function, to let it make more sense
Further, slightly reword an error message so it is appropriate also
when an out-of-bounds file is specified on the command line.
2017-08-13 10:08:50 +02:00
Benno Schulenberg dd88842d5a tweaks: elide the global variable 'full_operating_dir'
There is no need to retain the (relative) path that the user
specified, so we can simply reuse that variable.
2017-08-13 10:08:37 +02:00
Benno Schulenberg 11072ed587 tweaks: sort the includes, so it's a little easier to see what is there 2017-08-06 19:40:30 +02:00
David Lawrence Ramsey 1c1cbae6bc small addition: allow customizing the color of selected text
The new option 'set selectedcolor' applies to marked text, to the
currently selected file in the file browser, and to the highlighted
match during interactive search-and-replace.
2017-08-06 09:30:32 +02:00
Benno Schulenberg 80686bb525 tweaks: remove includes that appear to be superfluous
Without them, nano still compiles for me, with everything enabled,
even when using --enable-debug, --enable-utf8, and --with-slang.
2017-08-06 09:08:30 +02:00
Benno Schulenberg dc3610fc8e tweaks: transform the token DISABLE_BROWSER to ENABLE_BROWSER
Also, allow Ctrl+Left/Right with --enable-tiny --enable-browser.
2017-05-08 21:56:50 +02:00
Benno Schulenberg 5033cfd81a tweaks: transform the token DISABLE_MOUSE to ENABLE_MOUSE
Also, trim some comments and avoid an unused-variable warning.
2017-05-01 20:53:07 +02:00
Benno Schulenberg 46430999d5 build: make --enable-help properly depend on --enable-multibuffer
And in the process transform the token DISABLE_HELP to ENABLE_HELP.
2017-04-25 18:27:55 +02:00
Benno Schulenberg ae15fc9bb2 bindings: allow using '/' to start a search in the help viewer
And allow 'N' for searching the next occurrence.  Add the
same keystrokes to the file browser too, for consistency.
2017-04-25 17:21:38 +02:00
Benno Schulenberg 754c62c5cc copyright: update the years, use ranges, and explain this usage
The interval 2013-2017 for the Free Software Foundation is valid
because in those years there were releases with changes by either
Chris or David, and the GNU maintainers guide advises to mention
a new year in all files of a package, not just in the ones that
actually changed, and be done with it for the rest of the year.
2017-04-09 12:09:23 +02:00
Benno Schulenberg fb534bada6 bindings: make ^Up/^Down go to first/last row in the file browser
Making ^Up and ^Down go to top and bottom row in the file browser
complements and completes the behavior of ^Left and ^Right.
2017-04-04 20:26:21 +02:00
Benno Schulenberg 9e7e88e157 bindings: accept "q" and "x" to exit from help viewer and file browser
"Q" is a pretty standard key to exit from something, and "X" is fairly
mnemonic -- better than "E" at least.
2017-03-23 12:42:53 +01:00
Benno Schulenberg d42f71a2ef tweaks: avoid a few needless reallocations
Most of these variables are freed moments later -- reallocating
them is thus a waste of time.
2017-03-20 13:07:57 +01:00
Benno Schulenberg f48e15f2a3 tweaks: rename and shorten a small helper function 2017-03-20 12:24:42 +01:00
Benno Schulenberg 892762d99c tweaks: rename some variables, to show they refer to screen rows 2017-01-12 18:03:36 +01:00
Benno Schulenberg f7d320d932 tweaks: rename a function, to show it refers to screen rows 2017-01-12 17:48:33 +01:00
Benno Schulenberg 61bc248555 tweaks: chuck a couple of useless asserts 2017-01-08 15:27:48 +01:00
Benno Schulenberg fd0589d8bc tweaks: remove the cluttering conditional compilation of a parameter
The conditionalizing saved negligible amounts of space, of memory, and
of speed.
2017-01-03 14:11:45 +01:00
Benno Schulenberg a381021ffc tweaks: when allow_tabs is FALSE, allow_files is irrelevant
In that case setting the latter to TRUE is misleading.  So don't do that.
2017-01-03 14:02:52 +01:00
Benno Schulenberg 588daf949e tweaks: condense the setting of three flags 2016-12-25 13:11:17 +01:00
Benno Schulenberg e6350aaba4 prompt: do not treat a leading newline in a filename specially
This fixes https://savannah.gnu.org/bugs/?49884.
2016-12-22 13:46:53 +01:00
Benno Schulenberg 8bf8682b17 binding: use the code for the Enter directly instead of a function call
And certainly don't return zero when the key wouldn't have been found,
because that would have meant jumping a word to the right.
2016-12-22 12:13:03 +01:00
Benno Schulenberg a9b5a0e029 tweaks: rename a function to something less abbrevy
Also, swap the logic around, to use less braces.
2016-12-22 12:04:10 +01:00
Benno Schulenberg 0b0b812206 files: don't change embedded newlines into nulls in filenames
Because changing anything to a null effectively means to truncate
the name.

This fixes https://savannah.gnu.org/bugs/?49868
and fixes https://savannah.gnu.org/bugs/?49874.
2016-12-18 11:37:57 +01:00
Benno Schulenberg d7af590c6b memory: don't bother making a snug fit for things that will be freed soon
Most full paths are needed only temporarily and will be freed within
milliseconds.  Only 'full_operating_dir' and 'backup_dir' continue to
exist for the whole current session.  Any partition, too, will soon be
unpartitioned, so the extra reallocation is just a waste of time.
2016-12-18 10:33:30 +01:00
Benno Schulenberg 8c7e4f5108 tweaks: rename a function to describe what it does
It doesn't align anything -- any allocations are already aligned to
whatever multiple is required -- it just shrinks the allocated space.
2016-12-18 10:30:35 +01:00
Benno Schulenberg 1144d38316 tweaks: don't bother reallocating a string of which there is only one
And which normally is just some ten or twenty characters long, and
never gets wildly overallocated.
2016-12-18 10:28:30 +01:00
David Lawrence Ramsey b5400ffe65 general: gettextize three overlooked statusbar messages
This fixes https://savannah.gnu.org/bugs/?48622.
2016-12-01 13:02:43 +01:00
Benno Schulenberg 09e95b2d91 tweaks: frob a few comments 2016-09-11 11:26:09 +02:00
Benno Schulenberg 03fd6f3af8 tweaks: remove a useless cursor movement 2016-09-11 10:43:21 +02:00
Benno Schulenberg b92d35d1f2 browser: add the option showcursor, to place the cursor on the highlight
This lets users of braille displays find the selected item immediately.

This fulfills a request by Enrico Mioso.
See https://lists.gnu.org/archive/html/nano-devel/2016-09/msg00025.html.
2016-09-11 09:41:52 +02:00
Benno Schulenberg 2fd497e3ef tweaks: remove a superfluous blanking of the statusbar
The prompt from which the browser was invoked has already blanked it.
2016-09-03 15:34:44 +02:00
Benno Schulenberg 514cd9a099 update the license text to the preferred version
Mentioning "GNU nano" instead of "This program" and referring to the
website instead of to a postal address.
2016-08-29 21:27:16 +02:00
Benno Schulenberg 406e5242a3 update the copyright notices 2016-08-29 21:27:05 +02:00
Benno Schulenberg b77b1391c3 tweaks: improve some indentation and reshuffle a few lines 2016-08-26 12:24:18 +02:00
Benno Schulenberg 91951ab22a input: don't bother putting a keycode into byte range
A keycode is either already in byte range (so there is nothing to do)
or it is not and it shouldn't be (so there is nothing to do either).
2016-07-30 12:19:47 +02:00
Benno Schulenberg 8b28de1313 tweaks: don't call a thing malloc... when it doesn't call malloc() 2016-07-13 15:04:40 +02:00
Rishabh Dave 8fa72fb7e7 browser: elide a variable by fusing the uses of 'newpath' and 'path'
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-07-13 14:30:18 +02:00
Benno Schulenberg 62eeda3e9f tweaks: use mallocstrcpy() instead of strdup(), for a graceful death
To make nano save its modified buffers when it runs out of memory.
2016-07-11 20:45:26 +02:00
Benno Schulenberg a730b25ef9 browser: elide another call of opendir()
And in the bargain show an error message when doing ^R unreadabledir ^T.
2016-07-04 21:18:09 +02:00
Benno Schulenberg 03a81aa9c5 browser: trim all trailing slashes (just in case there are more) 2016-07-03 16:18:26 +02:00
Rishabh Dave 4957c1121d browser: select an inaccessible directory also when tabbed
When the user tab-completed a name at the Go To Directory prompt, this
name will end in a slash.  Remove this slash, so the name can be found
in the file list (where directory names don't include the final slash).

This fixes http://savannah.gnu.org/bugs/?48353.

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-07-02 12:26:42 +02:00