Commit Graph

5971 Commits

Author SHA1 Message Date
Benno Schulenberg
2fa93ae999 tweaks: rename two variables to make more sense 2016-12-09 12:47:00 +01:00
David Lawrence Ramsey
c8c6340ce8 tweaks: conditionalize a bit of softwrap code
This addresses https://savannah.gnu.org/bugs/?49803.
2016-12-09 12:34:56 +01:00
David Lawrence Ramsey
6263416355 moving: always account for the margin when in line numbering mode
Like do_down() does already, do_pageup() and do_right() should use
editwincols instead of COLS.

This addresses https://savannah.gnu.org/bugs/?49796.
2016-12-09 12:23:23 +01:00
David Lawrence Ramsey
84d6f1a5b6 tweaks: adjust the type of four lockfile variables
The functions read() and fwrite() take size_t, not ssize_t.

And line numbers in the file should be displayed as a long type instead
of an int, since the effective type of ssize_t is not int, but long.
2016-12-09 10:05:33 +01:00
Benno Schulenberg
ecccb8d027 tweaks: correct the wording of a string 2016-12-07 21:06:05 +01:00
Benno Schulenberg
173bbe11ef tweaks: add a few translator hints 2016-12-07 21:05:41 +01:00
Benno Schulenberg
7531b71fa1 docs: note Sumedh as the author of the word-completion feature 2016-12-07 21:05:23 +01:00
Benno Schulenberg
964c10db17 tweaks: miscellaneous frobbings and rewrappings 2016-12-07 20:37:08 +01:00
Benno Schulenberg
0e01080983 binding: allow to rebind the word-completion function, and document it 2016-12-07 17:18:56 +01:00
Benno Schulenberg
68a0314500 build: add configure option --disable-wordcomp to disable word completion
(The variable 'pletion_line' is not conditionalized with this option, as
it would become messy.  The compiler will probably be able to elide it.)

When using --enable-tiny, it is not possible to use --enable-wordcomp,
because the word completion function uses the undo system.
2016-12-07 17:02:25 +01:00
Sumedh Pendurkar
dca4ab5d8f new feature: complete a fragment to a longer word found in the buffer
Executing the 'complete_a_word' function will search from the start
of the current buffer for entire words that begin with the fragment
that is before the cursor, and will complete this fragment to the
first word that is found.  Each consecutive call of 'complete_a_word'
will search for the next matching word and will complete the fragment
to that.  By default the function is bound to the ^] keystroke.

Signed-off-by: Sumedh Pendurkar <sumedh.pendurkar@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-12-07 16:42:39 +01:00
Benno Schulenberg
86121cf3fc tweaks: move a cursor-on switch to a more logical place (again)
But do it correctly this time: don't switch it on when replacing.
2016-12-05 15:47:44 +01:00
Benno Schulenberg
f03f5d5b51 docs: correct and improve the description of --disable-wrapping 2016-12-04 17:14:11 +01:00
Benno Schulenberg
379b1556ed prompt: remove two fragments of dead code
None of the prompts offer a total-refresh shortcut -- only the
edit window, the help viewer, and the file browser provide this.
2016-12-04 12:34:56 +01:00
Benno Schulenberg
bfcce57b69 screen: remove an unneeded blanking of the statusbar
It's redundant because the call of total_refresh() wipes everything.
2016-12-04 12:32:59 +01:00
Benno Schulenberg
4eac699df3 tweaks: remove some more annoying conditional compilation 2016-12-04 12:26:33 +01:00
Benno Schulenberg
454f5cbdce tweaks: remove a superfluous cleanup call
At the very beginning of do_replace(), nothing has been changed
or initialized yet, so there is nothing to refresh or clean up.
2016-12-04 11:56:13 +01:00
Benno Schulenberg
248d7be8ef build: clean out the revision.h file, to make 'make distcheck' pass 2016-12-04 11:21:10 +01:00
Benno Schulenberg
372bd0f7dd screen: switch the cursor back on only in the main loop
This fixes https://savannah.gnu.org/bugs/?49750.
2016-12-03 18:03:11 +01:00
Benno Schulenberg
f920e0d30c tweaks: replace some unneeded direct calls of edit_refresh() 2016-12-03 17:00:28 +01:00
Benno Schulenberg
0f3e303d1a tweaks: get rid of some spurious textual references to edit_refresh() 2016-12-02 18:13:10 +01:00
Benno Schulenberg
c9680b8b64 input: add the shifted PageUp and PageDown keycodes produced by VTE
Modern VTE-based terminals now produce codes for those keys and
no longer swallow them when nano is active.

This addresses https://savannah.gnu.org/bugs/?49746.
2016-12-01 17:34:57 +01:00
Benno Schulenberg
656563beda screen: don't restore the previous menu after a yesno prompt
There is no need for that -- it just causes flicker.

This fixes https://savannah.gnu.org/bugs/?49742.
2016-12-01 15:54:56 +01:00
Benno Schulenberg
8f95f9b1aa tweaks: reshuffle three initializations and trim some comments 2016-12-01 15:28:59 +01:00
Benno Schulenberg
c6512a9717 screen: don't request an update of the edit window for every yesno prompt
Only when doing replacements does the edit window need a refresh: for
every new spotlight.  So, do the update request in the latter routine.
2016-12-01 15:20:05 +01:00
Benno Schulenberg
07ce01c189 docs: tweak some lines in the NEWS file
(The previous commit fixed https://savannah.gnu.org/bugs/?49737.)
2016-12-01 14:01:38 +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
ac41587d4e oops: the yesno prompt for replacing does not want a visible cursor 2016-11-30 13:47:50 +01:00
Benno Schulenberg
e4b8d6fab5 tweaks: remove a bit of obscuring conditional compilation 2016-11-30 11:46:05 +01:00
Benno Schulenberg
72e8bcb027 tweaks: move a switching on of the cursor to a more logical place 2016-11-30 11:11:06 +01:00
Benno Schulenberg
7401670d58 tweaks: fix compilation when configured with --enable-tiny 2016-11-30 11:05:07 +01:00
David Lawrence Ramsey
87fbe24283 docs: add info about Slang to README.GIT, and improve info about glib2
For UTF-8 support under Slang, at least Slang 2.0 is needed.
And glib2 is also used for snprintf() if it's unavailable.
2016-11-29 12:28:23 +01:00
David Lawrence Ramsey
e4d452424b files: give feedback when restricted mode prevents overwriting a file
Achieve this by reusing the code that gives feedback when trying to
save a buffer while using --tempfile and the file has no name yet.

This fixes https://savannah.gnu.org/bugs/?48622.
2016-11-29 12:08:39 +01:00
David Lawrence Ramsey
d48071b2b2 input: properly check the full escape sequences for all keys
Also for Delete, End, PageUp and PageDown (on some terminals)
the last byte in the sequence needs to be checked.

This fixes https://savannah.gnu.org/bugs/?49710.
2016-11-27 20:31:12 +01:00
Benno Schulenberg
c1a484270b rcfile: actually avoid opening directories and devices
Achieve this elegantly by factoring out the reading of one rcfile.
2016-11-27 18:21:04 +01:00
Benno Schulenberg
981a1d39bf tweaks: factor out a small function 2016-11-27 17:30:53 +01:00
Benno Schulenberg
925a001658 rcfile: check the vital shortcuts just once, not for every included file 2016-11-27 16:40:54 +01:00
Benno Schulenberg
77023a749b tweaks: remove an annoying conditional compilation of an argument
Also remove some unneeded prototypes, adjust some comments, and
move a constant definition to the top of the file.
2016-11-27 16:34:34 +01:00
Benno Schulenberg
1762920808 rcfile: actually don't try to open things that cannot be syntax files 2016-11-26 17:48:31 +01:00
Benno Schulenberg
281a56fb74 tweaks: reshuffle some things in a more linear manner
Also improve or correct some comments.
2016-11-26 17:42:27 +01:00
Benno Schulenberg
592d0d6c9a files: trying to open a non-existent file will never succeed
If it would, the returned file descriptor would make nano crash,
because the corresponding stream has not been opened.  And when
returning zero instead (as the code did originally), nano would
open an empty buffer, although it claims to be reading the file.

In short: I think this is a leftover of an attempted fix of
https://savannah.gnu.org/bugs/?25297, from commit 2823c99.
2016-11-26 17:00:41 +01:00
Benno Schulenberg
3cc561e36e input: distinguish <Shift+Home> from <Home> on an rxvt terminal
That is: when --rebindkeypad is in effect -- without this option
they were already getting distinguished.
2016-11-26 12:25:36 +01:00
Benno Schulenberg
0333b87ad7 input: distinguish <Alt+Left> from <Alt+Right> on an rxvt terminal
Both would jump a word to the left -- now each jumps a word in the
proper direction.
2016-11-26 12:07:33 +01:00
David Lawrence Ramsey
059c8efb44 input: make Shift+Alt+Arrow work properly on rxvt and Eterm terminals
This fixes https://savannah.gnu.org/bugs/?49636.
2016-11-26 11:57:39 +01:00
Mike Frysinger
eb68cd1c6b syntax: avoid using black colors
We should avoid defining color schemes that are unreadable on common
white-on-black or black-on-white terminals.  Change the black in the
autoconf error strings to brightred for that reason.
2016-11-23 21:08:59 +01:00
Mike Frysinger
ecea413802 configure: fix ncurses lib symbol checking
When probing symbols provided by ncurses, use the sublibs that pkg-config
reported in case they're needed (like when libtinfo is a sep library).

URL: https://savannah.gnu.org/bugs/?49614
2016-11-23 14:26:03 -05:00
Benno Schulenberg
95253231e8 docs: mention that libncursesw5-dev is needed for building from git
In addition, tweak some of the wording.
2016-11-20 18:04:21 +01:00
Benno Schulenberg
eb5968f845 startup: activate restricted mode earlier, so --help will reflect it
Kind-of-discovered-by: Markus Bergholz <markuman@gmail.com>
2016-11-17 18:05:09 +01:00
Benno Schulenberg
f2c72bf759 binding: always initialize some keycode variables to a standard value
Also when somehow key_defined() is missing.

This fixes https://savannah.gnu.org/bugs/?49614.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2016-11-17 17:32:28 +01:00
Mike Frysinger
e472b72565 syntax: gentoo: various updates
- make version highlight less blindly greedy and conform to real versions
- move version matching before USE matching to avoid hitting USE flags
  that look like versions
- change USE regex to match the Gentoo PMS
- extend arch match to include more keywords
- make category matching more restrictive to avoid false positives
- drop operators =< and => that Gentoo doesn't support

URL: https://savannah.gnu.org/bugs/?49569
Reported-by: Konstantin Shakhnov <kastian@mail.ru>
2016-11-14 13:44:53 -05:00