Commit Graph

7039 Commits (95fffa99aa6139d353b2693f0d2fed3ddaab85ed)

Author SHA1 Message Date
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
Benno Schulenberg 5239e7c52b copyright: update some years, and standardize on the dashed format 2017-11-12 10:46:20 +01:00
Benno Schulenberg f6b6e6c3ff tweaks: reshuffle a bit of code and elide an unneeded variable 2017-11-11 21:10:49 +01:00
Benno Schulenberg 0c2b54a276 tweaks: rename a function plus two parameters, to be more fitting 2017-11-11 20:58:56 +01:00
Benno Schulenberg a7f5907b43 tweaks: move a general function to the utils.c file 2017-11-11 11:34:39 +01:00
Benno Schulenberg dfcb1268ca tweaks: adjust a comment, and condense a fragment of code 2017-11-10 20:06:13 +01:00
Benno Schulenberg 2122a1a2b5 tweaks: constify the result strings of getenv(), as a reminder
Also, remove an unneeded pair of braces.
2017-11-10 20:03:07 +01:00
Marco Diego Aurélio Mesquita e2d3bba86c general: do not free strings gotten from getenv(), to avoid a crash
Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2017-11-10 19:55:44 +01:00
Benno Schulenberg 4567360d01 gnulib: update to its current upstream state 2017-11-10 19:40:23 +01:00
Benno Schulenberg 478e34a80c ouch: set the positions-file name also when using the legacy state dir
One should test a change before pushing, also when it worked last time.
2017-11-08 21:15:28 +01:00
Benno Schulenberg ea47879911 tweaks: don't construct the positions-history filename time and again 2017-11-08 20:38:34 +01:00
Brand Huntsman bfc53f308c history: prevent overwriting of positions between multiple instances
Whenever a buffer is closed, check whether the positions file on disk
was modified, and if so, reload it.  Then update the position for the
closed buffer and write out the positions file to disk.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-11-08 20:38:34 +01:00
Lion Yang f0d3685591 input: ensure that standard input uses blocking mode
The function get_key_buffer() assumes waiting_mode = TRUE, but stdin
can be in non-blocking mode when a program (before nano) turned stdin
to non-blocking mode and did not change it back (possibly because it
crashed).  So, explicitly set stdin to blocking mode at startup.

Signed-off-by: Lion Yang <lion@aosc.io>
2017-11-08 20:28:26 +01:00