Benno Schulenberg
ab62d28817
syntax: javascript: require that a comment is preceded by whitespace
...
Either by whitespace or by the start of a line.
This avoids treating part of a URL as a comment.
2017-12-25 15:25:04 +01:00
Mike Frysinger
8e0a7ec20d
syntax: javascript: add newer keywords and string syntax
2017-12-25 15:08:03 +01:00
Benno Schulenberg
23d66949e1
tweaks: frob four comments, and rewrap two lines
2017-12-24 11:53:38 +01:00
Benno Schulenberg
184bb11fd9
tweaks: factor out a piece of common code
2017-12-24 11:25:10 +01:00
Benno Schulenberg
a70db34fc9
tweaks: remove two irrelevant conditions
...
They were mistakenly added by changeset fb85c055
, four commits ago.
2017-12-24 11:10:41 +01:00
Benno Schulenberg
fbde1b2d71
tweaks: reshuffle another bit of code, for conciseness
2017-12-24 10:56:16 +01:00
Benno Schulenberg
c22fef18e4
tweaks: reshuffle a bit of common code, moving it to an existing function
2017-12-23 21:50:18 +01:00
Benno Schulenberg
ee5b250b66
indenting: don't exclude last line of region when region is empty
...
This fixes https://savannah.gnu.org/bugs/?52717 .
2017-12-23 11:42:25 +01:00
Benno Schulenberg
fb85c05594
text: keep cursor at left edge when it IS there when indenting/commenting
...
Suggested-by: Brand Huntsman <alpha@qzx.com>
2017-12-21 19:47:22 +01:00
Benno Schulenberg
25b1114e03
tweaks: elide two parameters from the get_region() function
2017-12-21 19:47:22 +01:00
Benno Schulenberg
4b8a387529
text: let indenting/commenting skip the last line if its x is zero
...
If the marked region ends at the start of a line, do not include that
line in the indenting/undenting or commenting/uncommenting. This is
closer to what the eye would expect.
2017-12-21 19:47:22 +01:00
Benno Schulenberg
df41114e0e
tweaks: drop some old debugging code plus a superfluous comment
2017-12-21 19:45:18 +01:00
Benno Schulenberg
dc3618a127
text: set and reset the Modified state correctly when undoing/redoing
...
Unset the "Modified" marker only at the point where the file was last
saved -- if there is such a point, because it can be missing when the
undo stack was discarded.
This fixes https://savannah.gnu.org/bugs/?52689 .
Reported-by: Liu Hao <lh_mouse@126.com>
Original-idea-by: Brand Huntsman <alpha@qzx.com>
2017-12-19 19:22:52 +01:00
Benno Schulenberg
31fe0753e3
tweaks: limit the resetting of "Modified" to writing a full buffer
...
When doing that, there is no need to save and restore the Modified
state when writing a marked region.
2017-12-19 17:57:49 +01:00
Benno Schulenberg
7ad5afb935
tweaks: remove some unneeded parentheses, and shorten two function calls
2017-12-17 20:32:17 +01:00
Benno Schulenberg
e1b0f2b275
display: ensure that cursor is visible when compiled with --with-slang
...
This fixes https://savannah.gnu.org/bugs/?52651 .
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-12-17 16:34:02 +01:00
Benno Schulenberg
0e0fb452a3
input: optimize a bit for non-shortcut keys, as they are most frequent
2017-12-17 12:49:04 +01:00
David Lawrence Ramsey
f66432e999
input: support backtab when Slang and/or --rebindkeypad is used
...
The escape sequence "Esc [ Z" is a backtab on most supported terminals,
so make sure convert_sequence() treats it as such.
2017-12-17 12:11:35 +01:00
Benno Schulenberg
08e9d30fa2
tweaks: condense some debugging code, and rewrap a line
2017-12-16 21:50:10 +01:00
Benno Schulenberg
d2270e514b
input: make <Ctrl+Shift+Arrow> work also when using --rebindkeypad
...
The function get_keycode() should never return zero -- it should
return either the code from ncurses or the given fallback code.
This fixes https://savannah.gnu.org/bugs/?52682 .
2017-12-16 21:09:01 +01:00
Benno Schulenberg
031305c205
tweaks: strip some debugging stuff, and condense a bit of code
2017-12-16 19:56:15 +01:00
Benno Schulenberg
e2843ede7e
text: let a Shift-selection persist when indenting and commenting
...
To achieve that, fake the Shift key being held when indenting/
unindenting/commenting/uncommenting.
Reported-by: Brand Huntsman <alpha@qzx.com>
2017-12-12 21:09:28 +01:00
Benno Schulenberg
09958ebdff
input: allow using <Tab> and <Shift+Tab> to (un)indent selected region
...
When the mark is on, instead of letting a <Tab> simply insert a Tab
character at the cursor position, let it indent the marked region.
Original-idea-by: Chris Allegretta <chrisa@asty.org>
2017-12-12 20:37:41 +01:00
Michael Francis
53fc9a66a6
syntax: php: function and variable names can contain uppercase and digits
...
Reference: http://php.net/manual/en/language.variables.basics.php
Also color keywords differently from strings.
Signed-off-by: Michael Francis <mikefrancis95@gmail.com>
2017-12-11 21:02:36 +01:00
Benno Schulenberg
a95c6c5fe8
tweaks: condense or rewrap a bunch of repetitious comments
2017-12-11 20:02:43 +01:00
Benno Schulenberg
bcd187d7d6
tweaks: rewrap some lines and some comments, and trim two others
2017-12-10 20:03:51 +01:00
Benno Schulenberg
03783a7d1b
tweaks: trim another placing of a terminating nul byte
...
Make both preceding character moves include the terminating byte.
2017-12-10 19:56:36 +01:00
Benno Schulenberg
f2fb8c01f4
tweaks: remove a superfluous placing of a terminating nul byte
...
The character move has already copied the terminating byte.
And a reallocation to save just one character of memory is
a waste of time.
2017-12-10 19:49:57 +01:00
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