Commit Graph

750 Commits (77bd8c2630bcf500529492fa2d9e8ae52d112647)

Author SHA1 Message Date
Benno Schulenberg 772c324f25 bindings: remove backup and new-buffer toggles (M-B, M-F) from main menu
These are available in the menus where they are relevant: the Write-Out
and the Insert menu, respectively.  Having them duplicated in the main
menu is inconsistent and eats precious keystrokes.  (Sorry, Chris.)
2018-08-25 10:07:28 +02:00
Benno Schulenberg f1e5872e6a tweaks: reshuffle the order of the bindings, for help-line esthetics 2018-08-25 10:06:13 +02:00
Benno Schulenberg 6d62682ddb bindings: move the noconvert toggle from the main to the insert menu
Also add feedback, so that it will be clear whether a file will be
inserted unconverted or not.

This addresses https://savannah.gnu.org/bugs/?54536.
2018-08-25 10:04:03 +02:00
Benno Schulenberg 3218d8358a tweaks: remove a redundant "struct" word, and replace it in comments 2018-08-20 19:33:31 +02:00
Benno Schulenberg a3a10dfafe tweaks: don't bother having debug code that deallocates all memory
Who runs debug builds for any length of time?
2018-08-18 11:00:03 +02:00
Benno Schulenberg e40e6bbf10 tweaks: rename a function to better match its counterpart
Also rename its parameter, to describe what it ought to be.
2018-08-11 09:55:22 +02:00
Benno Schulenberg 2147e161bf rcfile: when a vital function is not mapped, mention in which menu
Add the reverse of the name-to-menu function to accomplish this.

This fixes https://savannah.gnu.org/bugs/?54449.
2018-08-11 09:46:03 +02:00
Benno Schulenberg dc079bdf31 tweaks: implement the name-to-menu function in another manner
Use arrays, to make it easy to also implement the reverse function.
2018-08-11 09:45:02 +02:00
Benno Schulenberg 975b491235 dropping a feature: remove the ability to use the 'formatter' command
Since the last version, the user can filter an entire buffer through
an external command.  This external command can also be a formatting
program, so there is no longer any need for this specific and special
formatter command.
2018-08-09 20:29:30 +02:00
Benno Schulenberg 418bd3be34 rcfile: allow to rebind the Cancel function in the yesno menu
This fixes the first part of https://savannah.gnu.org/bugs/?54447.
2018-08-05 20:01:47 +02:00
Benno Schulenberg 4170454837 tweaks: exclude a global flagging variable when it is not needed 2018-08-05 13:00:44 +02:00
Benno Schulenberg e90b7cf4aa tweaks: elide an unneeded/duplicate variable 2018-08-04 11:34:44 +02:00
Benno Schulenberg bb90de0eb4 tweaks: rename a constant, to match what it actually means
Wrapping is concerned with columns, not with number of characters.
2018-08-04 11:21:42 +02:00
Benno Schulenberg ac102a7516 tweaks: show "Space" and "Bsp" in the help text of the browser
These keys make more mnemonic sense for scrolling than F7 and F8.

Also adjust the nanohelp syntax to cover the lone word "Space".
2018-07-31 20:36:32 +02:00
Benno Schulenberg d249233ea7 bindings: unassign the M-? keystroke, to free it up for future use
There are at least three other ways to achieve the thing that it did:
^End, M-/, and ^W^V.  No need to have a fourth way by default.

For symmetry, also unassign the corresponding binding for M-|.
2018-07-31 20:36:27 +02:00
Benno Schulenberg 33fb54c75f bindings: reassign the M-| keystroke to 'cutwordleft' by default
The 'cutwordright' function has gotten ^Delete as its default binding,
so the 'cutwordleft' function needs a default binding too -- also to
keep the items on the two help lines nicely paired.  M-| was chosen
because it is close to the Backspace key on many keyboard layouts.
2018-07-31 20:36:07 +02:00
Benno Schulenberg c231b774d7 tweaks: reshuffle some lines, in order to elide one 2018-07-30 21:03:08 +02:00
Benno Schulenberg 0c263bda7d tweaks: elide a bunch of unneeded constant strings 2018-07-30 20:45:15 +02:00
Benno Schulenberg 54a4123d4c bindings: remove the 'searchagain' function entirely
The user is obliged to make use of 'findprevious' and 'findnext' instead.

Also, adjust the description of 'wherewas' to its wider availability.
2018-07-29 11:43:13 +02:00
David Lawrence Ramsey 7a31507167 bindings: make ^Q start a backward search also in the file browser
This makes the four search keystrokes (^W/^Q/M-W/M-Q) available in
all three areas of nano: editor, help viewer, and file browser.
2018-07-29 11:43:13 +02:00
Benno Schulenberg 7f2031006a bindings: make ^Q and M-Q available also in the help viewer
As the help viewer is almost a normal buffer, commands that make sense
-- like searching backwards, and searching the previous occurrence --
should work in the help viewer too.

In addition, show all Search commands prominently in the help lines of
the help viewer, so that users are likely to notice them and will maybe
infer that they work in the editor itself too.

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

With-help-from: David Lawrence Ramsey <pooka109@gmail.com>
2018-07-29 11:43:13 +02:00
Benno Schulenberg 7e18b91ead help: move "Search Again" away from "Find Next" and "Find Previous"
Put "Where Was" in its place, to make the symmetry of ^W/M-W/^Q/M-Q
somewhat clearer.  Also, conditionally reshuffle "Save File", to try
and keep menu items nicely paired.
2018-07-29 11:43:13 +02:00
Marco Diego Aurélio Mesquita a67f6c6031 input: erase the next word when Ctrl is held while pressing Delete
Bind the until-now unbound function 'cutwordright' to <Ctrl+Delete>.
The complementary function, 'cutwordleft', is not bound by default
because on many terminals the keystroke <Ctrl+Backspace> generates
^H -- the canonical ASCII backspace character.  We cannot change the
existing action of ^H without upsetting some users.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2018-07-22 19:27:50 +02:00
Benno Schulenberg 8d8f5788ce rcfile: do not accept rebinding F0 nor function keys above F16
To match the documentation and to match what the nanorc.nanorc
colors as valid.

In theory it would be possible to allow rebinding also F17...F63,
but nano does not recognize escape sequences for these high-order
function keys.  As no one ever complained about unknown sequences
when pressing function keys, I am guessing that no one has these
high-order keys, or at least that no one uses them.

This fixes https://savannah.gnu.org/bugs/?54332.
2018-07-20 19:12:36 +02:00
Benno Schulenberg bfe65af6f3 bindings: bind M-Q to 'findprevious' by default, and M-W to 'findnext'
This makes things symmetrical: ^W starts a forward search, ^Q starts
a backward search, M-W searches the next occurrence forward, and M-Q
searches the next occurrence backward.

The Tabs-To-Spaces toggle is moved to M-O, and thus the More-Space
toggle is no longer bound by default.
2018-07-18 19:18:45 +02:00
Benno Schulenberg eb84205426 bindings: rename two bindable functions: copytext to copy, uncut to paste
To match the common names used for these functions, for consistency,
and because 'uncut' sounds too much like "undo the cut".
2018-07-13 19:46:56 +02:00
Benno Schulenberg 3bac3c4c78 rcfile: reject things like "M-Del" and "^{" as invalid key names
This fixes https://savannah.gnu.org/bugs/?54274.
2018-07-11 14:42:10 +02:00
Benno Schulenberg 0c455155ad prompt: concentrate manipulations of 'statusbar_x' into a single file 2018-07-11 10:45:58 +02:00
Benno Schulenberg 2e1e157967 copyright: update the years for significantly changed files 2018-06-01 10:18:32 +02:00
Benno Schulenberg dc3261b685 tweaks: avoid a warning with --enable-{tiny,help,multibuffer}
This also places the Pipe toggle among the other, similar togglles,
which makes more sense.
2018-05-29 09:07:39 +02:00
Benno Schulenberg 59eb01b403 build: fix compilation with --enable-{tiny,help,multibuffer} 2018-05-28 11:31:30 +02:00
David Lawrence Ramsey a6c0212158 bindings: add the "flippipe" bindable function
So the toggle for piping to an external command can be rebound.

This fixes https://savannah.gnu.org/bugs/?53987.
2018-05-27 10:36:33 +02:00
Benno Schulenberg 408d9b8708 build: fix compilation failure when configured with --enable-tiny 2018-05-23 11:57:55 +02:00
Marco Diego Aurélio Mesquita f304b9aee1 new feature: allow piping (selected) text to an external command
When executing a command, it is now possible to pipe the entire buffer
(or the marked region, if anything is marked) to the external command.
The output from the command replaces the buffer (or the marked region),
or goes to a new buffer.

This fulfills https://savannah.gnu.org/bugs/?28993,
and fulfills https://savannah.gnu.org/bugs/?53041.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2018-05-22 19:36:21 +02:00
Benno Schulenberg 4d92dffb3a bindings: rename constupdate to constantshow, cuttoend to cutfromcursor
This makes the names of these bindable functions equal to the names of
their corresponding options -- like for all the other toggles that have
a corresponding option.
2018-04-28 12:01:23 +02:00
Benno Schulenberg 4c1c425bbb bindings: add the 'linenumbers' bindable function
This makes the line-numbers toggle rebindable, like all the others.
2018-04-28 11:44:53 +02:00
Benno Schulenberg 544d426d86 tweaks: group some more of the empty functions together 2018-04-17 10:34:57 +02:00
Benno Schulenberg 7c5d099c6f tweaks: frob a couple of comments 2018-04-01 21:07:18 +02:00
Benno Schulenberg 152cc24d1f tweaks: reshuffle two declarations 2018-04-01 20:08:57 +02:00
Benno Schulenberg a865c25eea build: fix compilation when configured with --disable-help
This fixes https://savannah.gnu.org/bugs/?53532.
2018-03-31 16:52:22 +02:00
Benno Schulenberg eff2e0e291 help: describe the Scroll-Up and Scroll-Down commands more precisely
An "if possible" would have been nice, but there is no room for that.
2018-03-23 11:10:19 +01:00
Benno Schulenberg bf1a080923 build: exclude more things when configured with --disable-multibuffer
This will make the tiny version slightly smaller.
2018-03-23 11:09:37 +01:00
Benno Schulenberg b7f8d4819b tweaks: frob some comments plus miscellaneous other stuff 2018-03-22 19:54:20 +01:00
Benno Schulenberg 93318b972d tweaks: elide two parameters and thus a pair of wrapper functions
When just scrolling and the cursor does not need to change position
(that is: it is not on the first or last row of the edit window),
then edit_scroll() has handled everything and there is no need to
additionally redraw anything or update 'placewewant'.
2018-03-17 14:07:42 +01:00
Benno Schulenberg 8f1a657a37 bindings: revert the ^/ changes, as ^/ is not always Go-To-Line
On a Linux console, ^/ produces Backspace, making it unrebindable.

This fixes https://savannah.gnu.org/bugs/?53248.
2018-03-01 09:50:54 +01:00
Benno Schulenberg 3b8c898880 help: tweak the descriptions of ^X and ^R
It is not a problem to say that ^X closes the current buffer
even when nano is compiled without multibuffer support.
2018-02-27 18:11:16 +01:00
Benno Schulenberg 5eccaa7633 tweaks: refactor the implanting of a key expansion 2018-02-27 13:34:32 +01:00
Benno Schulenberg ffebd31cbb tweaks: shorten the name of two record elements
Exclude the confusing, pleonastic 'sc' abbreviation from their names.
2018-02-24 19:31:11 +01:00
Benno Schulenberg 1a926d79c5 help: mention that some keys work on a region when the mark is on
This fixes https://savannah.gnu.org/bugs/?53188.
Reported-by: Ken Tyler <kent@werple.net.au>
2018-02-23 12:35:12 +01:00
Benno Schulenberg c79fe1a160 bindings: show ^/ instead of ^_ for Go-To-Line
The slash is easier to read than the underscore (which almost
disappears at the bottom of the screen), and easier to type
(no Shift needed on a US keyboard), and it kind of harmonizes
with the ^\ for Replace and the M-/ for End-of-buffer.
2018-02-23 12:26:30 +01:00
Benno Schulenberg 0cf455bc48 build: fix compilation when configured with --enable-tiny
And when configured with --enable-tiny --enable-nanorc.
2018-02-14 19:29:29 +01:00
David Lawrence Ramsey 8f6ee22b41 tweaks: fix typo in rebindable function name
This fixes https://savannah.gnu.org/bugs/?53062.
2018-02-04 18:31:24 +01:00
Benno Schulenberg a083d7f1e1 tweaks: rename a variable to be more distinct and greppable 2018-02-04 18:25:10 +01:00
Benno Schulenberg 467cc8edf3 tweaks: remove two deprecated options and six rebindable function names
This addresses https://savannah.gnu.org/bugs/?48992.
2018-02-04 13:51:13 +01:00
Benno Schulenberg 6d111c9343 new feature: allow binding a key to a string (in a nanorc file)
In this way a single keystroke can produce a fragment of text or a
series of commands, or a mix of the two.  It is like a prerecorded
macro.

This fulfills https://savannah.gnu.org/bugs/?52931.
2018-02-04 12:44:12 +01:00
Benno Schulenberg bb667beb5a bindings: rename the bindable function 'gototext' to 'flipgoto'
This brings it in line with the other three "flip" toggles.
2018-02-04 10:34:39 +01:00
Benno Schulenberg f72fecee9b copyright: update the years for the FSF
And one for me, for the much changed keyboard stuff.
2018-01-24 10:14:43 +01:00
Benno Schulenberg 704a7d7b4f tweaks: rename two variables, for preciseness and shortness
Also remove an unneeded nulling.
2018-01-15 16:38:13 +01:00
Brand Huntsman 4b24ce1c11 startup: parse interface colors when they are read, not when initialized
When the palette is getting initialized, it is too late to send any
error messages about the rcfile options to standard error.

This fixes https://savannah.gnu.org/bugs/?52871.
Reported-by: Brand Huntsman <alpha@qzx.com>

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-01-15 13:04:55 +01:00
Benno Schulenberg 0bb6c0234f tweaks: condense the conditional compilation of shortcut reassignments
These three functions are needed only when both linter and speller
are available.
2018-01-09 13:31:58 +01:00
Benno Schulenberg c9ccb39752 tweaks: fully include Savefile and Wherewas in the tiny version
If help is enabled, those functions should be described too,
and if nanorc is enabled, they should both be rebindable.
2018-01-09 11:49:21 +01:00
Benno Schulenberg 17429d7f38 tweaks: fix some whitespace errors, and convert alignment tabs to spaces 2017-12-29 21:35:14 +01:00
Benno Schulenberg 87206c0607 tweaks: convert the indentation to use only tabs
Each leading tab is converted to two tabs, and any leading four spaces
is converted to one tab.  The intended tab size (for keeping most lines
within 80 columns) is now four.
2017-12-29 20:06:50 +01:00
Benno Schulenberg 440a128d25 indenting: keep affecting last line of marked region if it was at first
When unindenting/uncommenting affected the bottom line of the marked
region, keep affecting this line also during subsequent consecutive
indenting/commenting.

This fixes https://savannah.gnu.org/bugs/?52718.
2017-12-29 16:52:17 +01:00
Benno Schulenberg 4c20135749 help: swap the order of the Complete and Comment functions
So that Commenting comes closer to the somewhat related Indenting
and Unindenting functions.
2017-12-26 21:36:29 +01:00
Benno Schulenberg f9ebf038e0 tweaks: slightly rename four functions, for aptness and variety 2017-12-26 14:15:49 +01:00
Benno Schulenberg a10fdc3fb1 help: show that "Tab" will indent, just like "Sh-Tab" will unindent
Also, make the descriptions for indenting/unindenting more precise.
2017-12-26 13:46:34 +01:00
Benno Schulenberg 8581e702d6 tweaks: move some frequently-used keystrokes to the top of the list
So they will be found quicker.

Also fold two assignments into one.
2017-12-26 13:31:50 +01:00
Benno Schulenberg 7ad5afb935 tweaks: remove some unneeded parentheses, and shorten two function calls 2017-12-17 20:32:17 +01:00
David Lawrence Ramsey f66432e999 input: support backtab when Slang and/or --rebindkeypad is used
The escape sequence "Esc [ Z" is a backtab on most supported terminals,
so make sure convert_sequence() treats it as such.
2017-12-17 12:11:35 +01:00
Benno Schulenberg 09958ebdff input: allow using <Tab> and <Shift+Tab> to (un)indent selected region
When the mark is on, instead of letting a <Tab> simply insert a Tab
character at the cursor position, let it indent the marked region.

Original-idea-by: Chris Allegretta <chrisa@asty.org>
2017-12-12 20:37:41 +01:00
Benno Schulenberg 1e718cec35 tweaks: reshuffle a couple of lines, to put similar things together 2017-11-26 18:01:02 +01:00
Benno Schulenberg 5239e7c52b copyright: update some years, and standardize on the dashed format 2017-11-12 10:46:20 +01:00
Benno Schulenberg 7e6bb91593 tweaks: add a translator hint, and adjust two others 2017-11-07 19:39:00 +01:00
Simon Ochsenreither c16e79b612 startup: look for nanorc and history files also in the XDG directories
When not finding a .nanorc file in the user's home directory, nano will
look for a nanorc file in $XDG_CONFIG_HOME and in the ~/.config/nano/
fallback directory.  And when not finding a .nano/ subdir in the user's
home directory, nano will look for (or create) the history files in
$XDG_DATA_HOME or in the ~/.local/share/nano/ fallback directory.

This is a partial implementation of the XDG Base Directory Specification:
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html,
for the purpose of reducing the clutter in a user's home directory, and
to make it easier to back up just the configuration files.

Signed-off-by: Simon Ochsenreither <simon@ochsenreither.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-11-04 20:11:57 +01:00
Benno Schulenberg 1463781247 startup: when an rcfile contains errors, report this on the status bar
Suggested-by: Brand Huntsman <alpha@qzx.com>
2017-11-02 17:30:14 +01:00
Benno Schulenberg d5ac1ed395 tweaks: transform the token DISABLE_COLOR to ENABLE_COLOR 2017-11-01 19:45:50 +01:00
Benno Schulenberg 2a4fc9591f tweaks: transform the token DISABLE_SPELLER to ENABLE_SPELLER 2017-10-31 19:32:42 +01:00
Benno Schulenberg f034992ed6 tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY 2017-10-31 17:40:54 +01:00
Benno Schulenberg db0b849f9b tweaks: transform the token DISABLE_JUSTIFY to ENABLE_JUSTIFY 2017-10-31 17:40:44 +01:00
Benno Schulenberg 4e03a245ac tweaks: adjust two comments, and correct and a few cosmetic mistakes 2017-10-30 19:12:22 +01:00
Benno Schulenberg 028d12f4fb tweaks: transform the token DISABLE_OPERATINGDIR to ENABLE_OPERATINGDIR 2017-10-29 21:08:07 +01:00
Benno Schulenberg a5974bd1ec tweaks: transform the token DISABLE_WRAPPING to ENABLE_WRAPPING 2017-10-29 21:00:09 +01:00
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 42497f77e2 tweaks: rename some constants, to follow the same underscoreless scheme 2017-10-28 12:32:54 +02:00
Benno Schulenberg 86ef9db363 tweaks: remove a useless prefix from a hundred constants
And use a better word to describe the concise descriptions that
these constants refer to -- they are not messages.
2017-10-28 12:32:47 +02:00
Benno Schulenberg 160ababa55 tweaks: rename a macro, to make a little more sense 2017-10-28 12:32:36 +02:00
Benno Schulenberg d84fb8d209 tweaks: remove a superfluous no-op function call
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-10-28 12:32:27 +02:00
David Lawrence Ramsey ddd300af5f help: allow firstline and lastline to work at the search prompt
This addresses https://savannah.gnu.org/bugs/?52257.
2017-10-25 19:35:41 +02:00
Benno Schulenberg af20d45bc1 bindings: don't allow calling help when searching in the help viewer
This fixes https://savannah.gnu.org/bugs/?52246.
2017-10-18 21:46:34 +02:00
Brand Huntsman 08b49534d5 bindings: allow exiting from the help viewer with F1, like with ^G
Signed-off-by: Brand Huntsman <alpha@qzx.com>
2017-10-18 21:10:06 +02:00
Benno Schulenberg 57899550aa tweaks: change the arrows to triangles also for searching in file browser 2017-10-18 20:55:43 +02: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 58ecc034d0 tweaks: change the help-text arrows to triangles, to be more visible
Requested-by: Brand Huntsman <alpha@qzx.com>
2017-10-15 21:23:33 +02:00
Marco Diego Aurélio Mesquita 501d05c5d1 new feature: the ability to record and play back a series of keystrokes
Allow the user to record and run a single macro.  The default binding
for starting and stopping the recording is M-: (Alt + colon) and for
running the macro M-; (Alt + semicolon).

This fulfills https://savannah.gnu.org/bugs/?50314.
Requested-by: Peter Passchier <peter@passchier.net>

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-10-15 20:40:40 +02:00
Benno Schulenberg 3f735d22a1 bindings: make ^W start always a forward search (as there is ^Q now)
It would be silly for ^W to do a backward search too after using ^Q
once.
2017-10-14 20:34:51 +02:00
Benno Schulenberg ba65cd48cc bindings: make ^Q and ^S do something useful by default
^S will be the first thing people will try for saving a file,
and ^Q is somewhat mnemonic because it is to the left of ^W:
it searches backward.

Make these keystrokes available also in the tiny version.
2017-10-14 20:34:43 +02:00
Benno Schulenberg c7eecd74de new feature: a bindable function that starts always a backward search 2017-10-14 20:30:46 +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