Commit Graph

519 Commits (08cd197bf13ef5686c9fb090b278ed1db3b11548)

Author SHA1 Message Date
Benno Schulenberg 08cd197bf1 general: include word-jumping and block-jumping into the tiny version
And also case-sensitive searches, backward searches, and searching again.
2016-09-13 09:27:04 +02:00
Benno Schulenberg ed9e5d7183 docs: mark some rebindable function names as deprecated 2016-09-03 20:12:29 +02:00
Benno Schulenberg fd6308d6d3 tweaks: reshuffle a couple of items 2016-09-03 13:42:19 +02:00
Benno Schulenberg 1dbebbcadc screen: keep the help items aligned in more configurations
This fixes https://savannah.gnu.org/bugs/?48987.
2016-09-03 13:35:19 +02:00
Benno Schulenberg 57d1755d10 tweaks: preen some comments, and reshuffle a few ifdefs 2016-09-03 12:14:08 +02:00
Benno Schulenberg bace664fbc startup: allow to rebind the RegExp toggle also in the tiny version
This fixes https://savannah.gnu.org/bugs/?48988.
2016-09-03 11:45:49 +02:00
Benno Schulenberg 7b7d2bf7c9 tweaks: make tiny nano a teeny bit smaller 2016-09-02 12:01:03 +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 382c9d792d new feature: allow text selection by holding Shift with the cursor keys
Add the keycodes and routines to allow the user to forego setting the
mark explicitly (with M-A / ^6) and instead quickly select a few words
or lines by holding down Shift together with the movement keys.

(Some combinations with Shift are swallowed by some terminal emulators.
To work around some of those, the combinations Shift+Alt+Left/Right work
as Shift+Home/End and Shift+Alt+Up/Down work as Shift+PageUp/PageDown.)
2016-08-28 11:29:28 +02:00
Benno Schulenberg aeb49a8013 bottombar: only count help items that have a shortcut bound to them
This avoids showing a ghost item in, for example, the WriteOut menu
when not using --tempfile and the user does not bind 'discardbuffer'.
2016-08-27 12:22:59 +02:00
Benno Schulenberg c661506681 tweaks: use a separate function to ask ncurses for keycodes 2016-08-16 12:01:59 +02:00
Benno Schulenberg 928a24c204 input: look at the modifier keys only when compiled on Linux
This fixes https://savannah.gnu.org/bugs/?48751 reported by Andrew Ho.

This also fixes compilation when configured with --enable-tiny.
2016-08-14 21:42:08 +02:00
Benno Schulenberg 290d278f68 input: make the Ctrl+Arrow keys work on a Linux console
If this breaks your build, please send report or instructions or patch.
2016-08-07 18:20:34 +02:00
Rishabh Dave 1fd2354ad4 shortcuts: zero the value of 'toggle' for keys that are not toggles
This fixes http://savannah.gnu.org/bugs/?48698.

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-08-07 11:31:55 +02:00
Benno Schulenberg 90a90365a8 tweaks: rename three constants, for clarity, and hardcode two others 2016-08-01 12:56:05 +02:00
Benno Schulenberg cb10b2b908 tweaks: elide the global variable 'func_key'
There is no need to specially flag a function key or editing key --
the keycode is indication enough in itself: outside of byte range.
2016-07-31 18:13:05 +02:00
Benno Schulenberg 3930a697e8 tweaks: consistently use a parameter instead of a struct element 2016-07-30 13:05:52 +02:00
Benno Schulenberg 9322e1e6a4 tweaks: reshuffle two ifs for a little more speed
Saving roughly twenty microseconds at startup.
2016-07-30 13:04:06 +02:00
Benno Schulenberg b70fe38eab tweaks: normalize some indentation 2016-07-30 12:24:35 +02:00
Benno Schulenberg 1c528db8da tweaks: condense three asserts into a single one
Also, when a key string does not denote a Ctrl nor Meta nor Function key,
there is no point in assigning a keycode, because plain characters cannot
be used as a function shortcut.
2016-07-30 12:24:35 +02:00
Benno Schulenberg 1c9ab8bf16 tweaks: rename a struct element, to be more fitting
The keycode is not a sequence; it is a single integer value.
2016-07-30 12:24:35 +02:00
Benno Schulenberg e295070193 shortcuts: group the setting of key string and keycode into one function
And instead of using two key types, just use a bool to indicate whether
a keystroke involves Meta.
2016-07-30 12:21:42 +02:00
Benno Schulenberg 5b0ab8be62 shortcuts: remove any unnecessary classifying of keys
After initialization, the type of a key is never used nor needed
(other than for meta keys).
2016-07-30 12:13:47 +02:00
Benno Schulenberg c6dbcf91c3 new feature: functions to jump to previous or following block of text
And hard-bind the keys Ctrl+Up and Ctrl+Down to these functions.

Unlike the paragraph-jumping code, these new functions disregard
any indentation, treating only blank lines as separators.  They
also do an automatic smart home when that option is set.

This fulfills https://savannah.gnu.org/bugs/?48291.
2016-07-24 12:00:00 +02:00
Benno Schulenberg 6f12992cea new feature: add the option --wordchars, to set extra word characters
This allows the user to specify which other characters, besides the
default alphanumeric ones, should be considered as part of a word, so
that word operations like Ctrl+Left and Ctrl+Right will pass them by.

Using this option overrides the option --wordbounds.

This fulfills https://savannah.gnu.org/bugs/?47283.
2016-07-13 20:49:30 +02:00
Benno Schulenberg 960e848cc7 tweaks: elide a typedef, as it now has just one element 2016-07-12 09:35:48 +02:00
Benno Schulenberg 9106cc8ecc main: let the main loop restore the main menu, if needed
Don't make it the responsibility of the executed functions to restore
the list of shortcuts of the edit window.  Just detect whether another
menu was displayed, and if so, redisplay the main menu.
2016-06-21 11:03:38 +02:00
Mike Scalora 6a2032f5b0 new feature: comment/uncomment current line or selected lines
This allows for commenting or uncommenting a line or a bunch of lines
with a single keystroke (default binding: M-3).  The characters used
for commenting/uncommenting are specified by the active syntax file.

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Mike Scalora <mike@scalora.org>
2016-05-25 22:29:50 +02:00
Benno Schulenberg c8f530af93 statusbar: add a non-beeping message type that does not get overwritten
Error messages about lock files should not get overwritten by purely
informational messages, only by alerting ones.

This fixes https://savannah.gnu.org/bugs/?47963.
2016-05-21 13:58:09 +02:00
Benno Schulenberg eedec06cc4 tweaks: fix compilation when configured with --enable-tiny --enable-browser 2016-05-17 12:48:47 +02:00
Benno Schulenberg cdcd365d34 tweaks: normalize some whitespace 2016-05-17 11:33:21 +02:00
Benno Schulenberg 2535f51e01 statusbar: prevent error messages from overwriting each other
If during startup there are multiple error messages, currently only the
last one remains and can be read.  To improve on that, introduce a short
pause between error messages -- even if it's not enough to read them all,
at least the user will be aware that there are multiple ones.

This also causes a few error messages to beep that currently don't beep,
such as when a file is unwritable.
2016-05-16 18:03:07 +02:00
Benno Schulenberg 36df5ceef6 browser: make Ctrl+Left and Ctrl+Right jump to left and right column 2016-05-16 17:01:45 +02:00
Benno Schulenberg 3d82986725 help: add an extra blank line to the lists of searching shortcuts
To separate things that have little to do with each other.
2016-05-16 16:55:11 +02:00
Benno Schulenberg 71e452aef2 screen: improve the conditional placement of a help-line item
When compiled with --disable-justify, try to keep the vertical pairing
of related items.
2016-05-16 16:34:07 +02:00
Benno Schulenberg 338807a327 help: bring some air into the lists of shortcuts, giving the eye a hold 2016-05-05 13:27:07 +02:00
Benno Schulenberg 318ed6b105 scrolling: center the cursor when inserted stuff does not fit on screen
Since nano-2.4.1, reading in or pasting a large piece of text would put
the cursor on the bottom line, leaving only one line of the non-read or
non-pasted text visible.  This is different from the centering behavior
of Pico, and somewhat disorienting, as you can't see "where you are" any
more in relation to the file as it was.

So now center the cursor whenever the read or pasted text is larger than
the screen, but don't center it when the text fits entirely on the screen.
(The latter avoids the effect of the screen jumping unnecessarily when
inserting just a few lines while the cursor is near the bottom.)

To achieve this behavior: default to focusing, and temporarily set it to
FALSE when the focusing effect is unwanted.

This fixes https://savannah.gnu.org/bugs/?47841.
2016-05-04 10:13:36 +02:00
Benno Schulenberg e21e954742 browser: add a binding for the refresh function
And make the function actually refresh the list.  Useful for when files
have been added or deleted since opening the browser.
2016-05-02 12:00:56 +02:00
Benno Schulenberg e2556274f7 browser: provide tab completion also outside of the working directory
Add a global variable, 'present_path', so that 'cwd_tab_completion()'
knows where the user is in the browser, so that it can try completions
against names in that directory instead of always against names in the
current working directory (where nano was invoked).

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

Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-05-02 12:00:18 +02:00
Benno Schulenberg 53f4a9f5a8 screen: rename 'edit_refresh_needed' to 'refresh_needed'
For a little contrast with the function edit_refresh() -- it's
annoying that when you search for the latter you get to see all
the settings of the flag too.
2016-04-25 21:14:18 +02:00
Benno Schulenberg d92eb4fee3 all: eradicate SVN's $Id$ tags 2016-04-05 14:59:12 +02:00
Benno Schulenberg 51743233ed Removing the 'last_replace' variable that is never used.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-28 19:14:33 +00:00
Benno Schulenberg 8a244c607a Renaming three variables.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5709 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 20:22:27 +00:00
Benno Schulenberg 90f1ccf9ac Eliding the now too tiny function free_list_item().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5708 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 18:28:03 +00:00
Benno Schulenberg c02c182bd7 Deleting a now-unused struct member.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5707 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-04 17:04:56 +00:00
Benno Schulenberg a24aee417d Renaming a struct member.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5697 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 09:17:03 +00:00
Benno Schulenberg 07441adb14 Renaming another struct element, because it refers not just
to file extensions, but also to header lines and magic strings.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5690 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:19:13 +00:00
Benno Schulenberg 3522751c6b Renaming a struct element for aptness and contrast.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:09:29 +00:00
Benno Schulenberg 818a39cfb9 Condensing some code by factoring out a repetition.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5659 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:34:33 +00:00