Commit Graph

5960 Commits (86121cf3fc0f136150479cc86cb83da9e019debd)

Author SHA1 Message Date
Benno Schulenberg 3e40e5d4b5 docs: explain how to contribute code 2016-08-25 19:35:14 +02:00
Benno Schulenberg 2f9232a493 tweaks: adjust indentation after previous change 2016-08-25 11:45:38 +02:00
Benno Schulenberg 0d5fbfb91c tweaks: reshuffle some things, and remove a misplaced comment 2016-08-25 11:45:34 +02:00
Benno Schulenberg 56147434f3 prompt: don't crash when the terminal is less than four columns wide
This fixes https://savannah.gnu.org/bugs/?48792.
2016-08-25 11:45:13 +02:00
Benno Schulenberg 21cb01e543 tweaks: rename two variables, to make some sense
And move a statement to a better place.
2016-08-25 11:45:05 +02:00
Benno Schulenberg ea9aaee8c7 statusbar: leave out the brackets when the message is very long
This also prevents the message from spilling into the help lines
when the terminal is less than four columns wide.  (Not that one
can read anything then, but it looks better.)
2016-08-25 11:45:01 +02:00
Benno Schulenberg c22cd03f18 prompt: work around a VTE bug by outdancing an ncurses optimization
This fixes https://savannah.gnu.org/bugs/?48852.
2016-08-25 10:46:28 +02:00
Benno Schulenberg bd1c5d7c63 moving: make PgUp and PgDown functional also in very flat terminals
Even when the edit window consists of just one or two lines, the PageUp
and PageDown functions (^Y and ^V) should continue to move the window.

This fixes https://savannah.gnu.org/bugs/?48805.
2016-08-21 15:52:24 +02:00
Benno Schulenberg 00b293bf70 tweaks: adjust some braces and indentations 2016-08-21 15:39:00 +02:00
Benno Schulenberg 76a960d73d screen: continue to function also in a terminal with very few lines
This fixes https://savannah.gnu.org/bugs/?48787.
2016-08-17 10:13:22 +02:00
Benno Schulenberg 97eb0e515f tweaks: reshuffle some stuff in a more logical order 2016-08-16 19:22:56 +02:00
Benno Schulenberg 68010d931a startup: don't crash when dying early
That is: don't try to look at open files when none are open yet.
2016-08-16 16:59:37 +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 0dd2a55284 screen: don't die when the window is narrower than four columns
This fixes https://savannah.gnu.org/bugs/?48520.
2016-08-15 17:25:33 +02:00
Benno Schulenberg 49fc528d88 restore the GNU marker in nano's name 2016-08-14 21:42:37 +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 d8031af030 screen: retain the placewewant also when using an alternate speller
When using the default speller or the formatter, the placewewant is
remembered.  So it should be remembered too when the user specifies
a different speller.

(This behavior was inadvertently lost last year, in commit 82d737e.)
2016-08-12 20:02:04 +02:00
Benno Schulenberg f85648db68 po: update translations and regenerate POT file and PO files 2016-08-10 12:14:26 +02:00
Benno Schulenberg b2e2c89b62 bump version numbers and add a news item for 2.6.3 2016-08-10 11:48:32 +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
Benno Schulenberg 8edb096821 input: after an Esc, don't discard starter byte of a multibyte sequence
This fixes https://savannah.gnu.org/bugs/?48711.
2016-08-07 17:40:38 +02:00
Benno Schulenberg 0a387d9d08 usage: show that the option --wordchars needs an argument 2016-08-07 17:04:23 +02:00
Benno Schulenberg 6c16744292 files: avoid a warning about not being able to write a lockfile
Instead be more specific and say that the directory is not writable.
2016-08-07 13:00:35 +02:00
Benno Schulenberg 86a64b1bb5 tweaks: reduce two comparisons to a single one 2016-08-07 13:00:21 +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 c8bc05b10e chars: make searching case-insensitively some ten percent faster
It is quicker to do a handful of superfluous compares at the end of
each line than it is to compute and keep track of and compare the
remaining line length the whole time.

The typical line is some sixty characters long, the typical search
string ten characters -- with a shorter search string the speedup is
even higher: some fifteen percent.  Only when the string is longer
than half the average line length does searching become slower with
this new method.

All this for a UTF-8 locale.  For a C locale it makes no difference.
2016-08-07 11:02:41 +02:00
Benno Schulenberg ee57cbfa66 debug: add a timing instrument to the main search routine 2016-08-07 10:14:42 +02:00
Benno Schulenberg bd1fcc5fe2 tweaks: correct one comment, and adjust another 2016-08-06 12:17:24 +02:00
Benno Schulenberg 370406bb41 tweaks: don't optimize for a special case -- it is far too seldom 2016-08-06 11:11:56 +02:00
Benno Schulenberg 85844ee6ef chars: remove superfluous afterchecks
Now that mbstrncasecmp() does the right thing, there is no need any
more to verify that only a valid multibyte sequence was matched.

(See https://savannah.gnu.org/bugs/?45579 for a test case.)

Also, this will make it possible to search for invalid sequences.

(Currently it isn't possible to enter a search string with invalid
characters, but... a user might edit the search history file.  And
if pasting at the prompt is implemented, it will be trivial to enter
invalid sequences if you have a file that contains them.)
2016-08-06 11:10:39 +02:00
Benno Schulenberg e38e2c634b chars: don't persist when only one of the compared sequences is invalid
Persisting might lead to count 'n' reaching zero, which would mean that
the needle has matched, which is wrong when one of the strings contains
an invalid or incomplete multibyte sequence.
2016-08-06 10:34:38 +02:00
Benno Schulenberg d80109dd5e chars: properly compare strings of different lengths
That is: don't run towlower() on the two differing bytes when having
reached the end of one of the strings.

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

In the bargain, don't do the conversion to lowercase twice.

Furthermore, persist when encountering invalid byte sequences --
until finding bytes that differ.
2016-08-05 16:07:55 +02:00
Benno Schulenberg b305911cba chars: straighten out the flow of a loop, so it is easier to follow 2016-08-04 13:40:55 +02:00
Benno Schulenberg d60f95137e chars: remove a special case that never occurs
The needle is never part of the hay -- it is always a separate string.

(And even if needle and haystack were identical, the routine works fine,
the case does not need special treatment.)
2016-08-04 13:40:19 +02:00
Benno Schulenberg 14ac47517b spelling: don't abort when a misspelled word isn't found, just note it
This fixes https://savannah.gnu.org/bugs/?48660 doubly, in case there
are other ways in which 'spell' sees words differently from 'nano'.
2016-08-03 12:55:21 +02:00
Benno Schulenberg 20058a1b63 spelling: don't consider digits as word parts, because GNU spell doesn't
This fixes https://savannah.gnu.org/bugs/?48660.
2016-08-03 12:43:57 +02:00
Benno Schulenberg f6dd0ad18a tweaks: compile a parameter unconditionally
Straightforward code is more important than the tiniest possible binary.

Also adjust some comments and rename a variable.
2016-08-02 17:30:58 +02:00
Benno Schulenberg a7ae1766c0 locking: remove any lock files when dying
This fixes https://savannah.gnu.org/bugs/?48675.
2016-08-02 17:30:40 +02:00
Benno Schulenberg faa46a3c71 screen: remove redundant redrawings of the entire edit window
(It may have been necessary in the past; there is no need for it now.)

This fixes https://savannah.gnu.org/bugs/?48633.
2016-08-01 19:41:13 +02:00
Benno Schulenberg 03b168d0e3 tweaks: restore earlier conditions to prevent superfluous redrawings
When doing an <Up> on the top line, or a <Down> on the bottom line of
the edit window, the affected lines have already been redrawn by the
scrolling code, so there is no need to do that again.

(However, that does not prevent the second line (or the last-but-one
line) from being redrawn unnecessarily when using the M-- (or M-+)
command elsewhere on the screen and /that/ line is horizontally
scrolled.  But we'll let that pass for now.)
2016-08-01 19:41:13 +02:00
Benno Schulenberg 2f6647687a tweaks: rename a function, and adjust some comments 2016-08-01 19:41:13 +02:00
Benno Schulenberg c9e9964207 screen: don't look at placewewant but at where we actually were and are
For horizontal scrolling, it is not the /desired/ column position that
is relevant for determining whether a line needs to be redrawn after a
cursor movement, but the /actual/ column positions before and after.

This fixes https://savannah.gnu.org/bugs/?48627,
and fixes https://savannah.gnu.org/bugs/?48629.
2016-08-01 19:41:13 +02:00
Benno Schulenberg 0a3a6441bc tweaks: unconditionally compile a couple of parameters
Having two unneeded parameters in the tiny version is acceptable --
the code gets so much more readable.
2016-08-01 19:41:13 +02:00
Benno Schulenberg 2eafe7bf58 files: make allowances for 32-bit PIDs
This addresses https://bugs.debian.org/831636 reported by Christoph Biedl.
2016-08-01 16:24:05 +02:00
Benno Schulenberg 08c51cfd45 input: ingest as verbatim just one control code or one or two escapes
Leave the rest of any escape sequence to be processed normally, which
should be possible because those characters are all in ASCII range.

This fixes https://savannah.gnu.org/bugs/?48318.
2016-08-01 14:47:02 +02:00
Benno Schulenberg b472f5a633 tweaks: remove some unnecessary keycodes from a switch statement
These codes are the basic codes that get assigned for the movement keys
in the list of shortcuts -- they don't need any translation.
2016-08-01 14:07:21 +02:00
Benno Schulenberg 5806bf5249 tweaks: normalize some whitespace and adjust several comments 2016-08-01 14:05:42 +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 9cd30d4917 tweaks: don't bother setting meta_key to false when a key is invalid
That is a task for the key-getting routine.
2016-07-31 18:32:18 +02:00
Benno Schulenberg f33d8cae30 tweaks: don't use a function call when reference to the variable will do 2016-07-31 18:30:53 +02:00