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.
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.
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.
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.
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>
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.
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.
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.
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.
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>
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>