Commit Graph

6719 Commits

Author SHA1 Message Date
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
Benno Schulenberg 9738c7997b titlebar: drop the prefix "File: " from before the filename 2017-09-13 19:30:07 +02:00
Benno Schulenberg cbf4f77d6b titlebar: don't reshow version when dropping back to a single buffer
When multiple files were open and [x/n] was being shown in the title
bar, don't show nano's name and version number when just one buffer
remains open, but show [1/1] instead.  It is less surprising.
2017-09-13 19:29:56 +02:00
Marco Diego Aurélio Mesquita 3fc89e0853 new feature: show current and total number of open buffers in title bar
When multiple buffers are open, replace nano's name and version number
with an indication how many buffers are open preceded by the sequence
number of the current buffer.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-09-13 19:29:38 +02:00
Benno Schulenberg ac8eb42a4f tweaks: elide a superfluous allocation 2017-09-12 20:46:14 +02:00
David Lawrence Ramsey 6c2c6b58a4 docs: remove man page reference to indent/unindent lacking undo/redo
This is no longer accurate.
2017-09-12 20:08:50 +02:00
David Lawrence Ramsey 19a1129698 text: hook up indenting and unindenting to the undo/redo code
This is modeled after the comment/uncomment code.  Each line's
individual indent is saved in the string array of the undo
group structure.

This fixes http://savannah.gnu.org/bugs/?46860.
2017-09-12 20:08:30 +02:00
David Lawrence Ramsey f722c53223 undo: generalize update_comment_undo() into update_multiline_undo()
The function does not contain any comment-specific code, so it can
be used to handle any kind of multiline undo item.

Also, extend the undo group structure to contain an array of strings,
one for each line in the group.  When indent/unindent is hooked up to
the undo/redo code, this will allow the latter to restore the exact
original indents.
2017-09-12 19:49:44 +02:00
Benno Schulenberg ffc550521c tweaks: chuck a bunch of asserts -- they have lost their usefulness 2017-09-10 14:08:24 +02:00
Benno Schulenberg 8d229cb712 tweaks: rename a variable, to make more sense
Also, remove an unneeded null_at() -- the null byte has been copied,
and reallocating the string would recover very little memory.

Also, call charmove() without using the & operator.
2017-09-10 13:28:13 +02:00
Benno Schulenberg abf7ac48a1 tweaks: rename three variables, for more contrast 2017-09-10 13:04:03 +02:00
David Lawrence Ramsey fc0e16f6bc text: move the unindenting of a single line into its own function 2017-09-10 12:59:04 +02:00
David Lawrence Ramsey 57d7f8852d text: move the indenting of a single line into its own function
This is modeled after the undo/redo code for commenting.  do_indent() now
calls indent_a_line() on each line it covers.  The latter function will
eventually be used by the undo/redo code.
2017-09-10 12:43:10 +02:00
Benno Schulenberg ae25e15d61 startup: don't produce more than three consecutive beeps
This fixes https://savannah.gnu.org/bugs/?51918.
2017-09-02 15:31:02 +02:00
Benno Schulenberg 21ffa883f7 tweaks: use mnemonic constants instead of TRUE and FALSE
And use these constants in another context too.
2017-08-31 22:14:06 +02:00
Benno Schulenberg 98ec41b4fa tweaks: rename three functions, to be shorter or clearer 2017-08-31 22:00:53 +02:00
Benno Schulenberg a4a32b910a tweaks: reshuffle a couple of lines, and trim some comments 2017-08-31 21:55:10 +02:00
Benno Schulenberg 28cfab7580 tweaks: fix compilation when configured with --enable-tiny
When moving the cursor to the top-left corner, it is not necessary
to compute leftedge because firstcolumn IS the relevant leftedge.

Reported-by: Jordi Mallach <jordi@debian.org>
2017-08-29 19:28:44 +02:00
Benno Schulenberg 758b4e66db po: update translations and regenerate POT file and PO files 2017-08-27 10:31:28 +02:00
Benno Schulenberg a09eedf0a3 bump version numbers and add a news item for the 2.8.7 release 2017-08-27 09:37:01 +02:00
Benno Schulenberg 1a7ceb8774 tweaks: oops -- use the correct keyword for recency... "age" 2017-08-26 11:11:40 +02:00
Benno Schulenberg 69fcb001ea tweaks: attempt to order the branches on Savannah's cgit by recency 2017-08-26 11:09:39 +02:00
David Lawrence Ramsey 59451da3ac softwrap: correctly move vertically through overwide tabs
Don't skip rows that contain something when moving up, and do put
the cursor in the desired column whenever possible when moving down.

This fixes http://savannah.gnu.org/bugs/?51827
and fixes http://savannah.gnu.org/bugs/?51828.
2017-08-26 10:14:01 +02:00
David Lawrence Ramsey a850bb2513 moving: redraw not just the new current line but also the prior one
This fixes http://savannah.gnu.org/bugs/?51821.
2017-08-22 19:21:47 +02:00
Benno Schulenberg 047cf9be9c moving: improve retention of the target column somewhat
It's not yet good enough: when proper_x() pushes the index forward,
maybe it should also increase leftedge?  Or go_forward_chunks()?
2017-08-22 16:11:20 +02:00
Benno Schulenberg 97896d30f1 moving: use the correct formula for pushing the index forward
This helps to fix https://savannah.gnu.org/bugs/?51787.
Correction-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-22 16:11:11 +02:00
Benno Schulenberg fc367a32eb moving: don't push x forward when backward movement lands on a split tab
This fixes https://savannah.gnu.org/bugs/?51809.
2017-08-22 16:05:44 +02:00
David Lawrence Ramsey 5e10528759 display: revamp how screen updates are done in the movement code
When the screen is narrower than a tab is wide, the cursor does not need
to be on the first/last line of the window before an <Up>/<Down> could
need to scroll the screen.

This fixes http://savannah.gnu.org/bugs/?51776.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-21 21:25:55 +02:00
Benno Schulenberg 243380c4a2 mouse: one click of the wheel should move three lines, not three pages
This fixes https://savannah.gnu.org/bugs/?51802.
2017-08-20 20:45:56 +02:00