Commit Graph

5766 Commits

Author SHA1 Message Date
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
Benno Schulenberg
e471e2d462 tweaks: move the modified editing keys again 2016-07-31 18:29:57 +02:00
Benno Schulenberg
fe38b78486 tweaks: adjust indentation after the previous changes 2016-07-31 18:22:07 +02:00
Benno Schulenberg
1af1f5c9f4 tweaks: return quicker from the key parsing routine 2016-07-31 18:19:17 +02:00
Benno Schulenberg
b9e83fe9f8 tweaks: move some debugging stuff, and move modified editing keys too
Again, just for preapring an easier return from the parsing routine.
2016-07-31 18:17:06 +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
19dfd20a88 tweaks: add a variable, in preparation for making returning easier 2016-07-31 18:10:31 +02:00
Benno Schulenberg
d12fdda15b tweaks: replace a three-case switch with an if and an else 2016-07-31 18:10:01 +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
91951ab22a input: don't bother putting a keycode into byte range
A keycode is either already in byte range (so there is nothing to do)
or it is not and it shouldn't be (so there is nothing to do either).
2016-07-30 12:19:47 +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
ecef093def tweaks: adjust indentation after previous changes 2016-07-29 09:33:28 +02:00
Benno Schulenberg
6d6f5bd4a7 tweaks: check earlier on for sufficient length of the sequence 2016-07-29 09:33:28 +02:00
Benno Schulenberg
e3dbffc9f7 input: be more strict in recognizing certain escape sequences
Accept the "Esc [ 1 n ~" and "Esc [ 2 n ~" sequences only when they
end with the "~" character, not with any character.
2016-07-29 09:33:28 +02:00
Benno Schulenberg
2225d54126 input: don't use a function call when a literal value will do 2016-07-29 09:33:28 +02:00
Benno Schulenberg
9115828e76 input: fix a pasto from eight years ago, from commit e347efb 2016-07-29 09:33:16 +02:00
Benno Schulenberg
b43a72471a docs: tweak some spacing and spelling 2016-07-29 09:05:40 +02:00
Benno Schulenberg
2b5d29b8c6 po: update translations and regenerate POT file and PO files 2016-07-28 09:38:30 +02:00
Benno Schulenberg
b40520b574 bump version numbers and add a news item for 2.6.2 2016-07-28 09:21:27 +02:00
Benno Schulenberg
992533b91e moving: don't do an automatic smart home with Ctrl+Up and Ctrl+Down
It is nicer to have a predictable cursor position and not see it hop
left and right on differently indented lines.
2016-07-28 09:09:51 +02:00
Benno Schulenberg
f3e8991206 credits: don't bother blanking the second line nor the help lines
Those lines don't exist in that mode -- the relevant subwindows are
smaller, or have been made smaller just before.
2016-07-27 12:40:11 +02:00
Benno Schulenberg
df7353b312 tweaks: compute the sizes of the subwindows in a more direct manner 2016-07-27 12:27:04 +02:00
Benno Schulenberg
f311c0af87 tweaks: adjust a couple of comments 2016-07-27 09:23:49 +02:00
Benno Schulenberg
c88fae3310 search: match a beginning-of-line anchor just once per line
This fixes https://savannah.gnu.org/bugs/?48635.
2016-07-27 09:04:06 +02:00
Benno Schulenberg
68cfb08888 tweaks: fix compilation with --enable-tiny 2016-07-25 17:29:24 +02:00
Benno Schulenberg
4cff67fdde tweaks: adjust indentation after the previous change, and edit comments 2016-07-25 12:50:03 +02:00
Benno Schulenberg
aefe26d216 tweaks: factor out a common condition 2016-07-25 12:31:40 +02:00
Benno Schulenberg
8eb99e2a1d tweaks: put similar things together 2016-07-25 12:18:40 +02:00
Benno Schulenberg
19b6f906cc tweaks: rename another variable, for aptness 2016-07-25 10:57:33 +02:00
Benno Schulenberg
c38ffdc741 tweaks: rename two variables, to match others 2016-07-25 10:53:49 +02:00
Benno Schulenberg
a472f480a7 tweaks: trim some comments, and simplify a condition 2016-07-24 13:44:16 +02:00
Benno Schulenberg
4416d9c941 tweaks: shuffle the resetting of a counter to the tail of the routine 2016-07-24 13:15:45 +02:00
Benno Schulenberg
c073c5ae54 tweaks: don't bother resetting the Unicode code holder
It will be initialized when a new code is started.
2016-07-24 13:09:24 +02:00
David Lawrence Ramsey
fc0ddab349 input: provide feedback on the Unicode digits typed so far
This fulfills https://savannah.gnu.org/bugs/?48154.
2016-07-24 12:19:42 +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
8c7a38596d screen: include a workaround only when compiling against older ncurses
The bug with a leading wide character has been fixed since ncurses-5.9.

See https://savannah.gnu.org/bugs/?31743 for reference.
2016-07-24 10:38:31 +02:00
Benno Schulenberg
1c2d2a4027 tweaks: adjust a comment for removed definitions 2016-07-22 15:57:20 +02:00
Benno Schulenberg
1e5614b31b tweaks: avoid two compiler warnings 2016-07-22 15:48:06 +02:00
Benno Schulenberg
04b9b9c78b tweaks: avoid a runtime error when compiled with -fsanitize=undefined
This fixes https://savannah.gnu.org/bugs/?48540.
2016-07-22 15:39:45 +02:00
Benno Schulenberg
41ad376b70 chars: plug a gushing memory leak 2016-07-22 15:30:09 +02:00