Commit Graph

792 Commits (b2926eb6753cce993b7df2710593a0684bea09f3)

Author SHA1 Message Date
Benno Schulenberg 0cbf1f4027 help: don't show Alt+Left and Alt+Right when running on a Linux console
On a VT, <Alt+Left> and <Alt+Right> switch between VTs and nano
does not receive those keystrokes.
2019-05-13 13:01:10 +02:00
Benno Schulenberg 96baa70cc8 tweaks: reshuffle a couple of lines and adjust a few comments
Also, compute the required space for the keystrokes more tightly:
most of those characters are plain ASCII, so that means 17 bytes
for 17 cells, and at most one of those characters is a three-byte
arrow, which means 2 bytes extra.  Adding the two newlines at the
end, the needed room besides the description is 21 bytes.
2019-05-13 12:25:39 +02:00
Benno Schulenberg b18e2129ce bindings: bind the Alt+arrow keystrokes also in non-UTF-8 locales
Fall back to using the words "Left", "Right", "Up", and "Down",
instead of graphical arrows.

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

Bug was left to exist since the Alt+arrow keys were introduced,
in version 2.8.7, commit 1cc030f7.
2019-05-13 11:35:15 +02:00
Benno Schulenberg 71d0847b19 tweaks: merge two functions, as the one is used only by the other 2019-05-08 15:25:11 +02:00
Benno Schulenberg c55d144748 tweaks: drop most of the remaining debugging code, and some timing code 2019-05-08 15:23:36 +02:00
Benno Schulenberg da91a44f9e tweaks: reshuffle two #ifdefs, to avoid an unpaired brace 2019-05-08 13:56:02 +02:00
Benno Schulenberg 8720cfcce9 tweaks: rename two more functions, to be simpler too 2019-05-04 11:21:45 +02:00
Benno Schulenberg 954c4d03ac tweaks: rename two functions, to be simpler 2019-05-04 11:21:45 +02:00
Benno Schulenberg 11aa191bdc tweaks: rename a variable, to distinguish it from a browser function 2019-04-22 19:58:43 +02:00
Benno Schulenberg f1e5da6cdd help: don't doubly list toggles that have two keys assigned to them 2019-04-09 19:48:41 +02:00
Benno Schulenberg d79b9823ae bindings: add easier keystrokes for the linenumber and softwrap toggles
For most people, M-N and M-S are simpler to type than M-# and M-$,
and more mnemonic.
2019-04-09 17:48:26 +02:00
Benno Schulenberg 82f1ce8ebf bindings: remove the jumpy-scrolling toggle entirely
It is still possible to use --jumpyscrolling on the command line or
'set jumpyscrolling' in a nanorc file, but a user will have to restart
nano when they decide they want chunky instead of smooth scrolling,
a decision that should be rather rare.

This frees up the M-S keystroke to be reused for toggling softwrap.
2019-04-09 17:46:21 +02:00
Benno Schulenberg 4399b734db bindings: disallow executing an external command when in view mode
Otherwise the user could do something like

  ^R^X  sed -i 's/a/surprise!/g' name-of-current-file  <Enter>

and the file being viewed would be modified anyway.
2019-04-06 17:41:44 +02:00
Benno Schulenberg 671db5e1e3 tweaks: rename an overshort type to something that makes some sense 2019-04-03 17:34:05 +02:00
Benno Schulenberg acfee2538e tweaks: rename a cryptic type to something that makes a little sense 2019-04-03 17:11:24 +02:00
Benno Schulenberg 8e302738e8 bindings: recognize the ^W^Y and ^W^V legacy keystrokes again
The keystrokes are recognized and acted upon, but they are not visible
in the menu nor in the help text, and they cannot be rebound.  They are
there just to avoid frustrating the muscle memory of long-time users.

This fixes https://savannah.gnu.org/bugs/?56002.
Reported-by: Peter Zwegat <peterzwegat@yopmail.com>
2019-04-03 15:13:47 +02:00
Benno Schulenberg b58418b32f tweaks: rename a variable, to be more distinct 2019-03-21 19:21:45 +01:00
Benno Schulenberg aac4fc46e9 tweaks: rename a type, to make more sense 2019-03-21 17:08:52 +01:00
Benno Schulenberg 15959346fb tweaks: exclude the guide-stripe code from the tiny version
The option is not available, so including the code is pointless.
2019-03-14 19:34:35 +01:00
Benno Schulenberg 4205567bb1 tweaks: add deprecation comments to the four superseded options 2019-03-10 17:05:19 +01:00
Benno Schulenberg a20340b5a8 copyright: update the years for significantly changed files 2019-03-10 17:03:42 +01:00
Benno Schulenberg 66c6eb5166 new feature: option --guidestripe that shows a vertical guiding bar
Option -J (--guidestripe) takes a column number as argument and then
shows a vertical, colored bar over the entire height of the buffer,
to aid the user in regulating the width of the text when the terminal
is wider than this desired width.

This fulfills https://bugs.debian.org/916392.
Requested-by: Arturo Borrero González <arturo@debian.org>
And fulfills https://savannah.gnu.org/bugs/?55315.
Requested-by: Bryan Christ <bryan.christ@gmail.com>
2019-03-09 09:27:08 +01:00
Benno Schulenberg c3cd0f3411 help: reword the description of ^U to avoid the impression of "Undo"
Instead of "Uncut" use the word "Paste", which is the common name for
this function.
2019-03-07 20:36:03 +01:00
Benno Schulenberg 37c8232f4d bindings: provide usable shortcuts for prevword/nextword in tiny version
In the tiny version the feature toggles are absent, so most of the
Meta-key combinations do nothing, and when --with-slang was used, the
<Ctrl+Left/Right> keystrokes do not work (as they produce truncated
escape sequences under Slang), and the <Ctrl+Space> and <Alt+Space>
keystrokes are awkward to type and make no sense.  So... use some
of the free Meta combinations to jump a word to the left or right,
since these functions *are* present in the tiny version.
2019-03-03 14:25:51 +01:00
Benno Schulenberg de47b58dc1 tweaks: move declaration of variable that does not need to be global
More importantly: searching in src/history.c will now not only find
the uses of 'position_history' but also its declaration.
2019-02-27 19:54:43 +01:00
Benno Schulenberg 79ca3ceabf copyright: update the years for the FSF 2019-02-24 19:35:56 +01:00
Benno Schulenberg b5ca8a00af tweaks: rename three functions and two symbols, to match the new wording 2019-02-24 17:32:17 +01:00
Benno Schulenberg 2c7d336711 bindings: rename 'cutwordleft' to 'chopwordleft', and similar for right
These bindable functions should not connote cutting, as they don't put
anything into the cutbuffer.
2019-02-24 17:31:40 +01:00
Benno Schulenberg 15c3e924b8 help: reword the tags for deleting a word left and right
Don't use the word "Cut", as the words are discarded and
not added to the cutbuffer.
2019-02-24 16:49:44 +01:00
Benno Schulenberg 031166c34d help: don't list the unbound <Alt+Up> and <Alt+Down> in the tiny version 2019-02-24 11:27:10 +01:00
Benno Schulenberg df4d181987 help, docs: say "Delete" when things don't go into the cutbuffer
Reported-by: Božidar Putanec <bozidarp@yahoo.com>
2019-02-24 11:00:06 +01:00
Benno Schulenberg 7fcf6e6068 menus: don't show ^S and ^Q in the help lines in the tiny version
On small terminals (80 columns or so), ^S and ^Q would be in
the last position of the help lines.  But some terminals might
intercept ^S and stop all output (until ^Q is pressed), which
could be unexpected and frustrating.  So, rearrange things for
the tiny version so that ^S appears only on very wide terminals.

Also, having two keystrokes for saving the current buffer
(^O and ^S) in the two help lines is wasteful, more so as
in the tiny version there are no ^G help texts.

So, show the more useful M-Q and M-W instead.

This addresses https://bugs.debian.org/915017.
Reported-by: Steve McIntyre <steve@einval.com>
2019-02-21 17:42:51 +01:00
Benno Schulenberg 322a6f46fa tweaks: switch from checking SMOOTH_SCROLL to checking JUMPY_SCROLLING 2019-02-19 19:52:57 +01:00
Benno Schulenberg 54055b6174 tweaks: switch from referencing NO_WRAP to referencing BREAK_LONG_LINES 2019-02-19 19:45:55 +01:00
Benno Schulenberg 7811f3fc5a menus: put the ^T toggle in Search in the same position as in Goto-Line
So that when toggling it, the ^T in the help lines stays roughly in the
same place.
2019-02-17 10:24:03 +01:00
Benno Schulenberg 5f07b96d47 menus: move the paragraph-jumping functions from Search to Goto-Line
The start-of-paragraph and end-of-paragraph seeking functions are only
vaguely related to searching, and have nothing to do with replacing --
the functions make more sense in the Goto-Line menu.

Also, the Goto-Line menu is much less crowded, so the functions are
more likely to be noticed there.  Furthermore, this makes harmless a
typo that I sometimes make: typing ^W again when I've already done so.
2019-02-17 09:53:35 +01:00
Benno Schulenberg bc98dbcab4 menus: remove the ^Y and ^V shortcuts from the Search menus
Jumping to the first or last line of the buffer doesn't have anything
to do with searching, so these functions shouldn't be present in the
search menus.  They make perfect sense in the Goto-Line menu, though.
2019-02-17 09:52:57 +01:00
Benno Schulenberg cf634d1aff browser: show the ^G item again in the help lines
Also, prune another statement as MMOST no longer includes MBROWSER.

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

Bug existed since version 3.2, commit cc01bc3e.
2019-02-06 16:36:42 +01:00
Benno Schulenberg 4b8bd27d08 bindings: change the action of <Alt+Up>/<Alt+Down> to 'scroll linewise'
Using the cursor keys for movement-related functions makes more sense
than using them for jumping to the previous or next occurrence of the
search string.

(For searching another occurrence backward the M-Q binding has become
available, while M-W will search another occurrence always forward.)
2019-01-24 20:24:09 +01:00
Benno Schulenberg 125cc0cd74 tweaks: elide a tiny function by making a variable global
And in the bargain it makes things clearer, because the name
cutbuffer_reset() is misleading.
2018-12-30 13:36:29 +01:00
Benno Schulenberg 0946153b47 tweaks: hard-bind ASCII DEL in a slightly more economical way
And in the bargain get rid of a duplicate help-text entry for
either "Del" or "Bsp".
2018-12-28 17:20:18 +01:00
Benno Schulenberg 55c52c50d0 bindings: hard-bind ASCII code 0x08 (BS) to the backspace function
ASCII code BS should always do a backspace, also on systems where the
"^H" string gets redirected (for rebinding purposes) to KEY_BACKSPACE.

This fixes https://savannah.gnu.org/bugs/?55247.
Reported-by: Norton Warner <nortonwarner@gmail.com>
2018-12-23 18:45:12 +01:00
David Lawrence Ramsey 77bd8c2630 tweaks: swap the names of the variables 'wrap_at' and 'fill'
Now 'fill' contains the original specified value,
and 'wrap_at' the column that 'fill' translates to.
2018-12-18 19:50:59 +01:00
Benno Schulenberg e8751d1d5c bindings: make the normal scrolling keystrokes work also in help viewer
There is no reason why they shouldn't work.
2018-12-17 17:05:56 +01:00
Benno Schulenberg 38ca2a41f4 tweaks: reduce the scope of two variables, and rename one of them
Also, swap the order of the 'if', and don't bother setting a freed
string pointer to NULL as it will never be used again.
2018-12-11 10:59:12 +01:00
Benno Schulenberg 3a79766da6 rcfile, docs: remove deprecated forms of two options and five bindables
This addresses https://savannah.gnu.org/bugs/?53785.
2018-12-03 10:25:55 +01:00
Benno Schulenberg 0f79a42333 browser: say "Close" instead of "Exit" for the ^X shortcut
When multiple buffers are open, the edit window says "Close" for ^X
instead of "Exit" (when one buffer is open).  In the help viewer ^X
says "Close".  Apparently the idea is that ^X should say "Exit" only
when pressing ^X leads to exiting from nano.  Pressing ^X in the file
browser does not exit from nano, so make it say "Close" instead.

(The help viewer says "Close" since version 2.8.6, commit 934a2192.)
2018-12-03 10:07:42 +01:00
Benno Schulenberg 3b79c7168e help: don't advertise ^S and ^Q when --preserve is used
When using --preserve, ^S and ^Q are "eaten" by the terminal and
do not reach nano: they have no effect in nano, so the help lines
and the help texts should not mention these shortcuts.

Also, to keep the help lines in the help viewer neatly arranged,
^L is not bound there when --preserve is used.
2018-12-03 09:50:00 +01:00
Benno Schulenberg 9a77c997e2 tweaks: remove two tag definitions that are no longer needed 2018-11-26 09:13:22 +01:00
Benno Schulenberg 2cee79fbbf tweaks: remove a variable that is no longer used
It was made superfluous by David's overhaul of the justify mechanism.
2018-11-26 09:07:22 +01:00