Benno Schulenberg
528b79b5f3
tweaks: rename a variable to be more accurate
...
When we get a ^J as verbatim input, it is not possible to include it
into the file buffer or the prompt answer, because this would mean
adding an encoded null to the buffer or answer, and that is not what
the user intended. One option would have been to simply ignore a ^J
in verbatim input. But the choice has been made to act the same way
as when the ^J (0x0A) is found in the file data: start a new line.
That is the same response as to the Enter key, yes -- but the code
for the Enter key is ^M (0x0D), not ^J. So, to be more precise,
rename the relevant variable from 'got_enter' to 'got_newline'.
2016-07-03 16:19:27 +02:00
Benno Schulenberg
03a81aa9c5
browser: trim all trailing slashes (just in case there are more)
2016-07-03 16:18:26 +02:00
Rishabh Dave
4957c1121d
browser: select an inaccessible directory also when tabbed
...
When the user tab-completed a name at the Go To Directory prompt, this
name will end in a slash. Remove this slash, so the name can be found
in the file list (where directory names don't include the final slash).
This fixes http://savannah.gnu.org/bugs/?48353 .
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-07-02 12:26:42 +02:00
Benno Schulenberg
d9d8eb2480
tweaks: straighten out the flow of a loop
2016-07-01 13:11:23 +02:00
Benno Schulenberg
d9aad9212f
tweaks: elide a bit of code duplication
2016-07-01 13:11:00 +02:00
Benno Schulenberg
8b636de1d3
tweaks: put all the movement functions together
...
And order them from smallest stride to biggest stride.
2016-07-01 12:42:58 +02:00
Benno Schulenberg
aeab800490
tweaks: improve a few comments
2016-07-01 12:34:33 +02:00
Benno Schulenberg
f8c33e8630
tweaks: reduce the scope of two variables
2016-07-01 12:22:44 +02:00
Benno Schulenberg
b6efea266e
chars: invalid sequences are not blank, nor text, nor punctuation
...
So, slightly speed up the functions that check for those.
2016-06-30 14:34:34 +02:00
Benno Schulenberg
8686cb3d3d
chars: measure invalid sequences and unassigned codepoints more quickly
...
Invalid multibyte sequences get depicted with the Replacement Character,
and unassigned codepoints are shown as if they were a space. Both have
a width of one.
2016-06-30 14:33:25 +02:00
Benno Schulenberg
91fff2a2c8
screen: avoid looking up the width of whitespace and control codes
...
Spaces and tabs and control codes never are multi-column glyphs, so
only look up the width for "normal", visible characters.
2016-06-30 14:32:10 +02:00
Benno Schulenberg
d6f43bd156
screen: elide the intermediate buffer for every single character
2016-06-30 14:29:14 +02:00
Benno Schulenberg
ebbe546033
screen: again, look at the bytes in their context
...
This avoids having to null-terminate every single-byte character.
2016-06-30 14:28:29 +02:00
Benno Schulenberg
cf0eed6c36
screen: don't check for every character whether there is still enough space
...
Just allocate ample space up front and thus discard the delaying 'if' for
each and every character. In most cases this will allocate far too much,
but that hardly matters: it is freed again as soon as the line is printed.
2016-06-30 14:27:00 +02:00
Benno Schulenberg
feacacc46d
chars: look at bytes in their context, so only valid sequences are accepted
...
This fixes https://savannah.gnu.org/bugs/?48125 .
(The fix is slightly wasteful; speeding things up will follow later.)
2016-06-29 20:56:50 +02:00
Benno Schulenberg
af53c56ec8
chars: speed up the determination whether something is a control character
...
Use knowledge of UTF-8 instead of converting to wide characters first.
2016-06-29 20:56:50 +02:00
Benno Schulenberg
019d7b34ca
chars: delete a now-unused function
2016-06-29 20:56:50 +02:00
Benno Schulenberg
622995fb12
chars: the representation of a control character is always two bytes
...
Any control character is represented by a ^ plus an ASCII character.
2016-06-29 20:56:50 +02:00
Benno Schulenberg
03586c60da
chars: represent the high-bit controls more intelligibly
...
Instead of showing the upper control codes like this:
^À ^Á ^Â ^Ã ^Ä ^Å ^Æ ^Ç ^È ^É ^Ê ^Ë ^Ì ^Í ^Î ^Ï
^Ð ^Ñ ^Ò ^Ó ^Ô ^Õ ^Ö ^× ^Ø ^Ù ^Ú ^Û ^Ü ^Ý ^Þ ^ß
show them like this:
^` ^a ^b ^c ^d ^e ^f ^g ^h ^i ^j ^k ^l ^m ^n ^o
^p ^q ^r ^s ^t ^u ^v ^w ^x ^y ^z ^{ ^| ^} ^~ ^=
The lower control codes continue to be shown like this:
^@ ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O
^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^\ ^] ^^ ^_
The representation of DEL (0x7F) continues as ^?.
Further, use knowledge of UTF-8 to avoid a roundtrip through
wide characters.
2016-06-29 20:56:50 +02:00
Benno Schulenberg
07a39e8e18
screen: don't simulate a sigwinch but directly reinitialize the screen
...
This fixes the second part of https://savannah.gnu.org/bugs/?48331 .
Reported-by: Mike Frysinger <vapier@gentoo.org>
2016-06-29 15:55:38 +02:00
Benno Schulenberg
1d7c177606
input: don't drop a keystroke on the floor when the terminal resizes
...
This fixes the first part of https://savannah.gnu.org/bugs/?48331 .
Reported-by: Mike Frysinger <vapier@gentoo.org>
2016-06-29 15:53:08 +02:00
Benno Schulenberg
2ae490cd8f
build: refresh the git description whenever something is recompiled
...
This fixes https://savannah.gnu.org/bugs/?47962 reported by Cody Taylor.
2016-06-27 19:45:21 +02:00
Benno Schulenberg
6fda7a7057
chars: speed up two reverse-searching routines a bit
...
By removing from their main loops a condition that occurs just once.
2016-06-27 19:22:28 +02:00
Benno Schulenberg
1e2833e07b
tweaks: elide two unneeded variables
2016-06-27 19:22:20 +02:00
Benno Schulenberg
067b0a3367
input: elide an extra buffer for inserting stuff into the text
...
Do the casting from integer to character rightaway in the first
intermediate buffer.
2016-06-27 19:18:40 +02:00
Benno Schulenberg
24b10179a1
files: beep whenever writing out a file fails
...
Just like when reading a file fails. It needs the user's attention.
2016-06-27 19:17:53 +02:00
Benno Schulenberg
c14b581e0a
po: update translations and regenerate POT file and PO files
2016-06-27 11:07:44 +02:00
Benno Schulenberg
bfcb4cd415
bump version numbers and add a news item for 2.6.1
2016-06-27 11:01:54 +02:00
Benno Schulenberg
8fef94cd7d
po: make the linguas script regenerate the POT file
...
So we don't have to remember its awkward target name.
2016-06-27 10:58:47 +02:00
Benno Schulenberg
61d7ca4c41
docs: adjust the description of the verbatim function
2016-06-27 09:35:05 +02:00
Rishabh Dave
559858a3dd
browser: don't seem to enter a directory when it is inaccessible
...
This fixes https://savannah.gnu.org/bugs/?48286 .
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2016-06-26 10:14:12 +02:00
Benno Schulenberg
ddd9c7a022
tweaks: try to distinguish between keystrokes and characters
...
Keystrokes are single integers (aided by the flags meta_key and
func_key) but in the input stream they can be encoded as escape
sequences (a series of bytes). Characters are values in byte
range, but in UTF-8 one character can consist of multiple bytes.
Also rename two variables, because the secondary input buffer
that they refer to contains only characters (mostly just one),
never any shortcuts; and there are too many "kbinput" already.
2016-06-25 20:34:09 +02:00
Benno Schulenberg
03c689c22c
tweaks: normalize a type, and rewrap a line
2016-06-25 20:33:11 +02:00
Benno Schulenberg
5270dd8b32
tweaks: add a reporter's name
2016-06-25 20:03:25 +02:00
Benno Schulenberg
f33796bee1
tweaks: elide an impossible case
...
Typing a Unicode code is always finished after at most six characters:
either retval == uni or retval == kbinput, but it can't be ERR.
2016-06-25 16:52:36 +02:00
Benno Schulenberg
e679c518b1
tweaks: elide an unneeded variable
2016-06-25 16:52:36 +02:00
Luke Francl
ba9214c689
syntaxes: add highlighting rules for Rust
...
With tweaks from Andrea Canciani, Ben Young, Tennix, and Dirkjan Ochtman.
This fulfills https://savannah.gnu.org/bugs/?48163 .
2016-06-25 09:56:11 +02:00
Benno Schulenberg
68acc1dfc5
tabs: compute the number of required spaces without iterating
2016-06-24 14:56:41 +02:00
Benno Schulenberg
1a4ec6c2d3
moving: allow specifying negative numbers in "Go To Line"
...
The negatives are taken to mean: from the end of the file,
and: from the end of the line.
This fulfills https://savannah.gnu.org/bugs/?48248 .
2016-06-24 14:47:02 +02:00
Benno Schulenberg
6bb30978fb
tweaks: add a translator hint
2016-06-24 09:40:31 +02:00
Benno Schulenberg
c0c30731c4
browser: don't use a term that is not explained in the documentation
...
Also, other messages that are about --operatingdir don't use the term
"confined" either.
Suggested-by: Mario Blättermann <mario.blaettermann@gmail.com>
2016-06-24 09:24:00 +02:00
Jordi Mallach
49eaa7c465
docs: bump pointers to the newest version available
...
Fix references to an old dist dir in FAQ and RPM spec file.
2016-06-23 19:53:58 +02:00
Jordi Mallach
c2b199e926
docs: use https for nano-editor.org, and drop the www
...
Switch to https and drop the www. prefix for all occurrences of the
website URL.
2016-06-23 19:51:01 +02:00
Benno Schulenberg
80552aeab7
tweaks: elide an intermediate copy of some line data
2016-06-22 10:30:52 +02:00
Benno Schulenberg
dfbabc0411
tweaks: fix a date and an email address
2016-06-22 10:30:42 +02:00
Benno Schulenberg
59b9b222c8
moving: ignore any number when ^Y or ^V is given
...
This fixes https://savannah.gnu.org/bugs/?48282 .
2016-06-21 16:47:11 +02:00
Benno Schulenberg
79e3eaf73c
linter: refresh the edit window in order to actually place the cursor
...
This fixes https://savannah.gnu.org/bugs/?48283 .
2016-06-21 16:25:07 +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
Benno Schulenberg
17fb6dfdc0
tweaks: reshuffle two lines and improve two comments
2016-06-20 13:07:25 +02:00
Benno Schulenberg
95f417fa9a
tweaks: rewrap a bunch of lines and some comments
2016-06-20 13:05:45 +02:00