Commit Graph

6851 Commits

Author SHA1 Message Date
Benno Schulenberg
ddb8e95d39 syntax: python: color also the special values 'False', 'None', 'True'
And increase the contrast for the reminders, both for PO and Python.
2017-12-10 14:35:13 +01:00
Benjamin Mintz
fbac4505ce syntax: python: add 'async', 'await', and 'nonlocal' as keywords
A list of keywords can be obtained from `keyword.kwlist`.

Signed-off-by: Benjamin Mintz <bmintz@protonmail.com>
2017-12-10 14:23:51 +01:00
Benno Schulenberg
eb937f81fa text: allow unindenting when not all lines are indented
And also allow it when lines are only partially indented.

This makes it possible to equalize the indentations of (accidentally)
unevenly indented lines: by first fully unindenting a group of lines,
and then reindenting them to the desired amount.

Suggested-by: Liu Hao <lh_mouse@126.com>
2017-12-09 17:44:12 +01:00
Liu Hao
5144162a2d syntax: c: increase the color contrast of reminders like FIXME
Bright white on yellow stands out much more than grey on yellow.

Signed-off-by: Liu Hao <lh_mouse@126.com>
2017-12-09 16:58:57 +01:00
Benno Schulenberg
b4411b4f28 wrapping: we're still on the same line if the next line has not changed
In this way we can delete things on the current line with ^K (after
Shift-selecting some text) without nano misdetecting a line change,

This fully fixes https://savannah.gnu.org/bugs/?52576.
2017-12-07 19:41:10 +01:00
Benno Schulenberg
29f7654ab1 wrapping: keep prepending to the same next line as long as possible
Only when the cursor has moved off of the currrent line do we stop
prepending wrapped words to the next line.

This partially fixes https://savannah.gnu.org/bugs/?52576.
2017-12-07 19:41:04 +01:00
Benno Schulenberg
66fd6a5ab1 options: rename 'justifytrim' to 'trimblanks', because it has morphed
The option now causes nano to trim trailing whitespace also when
hardwrapping occurs while the user is typing.
2017-12-06 20:38:13 +01:00
Benno Schulenberg
c30d3d8010 wrapping: delete trailing blanks upon hardwrapping, when requested
This fulfills https://savannah.gnu.org/bugs/?52198.
2017-12-06 20:32:08 +01:00
Benno Schulenberg
0c40f87b55 tweaks: invert the logic of a variable, and rename it
To get rid of two double negatives.
2017-12-03 20:49:01 +01:00
Benno Schulenberg
4761e00852 syntax: nanorc: don't color parts of valid strings as if invalid
It's better to color some invalid things as if valid than the other
way around.  So, as strings can validly contain any number of double
quotes, just accept *anything* between the delimiting double quotes
and demand that the closing quote is followed by whitespace or EOL.
2017-12-03 20:09:47 +01:00
Benno Schulenberg
0133d5cba8 tweaks: elide two variables that are used just once 2017-12-02 18:07:50 +01:00
Benno Schulenberg
9066a96dde tweaks: rename three variables, for more contrast and variety 2017-12-02 18:07:22 +01:00
Benno Schulenberg
6abb551fdd tweaks: avoid incrementing a variable that won't be used again later 2017-12-02 17:55:27 +01:00
Benno Schulenberg
97bdf13b59 tweaks: remove a redundant call of renumber()
The call of do_delete() four lines earlier already does a renumber.
2017-12-02 17:47:01 +01:00
Benno Schulenberg
dae88f8dc7 tweaks: remove a superfluous condition
When the WAS_FINAL_LINE flag is relevant (when NO_NEWLINES isn't set),
the only way for 'current' to be equal to 'filebot' is when 'current_x'
is zero.
2017-12-02 17:40:16 +01:00
Benno Schulenberg
64d1711a24 gnulib: pull in the fix for the missing stat include
This addresses https://savannah.gnu.org/bugs/?52546.
Reported-by: Marius Schamschula <mschamschula@gmail.com>
2017-11-30 21:27:08 +01:00
David Lawrence Ramsey
b9638cb7cc undo: when adding text adds a magicline, an undo should remove both
This fixes http://savannah.gnu.org/bugs/?52523.
2017-11-30 21:20:38 +01:00
Benno Schulenberg
d646a3b97b po: update translations and regenerate POT file and PO files 2017-11-27 19:21:00 +01:00
Benno Schulenberg
800a997008 bump version numbers and add a news item for the 2.9.1 release 2017-11-27 19:06:26 +01:00
Benno Schulenberg
c17a8a9836 undo: discarding the stack does not always lose information
When some or all edits have been undone, and the user starts to make
new edits, the old part of the undo stack is discarded, but this does
not mean that the undo stack doesn't go back to the very beginning.

This really fixes https://savannah.gnu.org/bugs/?52504.
2017-11-27 16:19:28 +01:00
Benno Schulenberg
20aa167c14 files: always update the stat info when the entire file is written
This fixes https://savannah.gnu.org/bugs/?52519.
2017-11-26 20:57:30 +01:00
Benno Schulenberg
0c9905dbd0 undo: clear the Modified state when the very first edit is undone
This also means that no question needs to be asked when exiting.

This fixes https://savannah.gnu.org/bugs/?52504.
Reported-by: Peter Passchier <peter@passchier.net>
2017-11-26 19:55:44 +01:00
Benno Schulenberg
73c7f1cbdc history: make nano's state directory accessible for the user only 2017-11-26 19:54:47 +01:00
Benno Schulenberg
4200ed3003 history: create the path '~/.local/share/' when it is needed
On a freshly installed system, or for a new user, the default
XDG data directory may not exist yet.  So, create it when not.

Reported-by: Brand Huntsman <alpha@qzx.com>
2017-11-26 19:54:47 +01:00
Benno Schulenberg
2b314ed18f selecting: let a justification cancel a softmark
Otherwise a second justification will cancel it, which is weird.
2017-11-26 19:54:29 +01:00
Benno Schulenberg
88a0bb9685 selecting: do not cancel the softmark when the cursor is not moved
The softmark is now only cancelled when the cursor is moved without
Shift being held, not for things like ^L (Refresh), ^C (Position),
or ^G (Help).

This addresses https://savannah.gnu.org/bugs/?52470.
2017-11-26 19:41:14 +01:00
Benno Schulenberg
1e718cec35 tweaks: reshuffle a couple of lines, to put similar things together 2017-11-26 18:01:02 +01:00
Benno Schulenberg
5487551ce9 history: save the positions file also when a record was deleted
When a file is closed with the cursor on line 1, column 1, this
position is not recorded in file-positions history file -- if a
record for the file existed, it is deleted.  In the latter case
the history file needs to be saved, so that other instances of
nano will know about the deletion.

This fixes https://savannah.gnu.org/bugs/?52505.
2017-11-26 09:28:36 +01:00
Benno Schulenberg
763bf2ed26 gnulib: update to its current upstream state 2017-11-23 18:00:18 +01:00
Benno Schulenberg
cf63a2910a files: save the marked region only when we've prompted for a file name
Otherwise we would overwrite the current file with just the selection.

This fixes https://savannah.gnu.org/bugs/?52482.
2017-11-22 20:56:37 +01:00
Benno Schulenberg
7c3c942097 tweaks: adjust indentation after previous change 2017-11-22 19:43:50 +01:00
Benno Schulenberg
77d24300f3 tweaks: reshuffle a couple of lines, and frob a comment or two 2017-11-22 19:36:33 +01:00
Benno Schulenberg
d33b5f3dab tweaks: rename, rewrap, and reshuffle some stuff, and frob some comments 2017-11-21 21:17:08 +01:00
Benno Schulenberg
c24e95e3d6 tweaks: elide the 'mark_set' boolean -- the 'mark' pointer is enough
The pointer not being NULL is enough indication that the mark is set.

Also, rename the pointer from 'mark_begin' to simply 'mark', since
the former is kind of pleonastic.
2017-11-21 21:14:33 +01:00
Benno Schulenberg
c42489d946 linting: switch the mark off when the linter starts
Because the highlighting hinders the display of affected lines,
and, more importantly, only the highlighted part would be written
if the file was modified and the user answers yes to the "Save?"
prompt.

This fixes https://savannah.gnu.org/bugs/?52474.
2017-11-21 21:12:16 +01:00
Benno Schulenberg
2b438e6ef4 input: make the macro key discoverable by giving feedback when undefined 2017-11-20 19:57:33 +01:00
Benno Schulenberg
8165b20fc1 build: fix compilation with --disable-browser --disable-tabcomp
While doing that, move the affected function to the utils.c file
and tweak it a bit.

This fixes https://savannah.gnu.org/bugs/?52468.
2017-11-20 19:37:08 +01:00
Benno Schulenberg
bacb0f717d syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program".  Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either.  So, they have been adjusted, new ones added, and
old ones deleted.

This fixes https://savannah.gnu.org/bugs/?52445.
2017-11-19 11:24:30 +01:00
Benno Schulenberg
11a3bc484c po: update translations and regenerate POT file and PO files 2017-11-18 12:11:52 +01:00
Benno Schulenberg
0465adb9ce bump version numbers and add a news item for the 2.9.0 release 2017-11-18 11:33:28 +01:00
Benno Schulenberg
7ea13d4269 tweaks: correct two minor things in the documentation 2017-11-17 21:52:31 +01:00
Benno Schulenberg
06049f5141 docs: update references to the nanorc files for the XDG changes 2017-11-17 21:40:54 +01:00
Benno Schulenberg
4220854367 docs: mention that macros work correctly only on terminal emulators 2017-11-13 21:08:36 +01:00
Benno Schulenberg
f6e83438da tweaks: elide a comment, and improve a couple of others 2017-11-13 19:58:29 +01:00
David Lawrence Ramsey
169da09424 files: don't change file format when inserting into an existing buffer
This fixes https://savannah.gnu.org/bugs/?52392.
2017-11-13 19:42:44 +01:00
Benno Schulenberg
e6a92b1406 painting: evade an ncurses bug by adding the A_PROTECT attribute
Adding the obscure A_PROTECT attribute to every color prevents an
occasional miscoloring of the first few rows on the screen -- when
ncurses is version 6.0 and dates from before October 17, 2015.

Original-idea-by: Brand Huntsman <alpha@qzx.com>
Tested-by: Brand Huntsman <alpha@qzx.com>

This fixes https://savannah.gnu.org/bugs/?52182.
2017-11-13 19:38:28 +01:00
Benno Schulenberg
ab14df074f search: wipe reassuring feedback as soon as searching has finished
When there are no help lines, there won't be any call to update the
actual contents of the bottom window, so... do it immediately after
blanking the row.

This fixes https://savannah.gnu.org/bugs/?52377.
2017-11-13 19:37:39 +01:00
Benno Schulenberg
5198c1f139 tweaks: frob a couple of comments 2017-11-12 20:08:28 +01:00
Benno Schulenberg
1e292141f3 docs: make it clearer that a Signed-off-by is wanted on patches 2017-11-12 11:54:17 +01:00
Benno Schulenberg
8649c78e1e tweaks: drop the ineffective cgitrc -- sorting by "age" does not work 2017-11-12 10:51:41 +01:00