Commit Graph

6747 Commits (fc36ff7275081ef0fb90e3f3b96dd7a4a23ec793)

Author SHA1 Message Date
Benno Schulenberg fc36ff7275 options: retire 'set backwards' -- it's still recognized but a no-op 2017-10-15 10:45:22 +02:00
Benno Schulenberg 3f735d22a1 bindings: make ^W start always a forward search (as there is ^Q now)
It would be silly for ^W to do a backward search too after using ^Q
once.
2017-10-14 20:34:51 +02:00
Benno Schulenberg ba65cd48cc bindings: make ^Q and ^S do something useful by default
^S will be the first thing people will try for saving a file,
and ^Q is somewhat mnemonic because it is to the left of ^W:
it searches backward.

Make these keystrokes available also in the tiny version.
2017-10-14 20:34:43 +02:00
Benno Schulenberg c7eecd74de new feature: a bindable function that starts always a backward search 2017-10-14 20:30:46 +02:00
Benno Schulenberg a7fa174438 tweaks: adjust indentation and comments after the previous change 2017-10-14 11:58:28 +02:00
Viorel Bota 217cfbf362 files: check for a changed disk file also for 'savefile' and --tempfile
Before writing a file out, nano should check that the file on disk
hasn't been modified since it was read -- not only for the normal
"Write Out" action (^O), but also for "Save File" (future ^S) and
for "Save and Exit" (^X when --tempfile is used).

When writing fails and --tempfile is in effect, don't go on to prompt
for a file name; instead let the user decide what she wants to do.

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

Signed-off-by: Viorel Bota <botaviorel@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-10-13 20:24:10 +02:00
Benno Schulenberg 80ed2568fc tweaks: remove a comment from the docs that is no longer accurate
Date and version are updated to match each release, so the user does
not have to wonder whether the man page really describes the binary.

Also remove a bit of superfluous markup.
2017-10-12 21:17:39 +02:00
Benno Schulenberg 7a3a45e6ac moving: prevent the cursor sticking on or skipping over overwide tabs
When we've landed on a tab and we are moving down and the tab starts
before the current chunk, then push the index forward -- otherwise we
would not advance.  When instead we're moving up and the end of the
preceding row is on the same tab as the target column AND the end of
the current row is not on that same tab, then there is some character
on this row that we can put the cursor on, so push the index forward
-- otherwise we would skip a usable row.

This fixes https://savannah.gnu.org/bugs/?52125
and fixes https://savannah.gnu.org/bugs/?52139.
2017-10-12 20:47:06 +02:00
Benno Schulenberg 4436815725 help: don't fall back to other syntaxes if there is no nanohelp one
Also, an absent nanohelp syntax is not an error, so keep mum.

This fixes https://savannah.gnu.org/bugs/?52147.
2017-10-12 19:15:24 +02:00
Benno Schulenberg d0119833c1 tweaks: reshuffle some regexes, for order and compactness 2017-10-11 21:52:18 +02:00
Brand Huntsman d4074ca85b syntax: nanohelp: colorize Up, Down, Left and Right (when not in UTF-8)
Signed-off-by: Brand Huntsman <alpha@qzx.com>
2017-10-11 21:50:47 +02:00
Benno Schulenberg ca8317e820 tweaks: reduce a bit of code duplication
This also removes a call of ungetch(), as it does not seem to be
needed any more: nano does not lose a character when waking from
suspension.
2017-10-04 21:51:47 +02:00
Benno Schulenberg 1bd17c44b0 display: keep the cursor switched on when resizing the screen
This fixes https://savannah.gnu.org/bugs/?52149.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-10-04 21:38:46 +02:00
Benno Schulenberg 762fb4bec5 display: switch off the cursor early on during startup
So the cursor won't be visible at the end of the status-bar message
while reading in a large file.
2017-10-04 21:34:44 +02:00
Benno Schulenberg a2b4f00a27 tweaks: fix compilation when configured with --disable-histories 2017-10-03 21:39:09 +02:00
Benno Schulenberg 15738c6b39 history: remove the migration service for the old searches file
The code has been there for the last thirty releases -- for six
whole years -- more than enough time to have served its purpose.
2017-10-03 21:18:38 +02:00
David Lawrence Ramsey ede44e16ff build: add history.c to the list of files with translatable strings
The recent migration of the history routines forgot to add the new
file to the list of files from which strings should be extracted.

This fixes https://savannah.gnu.org/bugs/?52122.
2017-09-27 20:42:24 +02:00
Benno Schulenberg c8a2f36e87 input: recognize Option+Arrow keys on iTerm2 in "xterm mode"
Inspired-by: Mike Frysinger <vapier@gentoo.org>

This kind of addresses https://savannah.gnu.org/bugs/?51685.
2017-09-26 21:44:01 +02:00
Benno Schulenberg f2f7498f12 tweaks: rename two variables, for contrast, and frob some comments 2017-09-26 20:54:04 +02:00
Benno Schulenberg 762f997244 tweaks: elide two variables by using a pointer instead of an index 2017-09-26 20:39:58 +02:00
David Lawrence Ramsey 504a97256b softwrap: break before multi-column Unicode blanks when they overshoot
In atblanks mode, if a softwrapped chunk ends with a double-width space
character (say, Unicode 003000, Ideographic Space), and that would put
half of the character past the edge of the screen, break before it.

This fixes https://savannah.gnu.org/bugs/?51671.
2017-09-26 19:56:48 +02:00
David Lawrence Ramsey 3f35e9670f syntax: nanorc: properly color valid arguments of 'selectedcolor'
This fixes https://savannah.gnu.org/bugs/?52114.
2017-09-26 19:35:55 +02:00
Benno Schulenberg b5346bccb3 tweaks: rename a variable, to avoid a possible confusion
Or rather, to make searching for the PRESERVE option easier.
2017-09-24 21:06:08 +02:00
Benno Schulenberg 7c3c3cbb3b tweaks: discard some obsolete debugging stuff 2017-09-22 21:59:51 +02:00
Benno Schulenberg b27ab4f0a1 browser: place the cursor properly on the selected file when -g is used
Simply redraw the browser screen upon every keystroke when --showcursor
is in effect, to be certain that the cursor will be placed again at the
correct spot.

This fixes https://savannah.gnu.org/bugs/?52078
and fixes https://savannah.gnu.org/bugs/?52079.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-09-22 21:52:41 +02:00
Benno Schulenberg c74d2632bb tweaks: make the switching on and off of the cursor a bit more compact 2017-09-22 21:31:01 +02:00
Benno Schulenberg ae34825f58 display: rework the switching on and off of the cursor
The basic idea is that the cursor is always off, except when it needs
to be on: when waiting for text input, and in a few other cases: when
something was searched and found in the help viewer, and in the file
browser when option -g is in effect.

This fixes https://savannah.gnu.org/bugs/?51923.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2017-09-20 21:35:25 +02:00
Benno Schulenberg f6b396f206 tweaks: chuck an assert, and then condense the code and a comment 2017-09-19 21:14:05 +02:00
David Lawrence Ramsey 5561d22f19 search: trim a failed search string for width instead of length
When reducing the search string to at most half the screen width,
it should employ its width in columns, not its length in bytes.

Also adjust the type of a variable.

This fixes http://savannah.gnu.org/bugs/?52057.
2017-09-19 21:08:05 +02:00
Benno Schulenberg aa45994bbb build: let git ignore also the generated PDF file 2017-09-19 20:56:04 +02:00
Benno Schulenberg 2d13afda40 display: stop the help viewer from turning on the multibuffer indicator
This fixes https://savannah.gnu.org/bugs/?52060.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-09-19 20:42:47 +02:00
Benno Schulenberg fd86696658 tweaks: rename one variable once more
So that it is not a substring of some other name.
2017-09-17 21:40:59 +02:00
Benno Schulenberg 09ab91c79c tweaks: strip four unneeded checks
The functions to read and write history files will not even be called
when the home directory is missing, so there is no need to check for
that eventuality again.
2017-09-17 21:34:16 +02:00
Benno Schulenberg 5f4fb8e513 tweaks: frob some comments and rename a few variables and a function 2017-09-17 20:17:13 +02:00
Benno Schulenberg 7a9d010186 tweaks: rename two variables, to be more indicative of what they do 2017-09-17 17:48:03 +02:00
Benno Schulenberg 231fe4bf01 tweaks: rename a function and swap its two parameters 2017-09-17 17:29:43 +02:00
Benno Schulenberg 067a920517 tweaks: improve some comments, and rename a variable for symmetry 2017-09-17 17:16:36 +02:00
Benno Schulenberg 36e88032cb tweaks: rename two variables, to make a little more sense 2017-09-17 16:54:45 +02:00
Benno Schulenberg e0a73f58f3 tweaks: drop a bunch of outdated asserts 2017-09-17 12:48:13 +02:00
Benno Schulenberg 1be8eb3b30 tweaks: elide an unneeded check
When history has changed, not all three listst can be empty.
2017-09-17 12:47:28 +02:00
Benno Schulenberg fb9c180bae history: after loading the lists, mark them as unchanged
Populating the search, replace, and execute lists makes use of the
function update_history() which sets history_changed to TRUE, which
meant that the search_history file would always get written even if
nothing had changed.
2017-09-17 12:47:11 +02:00
Benno Schulenberg c10a1e54dc tweaks: elide an unneeded function now that stuff is grouped together 2017-09-17 12:46:49 +02:00
Benno Schulenberg a1c73317f7 organization: move all history-related stuff to its own file 2017-09-17 12:46:36 +02:00
Marco Diego Aurélio Mesquita a75bf0a1d1 history: remember the list of executed commands across sessions
Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2017-09-17 12:46:09 +02:00
David Lawrence Ramsey 5f70229c7e moving: set the preferred column properly when doing a smart home
This fixes http://savannah.gnu.org/bugs/?52042.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2017-09-15 21:24:48 +02:00
Marco Diego Aurélio Mesquita c8363a0d0b history: remember the commands that were executed during this session
Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2017-09-14 20:10:22 +02:00
Benno Schulenberg 4aec1649f5 docs: remove another remark about indenting lacking undo capability 2017-09-13 19:44:31 +02:00
Benno Schulenberg 153dea1732 tweaks: discard another set of useless asserts 2017-09-13 19:34:45 +02:00
Benno Schulenberg bb8d65e89c tweaks: reshuffle some code, and rename a variable 2017-09-13 19:34:28 +02:00
Benno Schulenberg f9bf320fd5 titlebar: don't show nano's name and version when in the file browser 2017-09-13 19:34:14 +02:00