1
1
Граф коммитов

8202 Коммитов

Автор SHA1 Сообщение Дата
Benno Schulenberg
2698a2ba68 syntax: c: recognize some C++ header files by their Emacs modeline
For extensionless files, recognize C/C++ ones from the mode name
between the -*- marks on the first line.

This addresses https://savannah.gnu.org/patch/?9719.

Inspired-by: Devin Hussey <husseydevin@gmail.com>
2019-10-06 12:01:02 +02:00
Benno Schulenberg
ff0e01a69e bindings: don't hard-bind ^H in the help viewer or the file browser
Hard-binding the ^H control code prevents the user from rebinding
the keystroke.

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

Bug existed since version 4.0, commit 72a49dbb.
2019-10-05 12:43:46 +02:00
Benno Schulenberg
72b13adeff po: update translations and regenerate POT file and PO files 2019-10-04 12:11:14 +02:00
Benno Schulenberg
481178428b oops: fix typo in Changelog 2019-10-04 12:00:09 +02:00
Benno Schulenberg
9a2ef3a542 bump version numbers and add a news item for the 4.5 release 2019-10-04 11:31:29 +02:00
Benno Schulenberg
b480e7fc9c tweaks: remove some timing code that has served its purpose 2019-10-03 19:00:50 +02:00
Benno Schulenberg
3e33d1eba6 tweaks: rewrap a line, reshuffle a declaration, and improve some comments 2019-10-03 17:22:55 +02:00
Benno Schulenberg
cdb9b04980 docs: add two examples of the 'tabgives' command to the sample nanorc 2019-10-03 16:41:10 +02:00
Benno Schulenberg
31ff7ead73 tweaks: move a function to before its callers and next to its kind
Also, improve the indentation of two random lines.
2019-10-03 11:24:01 +02:00
Benno Schulenberg
5398d986ef tweaks: speed up determining the width of plain ASCII characters 2019-10-03 11:09:21 +02:00
Benno Schulenberg
b02dccc51f tweaks: elide a function from a non-UTF8 build
In a non-UTF8 build, mbwidth() returns always 1, so it is pointless
to call that function and compare its result to zero then.

Also, don't bother special-casing the function for a non-UTF8 locale.
2019-10-03 10:48:10 +02:00
Benno Schulenberg
3158133edd tweaks: rename three variables, for contrast and more sense 2019-10-03 10:12:30 +02:00
Benno Schulenberg
acf50ae26d tweaks: improve a handful of comments, and reduce the needed padding
Reshuffle a few struct elements so they will require less padding.
2019-10-02 19:33:03 +02:00
Benno Schulenberg
01b840890d tweaks: rename another type, again to better fit the general pattern 2019-10-02 19:32:41 +02:00
Benno Schulenberg
9bd60e7d5d tweaks: frob a few comments 2019-10-02 17:46:20 +02:00
Benno Schulenberg
c5e46101b1 tweaks: reshuffle some lines, to elide an unneeded assignment 2019-10-02 17:39:45 +02:00
Benno Schulenberg
53b77cb4c6 tweaks: rename another type, to also better fit the general pattern 2019-10-02 17:18:51 +02:00
Benno Schulenberg
cc4ce8d83b tweaks: rename a type, to better fit the general pattern 2019-10-02 17:09:22 +02:00
Benno Schulenberg
23c8ef70aa tweaks: reshuffle some lines, to have the same order as elsewhere 2019-10-02 15:20:49 +02:00
Benno Schulenberg
2a4d338d97 tweaks: reshuffle a fragment, to group some toggles together 2019-10-02 15:07:04 +02:00
Benno Schulenberg
9c202198a3 tweaks: simplify a calculation, as done elsewhere 2019-10-01 15:03:40 +02:00
Benno Schulenberg
c8dc67717b tweaks: mark as 'const' a parameter that takes fixed strings [coverity] 2019-10-01 15:02:08 +02:00
Benno Schulenberg
4df2f81295 tweaks: avoid recomputing a maximum value every time round the loop 2019-10-01 13:28:50 +02:00
Benno Schulenberg
78def852d1 mouse: make the clickable width of menu items more consistent
When there are fewer than four menu items, act as if there are four:
make their clickable width half the width of the screen.

Until now, when there were two menu items, their clickable width would
be the full width of the screen, which was overwide.  But when there
was just one menu item, its clickable width would suddenly be as small
as when the menu had the maximum number of items (12 for an 80-column
screen).  This was odd.

Also, slightly simplify another computation.
2019-10-01 12:46:31 +02:00
Benno Schulenberg
a4933873c9 tweaks: avoid leaking memory when finding an invalid string [coverity] 2019-09-30 19:42:27 +02:00
Benno Schulenberg
1861052234 tweaks: avoid a comparison between signed and unsigned [coverity] 2019-09-30 19:30:54 +02:00
Benno Schulenberg
2307b31887 tweaks: use 'void' in prototypes of parameterless functions [coverity] 2019-09-30 19:06:25 +02:00
Benno Schulenberg
108a3b0b41 tweaks: sort two keywords strictly alphabetically 2019-09-29 15:11:15 +02:00
Benno Schulenberg
e0d9b7a8af tweaks: add a translator hint, and correct two others 2019-09-29 15:08:57 +02:00
Benno Schulenberg
b3ace4d8f6 tweaks: don't burden all menus with something meant for the WriteOut menu
The first_sc_for() function is somewhat costly, so avoid calling it
when it is not necessary.

Most menus have either so many entries that unbinding some keys does
not reduce the number of shown entries, or they have so few entries
that each entry already has space enough and will not profit from
having more room available.  But the WriteOut menu is an edge case.
Most translators don't use --tempfile and translate the key tags for
the WriteOut menu making use of all 17 positions that are available
for each of them.  This makes that when --tempfile is used, some of
those tags get truncated.  This is not so bad, because --tempfile is
normally not used.  But when it isn't used (when the discardbuffer
function isn't bound), the WriteOut menu should make full use of the
available width to avoid truncating any translated tags.
2019-09-29 13:27:03 +02:00
Dirkjan Ochtman
e9d6ceab0b syntax: rust: add the words reserved in 2018, and remove unreserved ones
See https://doc.rust-lang.org/reference/keywords.html,
and https://rust-lang.github.io/rfcs/2421-unreservations-2018.html.

Signed-off-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2019-09-28 13:29:23 +02:00
Benno Schulenberg
5103bfe6b8 bindings: add a dedicated keycode for <Tab> for when a region is marked
In this way the keycode cannot be unbound from the 'indent' function,
so pressing <Tab> on a marked region will always indent the region.

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

Bug existed since the "tabbing" of a marked region was introduced,
in version 2.9.2, commit 09958ebd.
2019-09-28 12:39:42 +02:00
Benno Schulenberg
cfd17f5722 tweaks: speed up the counting of the menu entries to be shown
Instead of first counting all available entries and then capping it
at MAIN_VISIBLE, simply stop counting when MAIN_VISIBLE is reached.
2019-09-28 12:03:02 +02:00
Benno Schulenberg
43235c2f16 tweaks: rename a function, to be a bit more fitting 2019-09-27 19:07:25 +02:00
Benno Schulenberg
b14ad451a9 tweaks: rename two variables, away from single letters 2019-09-27 18:53:44 +02:00
Benno Schulenberg
cd00d0975e tweaks: move a fragment of common code into the appropriate function 2019-09-27 18:49:39 +02:00
Benno Schulenberg
40f6dbc34e tweaks: move two functions to after the ones that they call 2019-09-27 18:41:22 +02:00
Benno Schulenberg
a9fb56a8c9 tweaks: move a function to a better file, to be amongst its kind 2019-09-27 17:43:28 +02:00
Benno Schulenberg
07c0d29276 gnulib: update to its current upstream state 2019-09-27 11:17:35 +02:00
Benno Schulenberg
310c971d50 docs: describe the new syntax-specific 'tabgives' command 2019-09-25 19:42:16 +02:00
Benno Schulenberg
3644d51b97 new feature: a 'tabgives' command to define what the Tab key produces
The 'tabgives' command is syntax-specific and should be followed by a
string containing the character(s) that a single press of the <Tab> key
should produce -- most likely a single TAB or a small bunch of spaces,
but any string is allowed.  This overrides the 'tabstospaces' option.

When one wants to make sure <Tab> inserts always four spaces and never
a TAB when editing a Python file, one could add to one's nanorc:

  extendsyntax python tabgives "    "

where there are four spaces between the quotes.  And when one wants
to ensure, when editing a Makefile, that <Tab> always inserts a TAB
and never spaces, independent of what tabstospaces is set to, one
could add to one's nanorc:

  extendsyntax makefile tabgives "	"

where there is a literal TAB character between the quotes.

This fulfills https://savannah.gnu.org/bugs/?53661,
Requested-by: Andrew Pennebaker <andrew.pennebaker@gmail.com>
And addresses https://savannah.gnu.org/bugs/?54760.
Requested-by: Henry van Megen <hvanmegen@gmail.com>
And addresses part of https://savannah.gnu.org/bugs/?54775.
Requested-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2019-09-25 19:35:07 +02:00
Benno Schulenberg
591d3170aa tweaks: add some translator hints, be more precise on permissible length 2019-09-24 17:15:42 +02:00
Benno Schulenberg
752dde1130 docs: mention that gcc must be at least version 5.0
This is needed to get '-std=c11' by default.

Reported-by: Ansuel Smith <ansuelsmth@gmail.com>
in https://lists.gnu.org/archive/html/nano-devel/2019-09/msg00004.html
2019-09-23 13:50:51 +02:00
Benno Schulenberg
b5eda7f812 tweaks: reshuffle two fragments, to group things better 2019-09-23 13:03:52 +02:00
Benno Schulenberg
4d44b03fc8 tweaks: rename a variable, to be more compact 2019-09-22 17:38:22 +02:00
Benno Schulenberg
2d16c27820 tweaks: add two hints for translators, to try and help avoid mistakes 2019-09-22 17:31:27 +02:00
Benno Schulenberg
ad65b79ac7 usage: mark the -J/--guidestripe option plus argument as translatable
This fixes https://savannah.gnu.org/bugs/?56930.

Bug existed since the vertical guiding bar was introduced,
in version 4.0, commit 66c6eb51.
2019-09-21 19:50:55 +02:00
Benno Schulenberg
fe5bd8cdef usage: properly align --help output also when it has accented characters
As printf() is not UTF8-aware, we have to determine ourselves how many
columns each short and long flag take up and add the required number of
spaces (not tabs, because their size is not fixed) to fill things up.

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

Bug existed since version 4.3, commit 2f169107.
2019-09-21 19:31:48 +02:00
Benno Schulenberg
c848ec3d53 tweaks: elide two multiplications with something that is always 1 2019-09-18 15:25:42 +02:00
Benno Schulenberg
ab6390cad0 tweaks: remove two superfluous macros, as sizeof(char) is always 1 2019-09-18 15:20:08 +02:00