Commit Graph

1070 Commits (e09ed765a1711204f0ac9733d4daf99162bf3d0a)

Author SHA1 Message Date
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 807f5c2e69 tweaks: do not leak the indentation when all lines are empty 2017-08-16 17:16:18 +02:00
Benno Schulenberg 1b2a091de9 tweaks: condense or improve some comments
Also reshuffle an initialization and drop two useless asserts.
2017-08-16 17:10:40 +02:00
Benno Schulenberg bd770ea2e7 text: properly unindent lines that consist of only whitespace
The preceding 'for' loop has already established that all the lines are
either unindentable or composed of only blanks.  So if now a line cannot
be unindented, it means it is fully blank, so it can be simply skipped.

This fixes https://savannah.gnu.org/bugs/?51760.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-16 16:42:44 +02:00
Benno Schulenberg d8e5799e84 tweaks: adjust the indentation after the previous change
Also, trim or improve some comments.
2017-08-15 10:38:58 +02:00
David Lawrence Ramsey 0f4716e168 text: make unindenting remove from the beginning of the line
Also, only unindent when all selected lines can be unindented,
which means that the relative indentation will be preserved.
For this purpose, it ignores empty lines and lines consisting
of only whitespace.

When unindenting is not possible, a message is shown.

This fixes https://savannah.gnu.org/bugs/?47684.
2017-08-15 10:38:58 +02:00
David Lawrence Ramsey 749b1b3d79 text: make indenting add to the beginning of the line
Instead of inserting the extra whitespace after the current indentation
of a line, add it to the start of the line.  This causes a fixed amount
of visual whitespace to be added regardless of whether --tabstospaces
is used or not.

This fixes http://savannah.gnu.org/bugs/?51438,
and its ancestor https://savannah.gnu.org/bugs/?51408.
2017-08-15 10:38:58 +02:00
Benno Schulenberg 11072ed587 tweaks: sort the includes, so it's a little easier to see what is there 2017-08-06 19:40:30 +02:00
Benno Schulenberg 80686bb525 tweaks: remove includes that appear to be superfluous
Without them, nano still compiles for me, with everything enabled,
even when using --enable-debug, --enable-utf8, and --with-slang.
2017-08-06 09:08:30 +02:00
David Lawrence Ramsey ac2c81fad1 tweaks: correct a comment typo and an indentation error 2017-07-31 21:42:39 +02:00
Benno Schulenberg 5dcf375f33 linting: skip the introductory message produced by 'gcc -fshow-column'
Assume that a linter line that contains an actual error message or
warning includes a colon followed by a space -- something that that
opening message from a modern gcc lacks.
2017-07-29 13:15:22 +02:00
Benno Schulenberg 50379cc4ff tweaks: elide an unneeded pointer 2017-07-27 22:05:19 +02:00
David Lawrence Ramsey e2d3ee2364 tweaks: replace a misplaced tab with a space 2017-07-27 21:58:00 +02:00
Benno Schulenberg 79c836b11b tweaks: drop some debugging stuff, and frob two comments 2017-07-27 21:45:53 +02:00
Benno Schulenberg c24432edc4 linting: don't try to put the cursor at a negative x position
Human column numbers are one-based, whereas x positions are zero-based.
Converting from the one to the other involves subtracting one.  But when
the linter message does not provide a column number, the latter defaults
to zero.  Catch that case and change the number to one.

This fixes https://savannah.gnu.org/bugs/?51550.
2017-07-26 21:31:41 +02:00
David Lawrence Ramsey 85bffcfeb9 tweaks: use charalloc() instead of (char *)nmalloc() * sizeof(char)
The charalloc() macro does exactly this.
2017-07-25 21:50:13 +02:00
David Lawrence Ramsey 381a386b01 weeding: drop the forreal parameter from place_the_cursor()
Commit 28beb3f added the 'forreal' parameter to prevent spotlight() from
placing the cursor wrongly due to an invalid placewewant.  However, since
the variable-width softwrap overhaul (specifically, since commit 8490f4a),
place_the_cursor() no longer checks placewewant, so the parameter is no
longer needed.

Furthermore, dropping 'forreal' and thus always setting current_y won't
affect the operation of spotlight(), since the only functions that use
spotlight() (do_replace_loop() and do_int_spell_fix()) both call
edit_refresh() beforehand, which means that current_y will already
have been set to the value it will be set to again.
2017-07-24 21:07:42 +02:00
Benno Schulenberg 14c5f03e38 tweaks: rename another constant, to be more precise 2017-07-14 16:18:41 +02:00
Benno Schulenberg 1e2d9a697a tweaks: rename a constant, to match the corresponding option 2017-07-14 16:14:02 +02:00
Benno Schulenberg 5df47bfef6 display: avoid a jumpy cursor by redrawing bottom bars only when needed
The help lines need to be redrawn one step after a justification
(whether it has been undone or not, to replace "Unjustify" with
"Uncut" again for ^U), and after switching buffers (to update a
possibly changed tag for ^T).

This fixes https://savannah.gnu.org/bugs/?51455.
2017-07-13 11:10:51 +02:00
David Lawrence Ramsey fb51d617fd text: adjust the comments in do_indent() and do_unindent()
Make them reflect the split into two functions, the direct use of
tabsize, and the difference in behavior between indent and unindent.
2017-07-12 17:24:46 +02:00
David Lawrence Ramsey 7e9799d42b text: remove the last usage of cols in do_indent() and do_unindent()
Since all indentation and unindentation is by a tab, or by a tab's
worth of spaces, use tabsize directly.
2017-07-12 17:23:46 +02:00
David Lawrence Ramsey d02c1993d8 text: normalize the indentation in do_indent() and do_unindent()
Also remove one unneeded blank line.
2017-07-12 16:58:23 +02:00
David Lawrence Ramsey 42f5a84c6f text: remove indent-related code from do_unindent() 2017-07-12 16:57:20 +02:00
David Lawrence Ramsey 109ad0915d text: remove unindent-related code from do_indent() 2017-07-12 16:56:36 +02:00
David Lawrence Ramsey ee52f45b01 text: remove unneeded references to cols from the indentation routines
The parameter 'cols', that indicates how many columns to indent or
unindent, is changed to be always positive, so the check for being
negative can go.  And it could never be zero anyway.
2017-07-12 16:51:21 +02:00
David Lawrence Ramsey 2367f3d8e6 text: make do_unindent() an exact copy of do_indent()
This is the first step toward splitting them into two dedicated
functions, instead of letting do_indent() handle both cases.
2017-07-12 16:45:41 +02:00
Benno Schulenberg ecc7c26641 tweaks: rename a variable, to have more contrast 2017-07-09 21:11:01 +02:00
Benno Schulenberg fbbf501f8f tweaks: rename four functions, to be more distinct 2017-07-09 21:07:38 +02:00
David Lawrence Ramsey aa04ad4f83 replacing: make spotlight() account for varying chunk width
spotlight() now displays softwrapped lines chunk by chunk instead of all
at once.  Since softwrapped lines are no longer of constant width, the
latter approach would fail if softwrapping breaks the spotlighted text.

Instead of taking a string, spotlight() now takes the starting and ending
columns of that string.  Also, its handling of softwrapped lines is now
split off into a separate function, spotlight_softwrapped().
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey e375995d98 softwrap: add new functions for chunks of varying width
get_chunk_row() replaces the formula "column / editwincols".

get_chunk_leftedge() replaces "(column / editwincols) * editwincols".

get_last_chunk_row() replaces "strlenpt() / editwincols".

get_last_chunk_leftedge() replaces "(strlenpt() / editwincols) * editwincols".

This prepares us for any changes in those formulas, and for more such
functions later.
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey 5bc4abeefe text: update placewewant properly when indenting/unindenting
If the position of the cursor changes horizontally,
placewewant should change with it.

This fixes https://savannah.gnu.org/bugs/?51407.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-07-07 12:09:14 +02:00
Benno Schulenberg 1439016c20 tweaks: recognize the empty string as comment inhibitor, instead of NULL 2017-07-07 10:15:17 +02:00
David Lawrence Ramsey 7c41c8641f tweaks: remove unneeded braces, and mark empty parameter list as void
This matches the style in the rest of the code.
2017-07-03 09:52:13 +02:00
Benno Schulenberg 14bd52ced8 display: wipe stale messages from the status bar straightaway
When blank_statusbar() has been called, make sure it is effective.

This fixes https://savannah.gnu.org/bugs/?51358.
2017-07-02 19:57:11 +02:00
Benno Schulenberg 7d46eff738 display: when back in the main loop, always redraw the help lines
(Well, redraw them when they're switched on, of course.)  Redraw
them so that they are shown correctly if their content changed.

This fixes https://savannah.gnu.org/bugs/?51356.
and fixes https://savannah.gnu.org/bugs/?51357.
2017-07-02 19:57:11 +02:00
David Lawrence Ramsey 2abe7c03fe text: make sure commenting is disabled when comment "" was specified
When the active syntax contains a comment command that specifies the
empty string, this should override the default comment of "#" and
should disable the Meta-3 keystroke.

To achieve this, the comment string is now set by default to "#" for
all syntaxes, so that it will be set when no comment command is given
(including for the "none" syntax), and is unset only by explicitly
specifying «comment ""» in a syntax file.

This fixes https://savannah.gnu.org/bugs/?51355.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-07-02 19:44:56 +02:00
Benno Schulenberg bf72cdd814 tweaks: rename two variables, to make a little sense
And rename a third variable, to match another in its style.
2017-07-02 12:05:12 +02:00
Benno Schulenberg 4239e5fe1a tweaks: put declarations always first, so it will compile on Haiku 2017-07-02 11:53:59 +02:00
Benno Schulenberg 6ad3d3d6c0 display: show the cursor position also when searching took a while
Achieve this by making the suppression flag global, so that we can
just reset it instead of making an improper call of do_cursorpos().

This fixes the secondary part of https://savannah.gnu.org/bugs/?51134.
2017-05-29 22:15:38 +02:00
Benno Schulenberg 5cdadc3eb1 tweaks: avoid an unused-variable warning when using --disable-comment 2017-05-19 11:55:37 +02:00
Benno Schulenberg 28beb3f9c5 replacing: don't let placewewant influence the placement of the cursor
When spotlighting the string to be replaced, placewewant isn't valid,
so tell place_the_cursor() to ignore its value to avoid the cursor
getting mistakenly placed at the beginning of the next row.

This fixes https://savannah.gnu.org/bugs/?50997.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-05-11 22:28:34 +02:00
Benno Schulenberg 46430999d5 build: make --enable-help properly depend on --enable-multibuffer
And in the process transform the token DISABLE_HELP to ENABLE_HELP.
2017-04-25 18:27:55 +02:00
Benno Schulenberg 040bd93cc4 tweaks: distinguish (in the comments) between buffers and linestructs
Call something a buffer when it refers to a linked list of linestructs,
and call something a linestruct when it is a struct that describes a
single line.
2017-04-19 17:48:52 +02:00
Benno Schulenberg a43eee6aec tweaks: fix compilation with --enable-tiny --enable-color --enable-speller
Also avoid an unused-variable warning, and trim a useless assert.
2017-04-19 14:30:36 +02:00
Benno Schulenberg 74f128859b tweaks: rename a constant, to match the corresponding option 2017-04-17 11:51:48 +02:00
Benno Schulenberg 3dc6ccbe86 tweaks: rename a function, to be more accurate
Because nothing gets reset to zero or to some initial value.
2017-04-17 11:29:29 +02:00
Benno Schulenberg 2439e1e451 linting: treat a tab as one "column", not eight
This fixes https://savannah.gnu.org/bugs/?47131.
2017-04-10 20:32:36 +02:00
Benno Schulenberg dab70d06ed linting: when no is said to a file, remove all corresponding entries
When the user chooses not to open a file that some message refers to,
remove all messages for that file from the linting results, so the user
does not get asked about that same file again.

This fixes https://savannah.gnu.org/bugs/?47130.
2017-04-10 19:55:46 +02:00
Benno Schulenberg 754c62c5cc copyright: update the years, use ranges, and explain this usage
The interval 2013-2017 for the Free Software Foundation is valid
because in those years there were releases with changes by either
Chris or David, and the GNU maintainers guide advises to mention
a new year in all files of a package, not just in the ones that
actually changed, and be done with it for the rest of the year.
2017-04-09 12:09:23 +02:00
Benno Schulenberg 005ee8eda6 editing: avoid creating blank lines when using autoindent
When Enter is pressed while the cursor is exactly on the current
indent width, remove the blank characters on that line to avoid
creating a line that consists only of trailing whitespace.

(When Enter is pressed somewhere in the middle of the blanks,
however, the whitespace is preserved.)

Suggested-by: Florian Zeitz <florob@babelmonkeys.de>
2017-04-06 20:34:04 +02:00
Benno Schulenberg aedc3ddd49 tweaks: replace a function call or a macro with a hard number
Verify at startup that the number is not too small.
2017-04-04 19:17:02 +02:00
Benno Schulenberg 53cea142e0 tweaks: use memory on the stack instead of calling malloc() and free()
Rename some variables in the process, and remove two cluttering asserts.
2017-04-04 19:14:14 +02:00
Benno Schulenberg 582a624998 tweaks: frob some parentheses and other things, to be more consistent 2017-03-29 19:30:37 +02:00
David Lawrence Ramsey c888edf409 softwrap: save and restore firstcolumn when internally spell-fixing text
In do_int_spell_fix(), spell-checking text may change firstcolumn if
the next match is offscreen, and spell-checking text after that will
not change it back.  In order to keep the viewport unchanged, we have
to save and restore not just edittop, but firstcolumn as well.
2017-03-22 10:44:06 +01:00
David Lawrence Ramsey 7cd50b8c02 softwrap: save firstcolumn when justifying, restore it when unjustifying
In do_justify(), justifying text may change firstcolumn if the paragraph
ends offscreen, and unjustifying the text again will not change it back.
In order to keep the viewport unchanged, we have to save and restore not
just edittop, but firstcolumn as well.
2017-03-22 10:44:06 +01:00
David Lawrence Ramsey 80b3a3011b weeding: remove ensure_line_is_visible()
Since all lines can be partially scrolled off the screen now
(except for the top line of the edit window, which is forthcoming),
ensure_line_is_visible() is no longer needed.
2017-03-22 10:44:05 +01:00
Benno Schulenberg d42f71a2ef tweaks: avoid a few needless reallocations
Most of these variables are freed moments later -- reallocating
them is thus a waste of time.
2017-03-20 13:07:57 +01:00
Mike Frysinger 3deec4352b assume regex.h support is always available
Now that we pull in the gnulib regex module, we can assume it exists.
2017-03-06 12:01:08 +01:00
Benno Schulenberg 0af5788a94 tweaks: reduce the scope of five variables, and frob some comments 2017-03-01 09:56:38 +01:00
Benno Schulenberg d5b950cc29 tweaks: don't turn the mark off before it's needed
The mark only needs to be off when calling replace_marked_buffer(),
because this indirectly calls ingraft_buffer(), which fiddles with
the end points if the mark is on.
2017-03-01 09:35:45 +01:00
Benno Schulenberg adf69a05f1 spelling: keep the cursor at end-of-line if it was there
This fixes https://savannah.gnu.org/bugs/?50415.
2017-02-28 20:45:49 +01:00
David Lawrence Ramsey 29681e0e9f weeding: remove partitioning and related stuff from do_justify()
Replace partitioning with calls to extract_buffer() and ingraft_buffer().

In addition to pasting the unjustified text back into the buffer at
current[current_x], ingraft_buffer() also deals with renumbering and
updating totsize, so do_justify() doesn't need to do those anymore
when unjustifying.
2017-02-28 14:35:44 +01:00
David Lawrence Ramsey 234bd9c9be speller: fix replacing marked text in the alternate spell checker
With read_file() revamped, it now uses partition_filestruct() indirectly
via ingraft_buffer(), so we can't use partition_filestruct() to replace
marked text in the alternate spell checker anymore without segfaulting.

Add the new function replace_marked_buffer() to accomplish this instead.
Based on replace_buffer(), it uses extract_buffer() to throw away the
marked un-spell-checked text, and then uses read_file() to insert the
spell-checked text at the position where the mark was.

Accordingly, remove unneeded partitioning and related stuff from
do_alt_speller().  Besides pasting the file into the buffer at
current[current_x], ingraft_buffer() also deals with renumbering,
updating totsize, and handling a magicline, so do_alt_speller()
doesn't need to do those anymore.
2017-02-28 14:35:44 +01:00
David Lawrence Ramsey 0d9313763d undo: fix undoing/redoing insertions, since they no longer do partitioning 2017-02-28 14:35:44 +01:00
Benno Schulenberg e5731fe198 tweaks: reshuffle three statements, and shorten a comment 2017-02-25 12:33:01 +01:00
Benno Schulenberg 2bbb6cfeb5 wrapping: add the correct char length when skipping consecutive blanks
In this last loop of break_line(), the pointer 'line' is one step ahead
of the index 'lastblank'.  So the loop should first add the length of
the preceding character to 'lastblank' before determining the length
of the current character (and using this to advance 'line').
2017-02-25 11:18:24 +01:00
Benno Schulenberg 1623bc7779 tweaks: rename three variables, to better distinguish bytes from columns
(There is something wrong in the last loop: line is one character ahead
of lastblank, but the current character length is added to both of them.
It thus assumes that all blank characters are the same number of bytes.
For spaces and tabs this works fine.  But for more exotic blanks...)
2017-02-24 22:08:55 +01:00
Benno Schulenberg 99ecd33c18 tweaks: elide two variables, and condense some statements
Also, remove an assert and adjust some comments.
2017-02-24 21:11:37 +01:00
David Lawrence Ramsey 6500f769aa tweaks: move comments outside of if blocks in break_line() 2017-02-24 21:04:31 +01:00
David Lawrence Ramsey f95836a951 tweaks: remove cluttering #ifdefs from break_line()
Also, rename a parameter to be less cryptic, and remove an entire
condition because the relevant block will never be reached when
getting called from the help routines: if blank_loc is negative,
the function will have bailed out in the preceding if.
2017-02-24 17:33:39 +01:00
Benno Schulenberg 07ebba5e99 tweaks: rename a variable and invert its logic 2017-02-24 12:21:59 +01:00
Benno Schulenberg de3260cdb1 justify: reduce the character count when trimming trailing spaces
This fixes https://savannah.gnu.org/bugs/?50379.
2017-02-22 17:29:39 +01:00
David Lawrence Ramsey 1cb945fe8e tweaks: rename the functions for moving to and copying from a buffer
The name "filestruct" was a mistake.  What was meant was:
buffer -- a linked list of structs that each describe a line.
2017-02-17 20:06:32 +01:00
Benno Schulenberg d60e7d374c spelling: correctly adjust the length of a single-line region
When the marked region covers only a single line (or a part of it),
its new endpoint is not simply the length of the last line of the
spell-checked text, but instead the old endpoint plus the /change/
in length.

This fixes https://savannah.gnu.org/bugs/?50316.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-02-16 11:52:24 +01:00
Benno Schulenberg 914af36546 spelling: don't unnecessarily fiddle with the viewport
If we're somewhere deep into the file and do a spell check, and the
first misspelled word happens to be right there, onscreen already,
then this word does not need to be centered -- it /should/ not be
centered.  We should scroll only when necessary.
2017-02-10 22:09:03 +01:00
Benno Schulenberg 8f10e364bb replacing: stop searching in a region when edge of buffer is reached
Just like when spell-checking, there is no need to wrap around when
doing replacements in a region, because a region cannot straddle the
buffer's edges.

This is the proper fix for https://savannah.gnu.org/bugs/?50158,
and fixes https://savannah.gnu.org/bugs/?50273.
2017-02-10 13:51:51 +01:00
David Lawrence Ramsey 83ff644b6a tweaks: do a comparison a bit differently in do_output() and do_deletion()
Make it clearer we're comparing the number of rows, not string lengths.
2017-02-05 12:30:09 +01:00
Benno Schulenberg 94e563232e general: stop the spell checker from crashing after the changes in search
The spell fixer does not provide a beginning line, so the search routine
should then not try to refer to any data of this line.  Also, since the
changes to the search routine there is no need any more to retreat one
step before starting to search for a misspelled word.

This fixes https://savannah.gnu.org/bugs/?50159.
2017-01-26 20:21:41 +01:00
Benno Schulenberg ef7a7c5360 replacing: ignore the first match when the user said no
When the user answered No to a replacement prompt, skip the match
at the current position, so we don't stay stuck there.

Also, when replacing in the backward direction, or the match is
of length zero, skip the match at the current position, to not
get stuck.

This fixes https://savannah.gnu.org/bugs/?50126.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>

This also fixes https://savannah.gnu.org/bugs/?50137,
and refixes https://savannah.gnu.org/bugs/?48635,
and fixes https://savannah.gnu.org/bugs/?50144.
2017-01-26 17:41:49 +01:00
Benno Schulenberg c0aa5ad258 tweaks: miscellaneous frobbings 2017-01-09 18:25:25 +01:00
Benno Schulenberg 322120c980 undo: properly create separate items for deletes at different positions
That is: only extend the current Del or Backspace undo item when the
cursor is still (or again) at the same spot.

This fixes https://savannah.gnu.org/bugs/?50006.
2017-01-08 11:05:52 +01:00
Benno Schulenberg fd0589d8bc tweaks: remove the cluttering conditional compilation of a parameter
The conditionalizing saved negligible amounts of space, of memory, and
of speed.
2017-01-03 14:11:45 +01:00
Benno Schulenberg a381021ffc tweaks: when allow_tabs is FALSE, allow_files is irrelevant
In that case setting the latter to TRUE is misleading.  So don't do that.
2017-01-03 14:02:52 +01:00
David Lawrence Ramsey b1c20629f5 weeding: remove unnecessary settings of openfile->current_y
Many of the adjustments of the value of openfile->current_y appear to be
a holdover from the days when certain functions had to account for what
is now called STATIONARY scrolling mode, which depends on the value of
current_y.  Remove these adjustement where they are superfluous.

do_para_begin(), do_para_end(), and do_bracket_match() update the screen
through edit_redraw(), which uses either CENTERING or FLOWING scrolling
mode, so their setting of current_y is redundant and useless, as it will
be ignored and then overridden by the next call to reset_cursor().

findnextstr() is called by go_looking() [which calls edit_redraw(), see
above], and by do_replace_loop() and do_int_spell_fix(), which both call
edit_refresh(), which in this case only uses CENTERING scrolling mode
since focusing is TRUE.

(Additionally, the adjustments of current_y in findnextstr() and
do_bracket_match() use incorrect values when in softwrap mode.)

find_paragraph() doesn't need to save or restore current_y, because it
doesn't do any screen updates.  do_justify() calls edit_refresh() with
focusing set to TRUE, so it uses the CENTERING scrolling mode.

do_alt_speller() and do_formatter() do not need to save and restore
current_y, because they don't modify it in any way.

This addresses https://savannah.gnu.org/patch/?9197.
2017-01-02 12:40:21 +01:00
Benno Schulenberg 7373e4cd46 tweaks: fix compilation when configured with --disable-wrapping 2017-01-01 16:33:40 +01:00
Benno Schulenberg d3429a7a57 copy: properly set preferred x position when region was marked backwards
This fixes https://savannah.gnu.org/bugs/?49964.
2016-12-31 16:36:14 +01:00
Felix Janda fc89ac11d2 speller: fix build when tiny build is enabled
URL: https://bugs.gentoo.org/604000
2016-12-29 13:43:06 -05:00
Benno Schulenberg 588daf949e tweaks: condense the setting of three flags 2016-12-25 13:11:17 +01:00
Benno Schulenberg d21a9c8fc3 text: discard the undo stack after formatting and after spell checking
After a call to the Formatter or the Alternate spell checker, the data
on the undo stack could refer to line positions that don't exist any
more -- the chance is small, but it is there.  So... throw the whole
undo stack away, to prevent undoing things wrongly or even crashing.

(Changes made with the internal spell checker can be undone and redone
without a problem -- nano keeps full track of those.  But the changes
made with a formatter or an external spell checker happen in another
process, so nano has no record of them.)

This fixes https://savannah.gnu.org/bugs/?49920.
2016-12-24 12:22:50 +01:00
Benno Schulenberg edbc1e5950 text: avoid a crash when a spell-checked line has gotten shorter
When using an external spell checker or formatter, the line with
the cursor might become shorter, which might result in the stored
cursor position being beyond the end-of-line.  So, when restoring
the x position, make sure to limit it to the length of the line.

This fixes https://savannah.gnu.org/bugs/?49923.
2016-12-24 12:22:17 +01:00
Benno Schulenberg 6620acbff4 tweaks: use a faster comparison 2016-12-20 10:03:53 +01:00
Benno Schulenberg 1cb6619d6a undo: there are just two forms of deletion: backspacing and deleting
A third method does not exist.
2016-12-19 21:18:43 +01:00
Benno Schulenberg 79a4bf81dc tweaks: rename five variables, for uniformity with a few others 2016-12-19 19:58:15 +01:00
Benno Schulenberg 9fa95a3680 tweaks: put some prototypes in the proper order, and move a bit of code 2016-12-15 13:04:52 +01:00
Benno Schulenberg ea9f62fc0f tweaks: adjust some comments and indentation and ordering 2016-12-13 19:27:33 +01:00
Benno Schulenberg 13ec5d8ce9 spelling: correctly restore the selected region
An added magic linefeed should be removed again /before/ restoring
the x position, as the latter needs to be calculated from the real
last line of the region.

This fixes https://savannah.gnu.org/bugs/?49817.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2016-12-11 09:55:38 +01:00
Benno Schulenberg 173bbe11ef tweaks: add a few translator hints 2016-12-07 21:05:41 +01:00
Benno Schulenberg 7531b71fa1 docs: note Sumedh as the author of the word-completion feature 2016-12-07 21:05:23 +01:00
Benno Schulenberg 964c10db17 tweaks: miscellaneous frobbings and rewrappings 2016-12-07 20:37:08 +01:00
Benno Schulenberg 68a0314500 build: add configure option --disable-wordcomp to disable word completion
(The variable 'pletion_line' is not conditionalized with this option, as
it would become messy.  The compiler will probably be able to elide it.)

When using --enable-tiny, it is not possible to use --enable-wordcomp,
because the word completion function uses the undo system.
2016-12-07 17:02:25 +01:00
Sumedh Pendurkar dca4ab5d8f new feature: complete a fragment to a longer word found in the buffer
Executing the 'complete_a_word' function will search from the start
of the current buffer for entire words that begin with the fragment
that is before the cursor, and will complete this fragment to the
first word that is found.  Each consecutive call of 'complete_a_word'
will search for the next matching word and will complete the fragment
to that.  By default the function is bound to the ^] keystroke.

Signed-off-by: Sumedh Pendurkar <sumedh.pendurkar@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-12-07 16:42:39 +01:00
Benno Schulenberg 86121cf3fc tweaks: move a cursor-on switch to a more logical place (again)
But do it correctly this time: don't switch it on when replacing.
2016-12-05 15:47:44 +01:00
Benno Schulenberg f920e0d30c tweaks: replace some unneeded direct calls of edit_refresh() 2016-12-03 17:00:28 +01:00
Benno Schulenberg 0f3e303d1a tweaks: get rid of some spurious textual references to edit_refresh() 2016-12-02 18:13:10 +01:00
Benno Schulenberg e4b8d6fab5 tweaks: remove a bit of obscuring conditional compilation 2016-11-30 11:46:05 +01:00
Benno Schulenberg 7598b77e75 screen: use the correct width to determine whether a softwrap occurred
This fixes the two bugs reported by Anton Minaev
in https://savannah.gnu.org/bugs/?49511.
2016-11-13 19:20:38 +01:00
Benno Schulenberg 2cd8ca4eb1 tweaks: stop compiling the whole_word_only parameter conditionally
This make tiny nano slightly less tiny, but makes the code more readable.
2016-10-23 20:07:30 +02:00
Benno Schulenberg 01bbf7e82f tweaks: rename a function to better describe what it does
It does not update anything -- it just picks a new point from
where to start displaying the buffer.  All actual updating of
the screen is done by edit_refresh() and edit_redraw() and such.
2016-10-23 17:26:19 +02:00
Benno Schulenberg 43f35fc7a9 softwrap: ensure the current line is fully visible when moving in it
This fixes https://savannah.gnu.org/bugs/?49099,
and fixes the unreported corresponding bugs for
<End> and <Del> and typing extra characters.
2016-10-18 15:07:47 +02:00
Benno Schulenberg 3264d0c5be tweaks: move a variable that doesn't need to be global 2016-10-12 19:59:26 +02:00
Benno Schulenberg d9148e7b3f tweaks: elide an unneeded variable 2016-10-12 19:20:39 +02:00
Benno Schulenberg 08cd197bf1 general: include word-jumping and block-jumping into the tiny version
And also case-sensitive searches, backward searches, and searching again.
2016-09-13 09:27:04 +02:00
Benno Schulenberg 514cd9a099 update the license text to the preferred version
Mentioning "GNU nano" instead of "This program" and referring to the
website instead of to a postal address.
2016-08-29 21:27:16 +02:00
Benno Schulenberg 406e5242a3 update the copyright notices 2016-08-29 21:27:05 +02:00
Benno Schulenberg 382c9d792d new feature: allow text selection by holding Shift with the cursor keys
Add the keycodes and routines to allow the user to forego setting the
mark explicitly (with M-A / ^6) and instead quickly select a few words
or lines by holding down Shift together with the movement keys.

(Some combinations with Shift are swallowed by some terminal emulators.
To work around some of those, the combinations Shift+Alt+Left/Right work
as Shift+Home/End and Shift+Alt+Up/Down work as Shift+PageUp/PageDown.)
2016-08-28 11:29:28 +02:00
Benno Schulenberg d8031af030 screen: retain the placewewant also when using an alternate speller
When using the default speller or the formatter, the placewewant is
remembered.  So it should be remembered too when the user specifies
a different speller.

(This behavior was inadvertently lost last year, in commit 82d737e.)
2016-08-12 20:02:04 +02:00
Benno Schulenberg 14ac47517b spelling: don't abort when a misspelled word isn't found, just note it
This fixes https://savannah.gnu.org/bugs/?48660 doubly, in case there
are other ways in which 'spell' sees words differently from 'nano'.
2016-08-03 12:55:21 +02:00
Benno Schulenberg 91951ab22a input: don't bother putting a keycode into byte range
A keycode is either already in byte range (so there is nothing to do)
or it is not and it shouldn't be (so there is nothing to do either).
2016-07-30 12:19:47 +02:00
Benno Schulenberg 24b10179a1 files: beep whenever writing out a file fails
Just like when reading a file fails.  It needs the user's attention.
2016-06-27 19:17:53 +02:00
Benno Schulenberg 68acc1dfc5 tabs: compute the number of required spaces without iterating 2016-06-24 14:56:41 +02:00
Benno Schulenberg 79e3eaf73c linter: refresh the edit window in order to actually place the cursor
This fixes https://savannah.gnu.org/bugs/?48283.
2016-06-21 16:25:07 +02:00
Benno Schulenberg 9106cc8ecc main: let the main loop restore the main menu, if needed
Don't make it the responsibility of the executed functions to restore
the list of shortcuts of the edit window.  Just detect whether another
menu was displayed, and if so, redisplay the main menu.
2016-06-21 11:03:38 +02:00
Benno Schulenberg 95f417fa9a tweaks: rewrap a bunch of lines and some comments 2016-06-20 13:05:45 +02:00
Benno Schulenberg 158388c5a6 justify: enable cursor display also for the first keystroke afterward
This fixes https://savannah.gnu.org/bugs/?48246.
2016-06-16 20:40:09 +02:00
Benno Schulenberg 883373cd76 undo: start renumbering from the head of the paste, not from its tail
Because when undoing a paste at the end of the buffer, the tail line
probably does not exist any more.

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

(It would have been the proper fix for
https://savannah.gnu.org/bugs/?44488.)
2016-06-14 16:34:29 +02:00
Benno Schulenberg d87c357abe tweaks: remove two redundant assignments
The mark has already been unset by do_cut_text().  And any assignment
to 'mark_begin' is useless when 'mark_set' is FALSE.
2016-06-07 19:53:27 +02:00
Benno Schulenberg ccffc548e1 text: after undoing or redoing something, unset the mark
This fixes https://savannah.gnu.org/bugs/?48108,
and fixes https://savannah.gnu.org/bugs/?48157.
2016-06-07 19:52:23 +02:00
Benno Schulenberg 83b89a49ef text: remove a redundant undo element
Implement its single use case by making better use of another element.
2016-06-07 19:23:51 +02:00
Benno Schulenberg 87a254400e text: remove a pointless setting of an undo element; it is never used 2016-06-07 19:23:51 +02:00
Benno Schulenberg 9192b7fe8c text: add an undo item before starting to comment or uncomment lines
By moving the test for the only situation where do_comment() does nothing
(when only the magic line is selected) further up front, the add_undo()
can be called before the commenting/uncommenting starts and two variables
and an extra function are made unnecessary.
2016-06-07 11:08:06 +02:00
Benno Schulenberg f0c65bc988 tweaks: add come comments and rename a variable 2016-06-06 20:29:53 +02:00
Benno Schulenberg 5f4d759679 tweaks: fix compilation when configured with --enable-tiny
Reported-by: Mike Scalora <mike@scalora.org>
2016-06-06 19:57:51 +02:00
Benno Schulenberg edf230b7df text: store the new file size in the undo item also when joining lines
This fixes https://savannah.gnu.org/bugs/?48099 reported by Mike Scalora.
2016-06-04 11:39:59 +02:00
Mike Scalora 115aeda69b text: keep the file size correct when undoing/redoing a comment/uncomment
Store the file sizes from before and after the commenting/uncommenting
in the undo struct, so they can be restored when undoing or redoing.

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

Signed-off-by: Mike Scalora <mike@scalora.org>
2016-05-31 21:36:22 +02:00
Benno Schulenberg 17cf833b9c tweaks: normalize some whitespace 2016-05-30 09:09:36 +02:00
Mike Scalora 6a2032f5b0 new feature: comment/uncomment current line or selected lines
This allows for commenting or uncommenting a line or a bunch of lines
with a single keystroke (default binding: M-3).  The characters used
for commenting/uncommenting are specified by the active syntax file.

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Mike Scalora <mike@scalora.org>
2016-05-25 22:29:50 +02:00
Benno Schulenberg f7c3e1cac2 spelling: gettextize the next-word message 2016-05-18 10:25:16 +02:00
Benno Schulenberg cdcd365d34 tweaks: normalize some whitespace 2016-05-17 11:33:21 +02:00
Benno Schulenberg 2535f51e01 statusbar: prevent error messages from overwriting each other
If during startup there are multiple error messages, currently only the
last one remains and can be read.  To improve on that, introduce a short
pause between error messages -- even if it's not enough to read them all,
at least the user will be aware that there are multiple ones.

This also causes a few error messages to beep that currently don't beep,
such as when a file is unwritable.
2016-05-16 18:03:07 +02:00
Benno Schulenberg 0cc3da5d5e spelling: retreat one x position, to not miss the first word
This fixes https://savannah.gnu.org/bugs/?47932.
2016-05-16 12:31:34 +02:00
Benno Schulenberg 06b449b22c utils: provide a failure message for all uses of 'fsfromline' 2016-05-12 12:07:19 +02:00
Benno Schulenberg 21edf7bb90 tweaks: do an assignment in a more transparent way 2016-05-12 12:00:56 +02:00
Benno Schulenberg be4a3f8273 spelling: separate the fixing of different words with a short pause
When fixing a misspelling and not answering 'All' (but 'Yes' or 'No'),
the chance is quite substantial that one will type y or n at the end of
the next word.  Diminish this chance by showing for a moment a message
on the statusbar.
2016-05-04 19:45:09 +02:00
Benno Schulenberg 433c7e5dc6 spelling: don't partition the file for replacements in a marked region
Partitioning the file makes the undo system lose track, so that undoing
things has a good chance of losing data.  Instead, just make sure that
the region is marked "backwards", with current at the top and the mark
at the bottom, and then let the replace loop take care of not going
outside of the marked region.

This also has the effect that if the marked region fits entirely on the
screen, or all the misspellings are onscreen, then the screen will not
be scrolled at all.  Which makes for a smooth experience.

This fixes https://savannah.gnu.org/bugs/?47836,
and fixes https://savannah.gnu.org/bugs/?45573.
2016-05-04 19:45:09 +02:00
Benno Schulenberg 318ed6b105 scrolling: center the cursor when inserted stuff does not fit on screen
Since nano-2.4.1, reading in or pasting a large piece of text would put
the cursor on the bottom line, leaving only one line of the non-read or
non-pasted text visible.  This is different from the centering behavior
of Pico, and somewhat disorienting, as you can't see "where you are" any
more in relation to the file as it was.

So now center the cursor whenever the read or pasted text is larger than
the screen, but don't center it when the text fits entirely on the screen.
(The latter avoids the effect of the screen jumping unnecessarily when
inserting just a few lines while the cursor is near the bottom.)

To achieve this behavior: default to focusing, and temporarily set it to
FALSE when the focusing effect is unwanted.

This fixes https://savannah.gnu.org/bugs/?47841.
2016-05-04 10:13:36 +02:00
Benno Schulenberg 937c47898a spelling: pass the correct position of the cursor
When starting to replace misspelled words, pass the actual position
of the cursor instead of the position of the first found occurrence,
so that the cursor position will be updated for changed lengths.

This fixes https://savannah.gnu.org/bugs/?47834.
2016-05-03 13:07:40 +02:00
Benno Schulenberg 05238f31f4 search: elide an unneeded function
When we're spell checking, we don't need a special mechanism to detect
we have come full circle: reaching the end-of-buffer means we're done.
So don't bother to reset came_full_circle when we're spell checking
(when begin == NULL) but simply ignore its value.
2016-05-02 21:07:27 +02:00
Benno Schulenberg ae8df00b92 search: rename a variable and a function, for clarity and contrast 2016-05-01 12:59:32 +02:00
Benno Schulenberg 53f4a9f5a8 screen: rename 'edit_refresh_needed' to 'refresh_needed'
For a little contrast with the function edit_refresh() -- it's
annoying that when you search for the latter you get to see all
the settings of the flag too.
2016-04-25 21:14:18 +02:00
Benno Schulenberg aa1ae0a144 screen: concentrate the setting of placewewant
Instead of saving the current value of placewewant, then setting the
new value, and then passing the old value to edit_redraw() in seven
different places, just let edit_redraw() do this saving and setting.

In the bargain placewewant is now only recalculated when it matters
-- when allow_update is TRUE -- and not when it's superfluous.
2016-04-11 20:38:05 +02:00
Benno Schulenberg ea4e9b3156 search: don't set placewewant when we are just iterating
In the innermost search loop, don't set placewewant, because this loop
is also used for replacing and spell fixing, when we don't really want
to be there: we are just passing through.  Not setting placewewant means
we don't need to save and restore it in those passing-through routines.

The value of placewewant is only relevant when doing cursor movement,
which doesn't happen during replacing nor spell checking, so there is
no need to keep placewewant up to date -- it is set when it matters:
at the end of go_looking().
2016-04-10 11:11:24 +02:00
Benno Schulenberg cb17732ac2 scrolling: don't scroll too much when having to bridge blank lines
Add a third mode of scrolling, FLOWING, besides CENTERING and STATIONARY.
This is used for word and paragraph jumping (and for bracket matching,
but that worked correctly already), and only when focusing is FALSE.

The new mode prevents the screen from scrolling too many lines when
there are several blank lines at the bottom of the edit window and
the next word or paragraph is out of view.

This fixes https://savannah.gnu.org/bugs/?47194.
2016-04-07 14:28:25 +02:00
Benno Schulenberg d92eb4fee3 all: eradicate SVN's $Id$ tags 2016-04-05 14:59:12 +02:00
Benno Schulenberg 5d1752c5e3 speller: simplify the calculation of the width of the misspelled word
When finding a misspelled word, the length of the match is simply the
length of that word, and its span in columns is simply the number of
columns that it occupies.  Compute it thus directly.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-04-04 17:53:26 +02:00
Benno Schulenberg 523bc0fd4f speller: don't proceed when the user aborts the searching
When searching for a misspelled word takes a while, and the user
stops this search with ^C, then abort the spelling-checking session.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-04-04 17:43:31 +02:00
Benno Schulenberg 06ea93be3e Renaming a variable, and adjusting whitespace after the previous change.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5782 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-31 11:27:16 +00:00
Benno Schulenberg 5022e47940 Replacing a fake 'while', and deleting a redundant 'if' -- we searched
for whole words only, so it will be a whole word.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5781 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-31 11:14:25 +00:00
Benno Schulenberg c709c104a1 Unwrapping a couple of lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5780 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-30 12:30:14 +00:00
Benno Schulenberg c98afde096 Renaming 'do_replace_highlight()' to 'spotlight()', for clarity,
for aptness, for contrast.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-30 12:09:39 +00:00
Benno Schulenberg 400e7ce13f Reporting "Cancelled" instead of "Not found" when the user aborts a replace
that is taking too long.  This fixes Savannah bug #47439.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-30 12:00:48 +00:00
Benno Schulenberg b834ed3b28 Chopping a parameter that is now unused, or rather: always NULL.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5775 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-29 15:05:47 +00:00
Benno Schulenberg 23b8dfd98e Allowing the user to stop replacing a word without aborting also the
whole spell-fixing session.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5774 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-29 14:56:32 +00:00
Benno Schulenberg f45a2938e3 Placing the cursor in the edit window again also after a Justify, after an
invalid escape sequence, and when entering a verbatim keystroke.
But leaving the cursor off during Unicode input, for extra feedback.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5771 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-29 14:09:17 +00:00
Benno Schulenberg 51743233ed Removing the 'last_replace' variable that is never used.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-28 19:14:33 +00:00
Benno Schulenberg e2b6572e9a Not putting cut words into the cutbuffer -- which means: treating the
deletion of words like the pressing of Backspace/Delete, so they don't
overwrite the lines you cut elsewhere and want to paste into the place
of the cut words.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5751 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-20 11:10:31 +00:00
Chris Allegretta 9f98333dce Call kill_spaces_on_justify justifytrim, to match the rest of rcfile naming conventions.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5679 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 21:04:45 +00:00
Chris Allegretta 16c037fdb0 Tweak KILL_TRAILING_SPACES. Still deciding on name...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5675 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-24 04:46:44 +00:00
Benno Schulenberg a9a32d6d89 Centering the cursor when the thing being undone or redone is currently
off the screen.

See https://lists.gnu.org/archive/html/nano-devel/2016-02/msg00104.html.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 12:18:10 +00:00
Benno Schulenberg 6a002f5196 Using the correct column number also when messages are skipped.
And not minding when the column number is zero or negative.
This partially fixes Savannah bug #47131.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5669 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 19:49:45 +00:00
Benno Schulenberg 7dd1030b15 Showing the cursor in the edit window when linting.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5668 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 18:34:04 +00:00
Benno Schulenberg e085ebb872 Making the cursor visible again after a justification and after an
unrecognized escape sequence.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5667 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 17:15:28 +00:00
Chris Allegretta 6a0ae5aaa2 2016-02-22 Chris Allegretta <chrisa@asty.org>
* Add ability to kill the trailing spaces when justifying
        code.  New nanorc option kill_spaces_on_wrap, we'll see
        whether this warrants a command line flahg or not.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5664 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 15:10:32 +00:00
Benno Schulenberg 9703934479 Allowing the parameter of free_filestruct() to be NULL,
so we can delete four annoying pre-checks.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5651 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-18 19:58:18 +00:00
Benno Schulenberg 56cfab3df6 Fixing Savannah bug #47127 the proper way,
eliding two silly calls of edit_redraw().


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5650 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-18 16:31:02 +00:00
Benno Schulenberg 15947ac871 Restoring the mentioned behavior also for the internal spell fixer.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5642 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 10:29:48 +00:00
Benno Schulenberg 568d2a389c Switching the cursor on and off at the appropriate moments (that is: when
needed), so that it no longer shows in the help screen nor in the file list.
This fixes Savannah bug #47126.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-13 19:41:12 +00:00
Benno Schulenberg de5b2634c8 Condensing some declarations, rewrapping some lines, and improving a
few comments.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5633 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 17:25:37 +00:00
Benno Schulenberg e39938c1fa Not leaving curses mode in the formatter, as that would hide
error messages upon reentry.  And, if there are any messages,
allowing the user a little time to read them.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5632 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 16:57:52 +00:00
Benno Schulenberg d4118efea5 Going to the next item in the list before freeing the current one.
This fixes Savannah bug #46796.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5631 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 08:50:11 +00:00
Benno Schulenberg ef2cfa31a7 Preventing a chain of editing actions from continuing after a discard.
This fixes Savannah bug #47104.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5623 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 08:49:23 +00:00
Benno Schulenberg 97dcd377e7 Turning the cursor off when writing in the status bar,
and ensuring it is on when waiting for input.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5610 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 11:18:27 +00:00
Benno Schulenberg cc2d37053c Updating the screen immediately when a message is posted on the status bar.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5609 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 11:05:58 +00:00
Benno Schulenberg cca22bb10a Guiding the translators a little bit.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5607 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-05 12:27:54 +00:00
Benno Schulenberg f845938e86 Freeing the items on the undo stack when a buffer is closed.
This fixes Savannah bug #46904 reported by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5567 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-15 16:44:50 +00:00
Benno Schulenberg 9d72efa474 Gettextizing a forgotten string.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 11:10:07 +00:00
Benno Schulenberg 9e6b9a29a5 Improving the name of allow_pending_sigwinch() to allow_sigwinch(),
and improving its comments too.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 10:37:11 +00:00
Benno Schulenberg 0dd351a5c1 Condensing the exit code of do_linter().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5531 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 10:05:52 +00:00
Benno Schulenberg 5765e9675f Letting reset_multis() figure out whether after a deletion a full refresh is
needed, before doing a redraw of the current line.
This fixes Savannah bug #46794


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5523 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-03 15:35:52 +00:00
Benno Schulenberg 97e9476df5 Skipping the unneeded reinitialization of the windows;
it will be done when polling the keybuffer.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5521 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-02 16:25:50 +00:00
Benno Schulenberg 9eca195990 Plugging three tiny memory leaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5520 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-02 16:01:04 +00:00
Benno Schulenberg 46db638435 Chopping a duplicate parameter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-31 19:20:40 +00:00
Benno Schulenberg 1592ca0585 Chopping an always FALSE parameter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-31 17:20:46 +00:00
Benno Schulenberg 33bc96ab5c Restoring the cursor position differently, using a more basic routine.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5516 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-31 16:44:32 +00:00
Benno Schulenberg 9a6f62ff67 Rewrapping and reordering a few lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5493 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-08 19:09:14 +00:00
Benno Schulenberg a64bfbee8b Letting also unlink_node() update 'filebot', instead of doing it in
four different places.  It is not a problem that the history routines
also use these functions, as history nodes will never equal filebot.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5491 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-08 16:02:05 +00:00
Benno Schulenberg 77c0357868 Making splice_node() update 'filebot', instead of doing it in
four different places.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5490 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-08 15:29:56 +00:00
Benno Schulenberg 40e1fd37d7 Fixing compilation with --enable-tiny --enable-justify.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-05 10:16:26 +00:00
Benno Schulenberg f2da466388 Rewrapping some lines and tweaking some comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5478 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-04 21:11:10 +00:00
Benno Schulenberg 4bc8ff1e6d Discarding the entire undo stack, to prevent nano from making mistakes
when trying to undo edits after an indentation change.
This works around Savannah bug #46591.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5474 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-03 09:17:06 +00:00
Benno Schulenberg 8651fefc68 Discarding the entire undo stack, to prevent nano from dying (or
making mistakes) when trying to undo edits after a justification.
This works around Savannah bug #45531.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5473 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-03 09:03:45 +00:00
Benno Schulenberg ee5cdcbce5 Moving the trimming of the undo stack into a separate function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5472 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-03 08:50:34 +00:00
Benno Schulenberg 6fa1e98c8d Ehm... that was a silly, superfluous condition.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5469 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-02 19:11:03 +00:00
Benno Schulenberg 1fbcf0b23d Accepting not just 'Uncut' but also 'Undo' for undoing a justification.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5468 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-02 19:03:34 +00:00
Benno Schulenberg ae22fe03eb Deleting two redundant assignments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5460 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-01 11:51:10 +00:00
Benno Schulenberg 66e21416af Storing and retrieving the correct file size before and after an action.
This fixes Savannah bug #45523.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5456 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-30 16:21:51 +00:00
Benno Schulenberg 6b1566023a Redoing cuts at EOF properly.
This fixes Savannah bug #46541.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5455 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-30 15:49:37 +00:00
Benno Schulenberg 4a59b12ed4 Warning about an impossible condition, instead of blithely continuing.
And eliding an unneeded variable.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5445 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-26 09:31:33 +00:00
Benno Schulenberg 793d8490de Also the /redoing/ of a Backspace at EOF is a special case.
This fixes Savannah bug #46532.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5444 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-26 08:45:22 +00:00
Benno Schulenberg 530c7862c9 Handling more internal errors, and doing it correctly: showing it
directly on the statusbar instead of as an undid or redid message.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5442 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-25 10:11:54 +00:00
Benno Schulenberg b255b01b50 Eliding an unneeded variable, and not skipping the end of the function
when things went wrong.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5441 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-25 09:49:27 +00:00
Benno Schulenberg 1b69dd629a Warning about a condition that should never occur,
instead of silently continuing.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5440 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-25 09:27:25 +00:00
Benno Schulenberg fbe4376822 Inserting a new node into a linked list by using just two parameters:
the insertion point and the new node.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5437 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-24 13:24:01 +00:00
Benno Schulenberg 72caa54020 Deleting a node right after unlinking it.
This now mirrors unlink_opennode() and delete_opennode().


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5433 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-22 16:14:42 +00:00
Benno Schulenberg 81f3177a33 Eliding an unneeded variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5432 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-22 16:09:15 +00:00
Benno Schulenberg 6007d6227b Rewrapping, rewriting, renaming, and reordering some things.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5431 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-22 16:08:28 +00:00
Benno Schulenberg d6bd276c8c Deleting a condition that will never occur.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5430 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-22 16:07:23 +00:00
Benno Schulenberg f9274a5a29 Deleting an unneeded variable alias.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5405 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-12 19:50:33 +00:00
Benno Schulenberg ec26fd5e7c Storing the correct end position of an inserted file,
and using it for an undo and redo.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5404 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-12 19:01:57 +00:00
Benno Schulenberg bde996db67 Discarding a now useless function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5403 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 19:56:35 +00:00
Benno Schulenberg 7be493047c Oops! Blackout!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5402 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 19:15:36 +00:00
Benno Schulenberg 54c2f6b5ae Chopping the now unused parameter 'undoing'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5401 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 19:04:31 +00:00
Benno Schulenberg f1d9fcc77b Redoing an Enter from stored undo data, instead of running do_enter() again,
because the latter behaves differently depending on the setting of autoindent.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5400 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 18:51:39 +00:00
Benno Schulenberg b66e4bfa5b Deleting a redundant assignment.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5394 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-06 21:02:50 +00:00
Benno Schulenberg 452066bc88 Chopping the 'undoing' parameter, so that the calls of do_cut_text() become
more symmetrical: wrapped in add_undo() + update_undo() where needed.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5390 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-02 13:46:40 +00:00
Benno Schulenberg d0e8887e3b Eliding two variables.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5389 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-02 11:24:22 +00:00
Benno Schulenberg 499c2af385 Removing an 'if' that will never be true, and removing some
assignments that have already been done.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5381 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-29 17:27:33 +00:00
Benno Schulenberg bf64514283 Checking for "nothing to redo" earlier, in order to restore the
possible warning about an internal error.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5380 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-29 17:02:13 +00:00
Benno Schulenberg b0a2f9853b Skipping the addition of an undo only when the current action equals the
last action.  Necessary for when typing text is broken by an undo+redo.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-29 16:52:42 +00:00
Benno Schulenberg d0b72552bf Oops! You can't swap those two conditions.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5377 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-29 09:04:30 +00:00
Benno Schulenberg 26eed9d406 Removing a condition that can never occur.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5376 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-28 20:49:16 +00:00
Benno Schulenberg 3059e16c25 Spoofing a line number for the redoing of an INSERT, because
'u->mark_begin_lineno' is being used as the length of the insertion.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5375 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-10-28 20:24:15 +00:00
Benno Schulenberg b3e4051ded Adding two new bindable functions which delete all characters
from the cursor to the preceding or succeeding word start.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5334 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-31 11:52:26 +00:00
Benno Schulenberg 6847616aee Differentiating between something being disabled/restricted and
help texts being unavailable.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5331 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-30 18:10:16 +00:00
Benno Schulenberg e4294a211e It is better to say that this function is disabled
than that no linter has been defined.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5326 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-29 17:36:39 +00:00
Benno Schulenberg 0b15c42a5c Dropping two superfluous checks for restricted mode, and
two superfluous checks for the definition of a formatter.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5325 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-28 20:04:18 +00:00
Benno Schulenberg bff6a905af Reenabling SIGWINCH-es also when invocation of the formatter fails,
and correcting some comments.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5324 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-28 19:39:34 +00:00
Benno Schulenberg 74e7521478 Adjusting some comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5308 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-18 10:32:01 +00:00
Benno Schulenberg 6039cd7f6e Avoiding an unfounded warning about a possibly uninitialized variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5306 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-17 21:11:32 +00:00
Benno Schulenberg 42f307ef75 (Putting in the original patch, from before I got overzealous.)
Removing an unneeded condition -- 'added_magicline' can only be
true when NO_NEWLINES isn't.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5297 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-13 17:57:58 +00:00
Benno Schulenberg 674ab835e8 Arh! I tested that without actually making any spell correction.
That wasn't very clever.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-13 05:32:17 +00:00
Benno Schulenberg aee86996de Renaming the variable 'totsize_save' to 'size_of_surrounding',
to better describe what it contains.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5294 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-12 19:27:26 +00:00
Benno Schulenberg 3d01486409 Removing the variable 'added_magicline', as it will always be FALSE
and thus will never cause anything to be done.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5293 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-12 19:20:46 +00:00
Benno Schulenberg 08d9f572a4 Unwrapping some lines and rewrapping some others in a more congenial manner;
tweaking some comments and whitespace and braces.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5290 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-10 17:25:51 +00:00
Benno Schulenberg 6095ff3d39 Adjusting whitespace and bracings after the previous changes.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5286 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-06 19:17:27 +00:00
Benno Schulenberg fc7825d00d Not removing and then re-adding the magic line when a Backspace happens
at the end-of-file; just adding a token undo item to be able to put the
cursor back at the very tail of the file.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-06 19:08:13 +00:00
Benno Schulenberg 8f5fa24e51 Moving the check for a Delete at the end-of-file to a less frequently
travelled code path.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5284 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-06 18:48:15 +00:00
Benno Schulenberg 619666460e Making it more transparent what WAS_FINAL_BACKSPACE does.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5283 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-07-06 18:03:14 +00:00
Benno Schulenberg 953ccc990f Unwrapping some lines, rewrapping some others more logically,
plus several other esthetic tweaks.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5275 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-28 14:12:25 +00:00
Benno Schulenberg 296ff1ed2a Not checking again for a condition that was checked before.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5274 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-28 14:04:03 +00:00
Benno Schulenberg f0bb50306c Renaming three flags for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5268 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-27 09:27:19 +00:00
Benno Schulenberg 412b9fc0a2 Skipping the undo of a backspace *only* when it really
tried to delete the final, magic newline.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5267 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-27 09:17:36 +00:00
Benno Schulenberg 57f52a8a20 Reverting the last commit, as it is making things worse:
backspacing at the tail of the file no longer has any efffect.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5263 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-20 09:42:26 +00:00
Benno Schulenberg e219bb9dba Not deleting the magic line, instead of removing and then re-adding it.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5262 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-20 09:00:22 +00:00
Benno Schulenberg 3021a04c1c Improving the visibility of the undo-related debugging messages.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5255 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 15:17:09 +00:00
Benno Schulenberg 86cbd959f6 Renaming the parameter 'current_action' to 'action',
in order to match the other functions.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 11:18:20 +00:00
Benno Schulenberg ef2593695d Oops! Misplaced a closing parenthesis.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5253 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 11:12:42 +00:00
Benno Schulenberg 6404101407 Eliding an unneeded variable and correcting two comments.
And putting the more frequent condition first.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5252 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 10:59:16 +00:00
Benno Schulenberg 67667af233 Adjusting whitespace after the previous change.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5251 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 10:47:00 +00:00
Benno Schulenberg 82373d85f9 Preventing the addition of an extra newline when undoing a Backspace or Delete
at the tail of the file while nonewlines is not set.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5250 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-17 10:41:57 +00:00
Benno Schulenberg c32a58a826 Not checking for non-NULL before freeing a variable, as it's unnecessary.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-14 19:14:41 +00:00
Benno Schulenberg 75d64e677e Handling a SIGWINCH (which signals a change in window size) not when it
happens but only when checking for keyboard input.  It now reports the
SIGWINCH via a special key value to the calling routine, to allow not
only the main editor but also the help viewer and the file browser to
adapt their display to the new size.
Patch by Mahyar Abbaspour, somewhat edited by Benno.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-28 13:02:29 +00:00
Benno Schulenberg b454d9c89b Deleting an always-FALSE parameter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-25 15:17:22 +00:00
Benno Schulenberg ca1983adb4 Eliding another tiny function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5213 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-21 18:47:58 +00:00
Benno Schulenberg 583a30e971 Saving and restoring the global flags the short and quick way.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-21 17:37:59 +00:00
Benno Schulenberg f225991b05 Distinguishing a failure to launch the linter from receiving 0 parsable lines.
Adding a new function to glue together the invocation-error string.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5199 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-17 09:24:17 +00:00
Benno Schulenberg ce48ca2223 Correcting and adjusting some comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-08 19:57:31 +00:00
Benno Schulenberg d8b6dbfffe Letting bottombars() set the global variable 'currmenu'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-07 14:16:07 +00:00
Benno Schulenberg 6f2da6b9b2 Adjusting the end point of the marked region to compensate
for any change in length of the region's last line.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5169 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 20:16:36 +00:00
Benno Schulenberg 14a9c8aa0b Treating the formatter like a speller,
to fix compilation with --disable-speller.
This fixes Savannah bug #44607.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 16:55:49 +00:00
Benno Schulenberg 0b6d6f45d2 Normalizing some whitespace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-27 13:46:50 +00:00
Benno Schulenberg ff4a457d82 Removing unneeded statement -- nothing has changed the value of 'currmenu'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5161 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-25 16:23:45 +00:00
Benno Schulenberg a37ebcf2f8 Not unsetting the mark before the possible bailout for zero size.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-23 17:12:49 +00:00
Benno Schulenberg 92142bed34 Avoiding a spell-check error when the marked region is zero bytes long.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-23 17:01:25 +00:00
Chris Allegretta a0a0556993 2015-02-25 Chris Allegretta <chrisa@asty.org>
* src/text.c (do_alt_speller): timestamp can just be a __time_t.
        Fixes compilation on win32.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-23 04:32:45 +00:00
Benno Schulenberg a4f28694c8 Removing some leftovers after Mark's patch.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5145 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-21 21:13:03 +00:00
Benno Schulenberg 82d737ee6d Restoring the positions of the mark and the cursor in a better way.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-21 21:02:13 +00:00
Benno Schulenberg 532d55c8bd Making a message equal to another one.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5142 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-20 11:37:53 +00:00
Benno Schulenberg 52d1c20973 Not setting the modified flag when an external spell checker
didn't make any changes.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-17 20:10:59 +00:00
Benno Schulenberg 69d26c35fb Fixing a mistaken message plus a few comments too.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-03-14 20:17:21 +00:00
Chris Allegretta 4b3f2771b5 2015-01-03 Chris Allegretta <chrisa@asty.org>
* New formatter code to support syntaxes like
        go which have tools to automatically lint and reformat the text for
        you (gofmt), which is lovely.  rcfile option formatter, function
        text.c:do_formatter() and some other calls.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5100 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-01-03 07:24:17 +00:00
Benno Schulenberg 97a5d1270a Replacing the old get_shortcut() wrapper with the new func_from_key().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5094 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-08-29 20:03:58 +00:00
Benno Schulenberg 47dffa483f Using still more the func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5083 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 20:16:28 +00:00
Benno Schulenberg a9fdfd0799 Normalizing some tabbing.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5068 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 08:53:16 +00:00
Benno Schulenberg 2394e52ebc Making sure line renumbering starts far enough back after
undoing a cut or paste.  And fixing two memory leaks.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5067 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-16 08:46:42 +00:00
Benno Schulenberg 5dde918e24 Not speaking of "line wrap" but of "text add" when undoing/redoing
text additions that caused automatic line breaks.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5064 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-11 19:14:25 +00:00
Benno Schulenberg 637b76b582 Freeing the cutbuffer after use.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5055 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-02 20:52:27 +00:00
Benno Schulenberg 92213f9de8 Handling the cases of cutting-from-cursor-to-end-of-line
(that is, when CUT_TO_END is set) properly.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5054 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-02 20:29:57 +00:00
Benno Schulenberg 49816fed70 Now that 'currmenu' is really global, stop passing it around.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5043 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 10:41:10 +00:00
Benno Schulenberg 7e5324d164 Making 'meta_key' and 'func_key' into global variables, instead of
having them declared everywhere and passing them around endlessly.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5039 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-30 18:04:33 +00:00
Benno Schulenberg 484a0be6e6 Updating the pointer to the bottom of the file
when undoing line deletions at file's end.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5033 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-29 08:49:06 +00:00
Benno Schulenberg 4cf39e4191 Renaming 'undidmsg' to 'redidmsg', to be apt.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-22 21:26:56 +00:00
Benno Schulenberg 016669128b Fixing three leaks of the cutbuffer, shortening and regrouping some stuff,
and removing an unneeded iteration of cutbottom.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5008 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-22 11:03:49 +00:00
Benno Schulenberg 07f40612e1 When redoing a line join at the tail of the file,
make sure openfile->filebot is updated.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5007 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-22 10:14:48 +00:00
Benno Schulenberg fb6c0cd20c When undoing a line break at the tail of the file,
make sure openfile->filebot is updated.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5006 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-21 19:40:30 +00:00
Benno Schulenberg 76e150b47f When undoing a cut-till-end-of-file, put the cursor back
where the cut started, and not at the bottom of the file.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5005 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-21 19:32:17 +00:00
Benno Schulenberg 3b47ff756e Fixing compilation with --enable-tiny --enable-wrapping.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4999 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-20 16:13:54 +00:00
Benno Schulenberg b341f29cbd Transform many DISABLE_NANORC #ifdefs to the new DISABLE_HISTORIES.
This completes the fix for Savannah bug #42539.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4989 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-19 20:05:24 +00:00
Benno Schulenberg a81e141326 Removing a condition and a break that cancel each other.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4984 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 21:23:50 +00:00
Benno Schulenberg 45fe2adf72 Renaming the undo type UNSPLIT to JOIN, for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4982 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 20:11:52 +00:00
Benno Schulenberg b39db7bc63 And eliding a totally unused 'strdata2'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4981 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 20:01:30 +00:00
Benno Schulenberg 3cf338aca8 Eliding the in fact unneeded 'to_eof'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4980 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 19:59:12 +00:00
Benno Schulenberg c55c0db2bb Renaming 'to_end' to 'to_eof', to lessen confusion with CUT_TO_END.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 19:46:35 +00:00
Benno Schulenberg a872709ab4 Making sure the cutbuffer is cleared at the appropriate moments.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4978 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-18 19:04:35 +00:00
Benno Schulenberg e96022b923 After an undo or redo, update the 'placewewant'.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4976 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-17 15:50:34 +00:00
Benno Schulenberg 38cb8fc328 Removing an obsolete boolean variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4975 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-17 15:37:34 +00:00
Benno Schulenberg 948b8e9bcf Putting the cursor back in front of a backwards cut,
where it was when the cut was made.
Patch by Mark Majeres, edited by Benno Schulenberg.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4966 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-14 14:08:28 +00:00
Benno Schulenberg 736fbf2e3f Removing the --undo option, having the undo functions always enabled.
If wished, the user can unbind them.  This fixes Savannah bug #42456.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-13 15:20:26 +00:00
Benno Schulenberg 1102aaa374 Making tiny nano a bit tinier by preening out some soft-wrap stuff.
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 20:26:54 +00:00
Benno Schulenberg acda255b47 A bunch of type fixes, mostly in debugging messages --
line numbers are long, x positions unsigned long.
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4950 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 15:08:59 +00:00
Benno Schulenberg c35eb5a16e Avoiding a compiler warning with --disable-wrapping.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4947 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 10:35:44 +00:00
Benno Schulenberg be10c2a48c Rewriting the line-wrapping code to make use of the existing line-break code.
And undoing line wraps together with their causal text additions, and not as
separate actions because the user did not make them.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4945 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-09 10:01:54 +00:00
Benno Schulenberg 64896ba2ff Differentiating between undoing a Delete and undoing a Backspace -- the
cursor should be in a slightly but significantly different position.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4944 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-08 19:02:12 +00:00
Benno Schulenberg 1eb23d4988 Making use of the macros charalloc() and charealloc(), making use of
null_at(), adding a cast, and using an unsigned type for a length.
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4939 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-04 16:30:11 +00:00
Benno Schulenberg 1de337de9c Normalizing whitespace, comments and interpunction, in various places.
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-04 16:02:51 +00:00
Benno Schulenberg ff36b05cdb Differentiating (for the undo structure) between
deleting a newline and any other character.
Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4934 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-29 18:50:13 +00:00
Benno Schulenberg d0e234db08 Removing three unused parameters from do_input(),
as they are only ever set and never referenced.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4919 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-28 13:24:05 +00:00
Benno Schulenberg c3c2c66697 Fixing compilation and avoiding a warning with --enable-tiny.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-26 07:53:20 +00:00
Benno Schulenberg f5ac8c1ee1 Placing the cursor after an undo there where it was before the do,
and handling multibyte characters correctly.
*Patch by Mark Majeres.*


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4908 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-25 19:41:49 +00:00
Benno Schulenberg 52e3533e99 Removing a few more doubled-up spaces.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4896 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-16 11:03:04 +00:00
Benno Schulenberg 5298d5114c Removing an unneeded call of edit_refresh(), and
using 'size_t' instead of 'int' for line lengths.
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4895 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-16 10:50:01 +00:00
Benno Schulenberg 275bd28d3e Tweaking some whitespace, using TRUE and FALSE instead of 1 and 0,
and mentioning the name of the terminal-tickling character (NBSP).
Patch by David Lawrence Ramsey.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4894 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-16 10:34:05 +00:00
Benno Schulenberg 6081546161 Going to the correct positions for undoing and redoing cuts and
pastes.  This fixes many undo problems and Savannah bug #25585.
*Patch by Mark Majeres.*


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4893 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-15 20:00:46 +00:00
Benno Schulenberg 71c9a5245a Several random whitespace and comment tweaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 20:14:01 +00:00
Benno Schulenberg 127ce15d6b Making one error message somewhat clearer.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4867 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-13 08:12:52 +00:00
Benno Schulenberg 85c2c2a5d2 Providing startup feedback for the spell checker, as for the linter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4856 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-12 11:50:58 +00:00
Chris Allegretta 61523be8d2 2014-05-10 Chris Allegretta <chrisa@asty.org>
* src/rcfile.c (parse_color_names): Redefine false and true to
          their appropriate macro names so --with-slang works (slangv2 anyway).
        * src/text.c (do_linter): Care about whether user cancelled the file
          save (cancel the operation) versus justy said no (continue but don't
          save the file).  Also doupdate() after statusbar message that
          linter is being invoked and blank the shortcuts to draw the eye.
          Also allow user to cancel at the "open in a new buffer" prompt.
          New function lint_cleanup().  Fixes Savannah bug 42203.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4855 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-05-11 03:09:00 +00:00
Benno Schulenberg 7a9f4a456e Update the years in the copyright notices.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4826 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-30 20:18:26 +00:00
Benno Schulenberg 25e5896219 Removeing several unneeded double semicolons plus two relic comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4809 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-23 19:33:03 +00:00
Benno Schulenberg 5bd359dbb9 Normalizing whitespace around '==' comparison.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-15 15:02:43 +00:00
Benno Schulenberg cd634e074c Initializing a variable to avoid a compiler warning, renaming it,
adding and tweaking some comments, and removing an unneeded 'if'.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4771 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-14 13:02:43 +00:00
Benno Schulenberg 8f6151198a Whitespace adjustments, plus a few comment tweaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4769 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-14 09:57:06 +00:00
Benno Schulenberg 7828a8096e Removing the unused parameter 'func_key' from get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-14 09:22:29 +00:00
Benno Schulenberg c8fbc7d1a1 Removing the unused parameter 'file_bot' from copy_from_filestruct().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4767 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-14 09:14:39 +00:00
Benno Schulenberg d19be5aafa More editing of comment blocks and trimming of blank lines.
Patch by David Lawrence Ramsey, slightly tweaked.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4753 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-08 18:38:45 +00:00
Benno Schulenberg bc6e9aa926 Keeping a pointer to the Uncut item in the functions list, to be able
to change its description to Unjustify at the appropriate moment.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4739 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-07 09:02:22 +00:00
Benno Schulenberg 70b2d08610 Cosmetic tweaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4734 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-05 20:28:29 +00:00
Benno Schulenberg 189fff44dc Tweaking still more comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4731 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 20:45:28 +00:00
Benno Schulenberg b115aab586 Fixing compilation with --enable-wrapping.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4730 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 20:16:59 +00:00
Benno Schulenberg 36c87bcfd5 Fixing compilation with --enable-justify and tiny.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4726 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 15:52:52 +00:00
Benno Schulenberg 00389928d4 Converting #ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 11:59:03 +00:00
Benno Schulenberg b8b29ff138 Fixing two compilation warnings for tiny.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4714 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-03 21:06:30 +00:00
Benno Schulenberg a65ef4244c Removing stray spaces before tabs.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4652 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-03-17 21:36:37 +00:00
Benno Schulenberg e4c34c3386 Adding, fixing, and removing some #endif comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-03-17 14:15:57 +00:00
Chris Allegretta 3a5f55e439 2014-03-01 Chris Allegretta <chrisa@asty.org>
* global.c (shortcut_init) - Don't actually free the shortcut
          list, since the next pass via justifying will then remove
          all custom shortcuts.  Fixed bug discovered by Benno Schulenberg.
        * text.c (do_linter) - Remove some unused variables to quiet
          -pedanic -Wall.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4637 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-03-04 03:55:43 +00:00
Benno Schulenberg 46fccb2610 Equalizing pipe error messages.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4623 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-02-28 11:49:12 +00:00
Chris Allegretta 5575bfad2c 2014-02-24 Chris Allegretta <chrisa@asty.org>
* new linter functionality.  rcfile option "linter"
        * src/global.c (shortcut_init) - Actually free the sclist
          if it was allocated before.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4600 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-02-24 10:18:15 +00:00
Benno Schulenberg e9ee078c10 End exhorting status-bar messages with a period, to avoid
the impression that something is missing.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4596 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-02-23 10:12:50 +00:00
Chris Allegretta 67acf2c753 2013-01-20 Chris Allegretta <chrisa@asty.org>
* src/text.c (do_histify): Don't allow sigwinch to be received while justifying
          as that puts us into a wacky state.  Fixess crash on justify by Joshua Rogers.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4565 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2013-01-20 07:51:34 +00:00
Chris Allegretta 2ad1de0ba6 Remove trailing spaces on source files as they suck
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4548 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2012-12-30 19:20:10 +00:00
Chris Allegretta daeab0518d 2011-05-10 Chris Allegretta <chrisa@asty.org>
* text.c (do_enter): Only increment totsize by the auto-indented amount, size the previous line's size was
          already counted.  Fixes bug reported by Robert Spanjaard.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4544 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-05-10 05:43:08 +00:00
Chris Allegretta 637daa85c5 * src/*: Retire iso_me_harder_funcmap based on suggestion by <bernd.spaeth@gmx.net>
This does add 20KB to nano's executable size but it gets rid of a lot of indirection
          that makes people stomach turn.  There are several new stub functions and need of more
          tidying as a result of this.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4527 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-02-07 14:45:56 +00:00
Chris Allegretta ab53864de7 2010-11-12 Chris Allegretta <chrisa@asty.org>
* Add check for RESTRICTED mode back to speller, suspend and insert file
          routines, since adding key bindings broke the fact that they should be
          disabled in restricted mode.  Fixes Savannah bug 31625 reported by
          Charlie Somerville.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2010-11-12 06:22:12 +00:00
Chris Allegretta 181c4a999b 2010-04-09 Chris Allegretta <chrisa@asty.org>
* text.c (do_alt_speller): Skip invoking the alt speller if the file size
          is 0 bytes.  Fixes Savannah bug 29393 reported by Mike Frysinger.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4499 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2010-04-14 03:14:40 +00:00
Chris Allegretta a8bc492b8a 2009-12-12 Chris Allegretta <chrisa@asty.org>
* text.c (do_delete), nano.c (do_output): Add check for length of current line
          before and after adding/deleting text, and do full refresh if it is now
          a different multiple of COLS.  Also get rid of superfluous do_refresh
          vars now that we have edit_refresh_needed.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4462 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-12-12 22:21:20 +00:00
Chris Allegretta 2c7b506fbc 2009-12-09 Chris Allegretta <chrisa@asty.org>
* files.c (read_file) - Add parameter for whether we should even try to check
          file writability, as the message is useless when we're inserting into an
          existing buffer.  Fixes Savannah bug 28219.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4460 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-12-09 16:51:43 +00:00
Chris Allegretta c9f0799791 2009-12-02 Chris Allegretta <chrisa@asty.org>
* text.c (add_undo, do_undo, do_redo) - Do not execute cases for SPLIT when DISABLE_WRAPPING
          is defined.  Fixes Savannah bug 28151 (anon).



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4455 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-12-03 03:12:00 +00:00
Chris Allegretta 8a07a96eef 2009-12-01 David Lawrence Ramsey <pooka109@gmail.com>
* Update documentation for 2.2 features including sample nanorc file, texinfo
          file, man pages, UPGRADE file, and update copyright noticed for the current year.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4453 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-12-02 03:36:22 +00:00
Chris Allegretta 5a018f0d3a 2009-11-29 Chris Allegretta <chrisa@asty.org>
* prompt.c (get_prompt_string) - Universally handle help key when is disabled.  Fixes Savannah
          bug 28117 by David Lawrence Ramsey <pooka109@gmail.com>.
        * chars.c, files.c: Add junk vars to silence the compiler.  Sigh.

2009-11-29 David Lawrence Ramsey <pooka109@gmail.com>
        * Change several *chars to const char, additional cleanups and casts to make compilers happier.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4448 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-11-29 06:13:22 +00:00
Chris Allegretta 6f08332741 2009-11-11 Chris Allegretta <chrisa@asty.org>
* winio.c: Large tweaking of cursor and text display based on COLS not COLS - 1,
          due to finally understanding that display_string wasn't being called properly
          when softwrap was enabled.  Fixes Savnnah bug 27603, Return key doesn't scroll
          viewport reported by Hannes Schueller.
        * - Fix size_t formatting issues with -pedantic by converting vals to long unsigned
          for printing.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4420 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-11-11 06:00:33 +00:00
Chris Allegretta f8f9027295 2009-09-02 Chris Allegretta <chrisa@asty.org>
* Attempt to check file writability and emit a warning on the status bar
          if nano doesn't think the file can be written to.  Feature originally
          requested by Damien Jolders <madamien@skullsquad.com> et al.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4407 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-09-03 05:45:13 +00:00
Chris Allegretta 05417a2444 2009-08-17 Chris Allegretta <chrisa@asty.org>
* Initial soft line wrapping implementation.  Command line flags
          -$ or --softwrap.
        * nano.c, text.c: Clean up some fprintf warnings in debug mode due to printing
          a size_t without using the zd specifier.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4402 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-08-17 07:52:10 +00:00
Chris Allegretta a48507d32a 2009-08-13 Chris Allegretta <chrisa@asty.org>
* New global flag implementation courtesy of Adam Wysocki <gophi@arcabit.pl>, allows
 	  previous undo flag to be implemented consistent with other flags.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4400 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-08-14 03:18:29 +00:00
Chris Allegretta 42726f74cc 2009-07-27 Chris Allegretta <chrisa@asty.org>
* text.c (undo_cut, redo_cut): Don't actually try and undo/redo an empty cut, i.e. the magicline. 
	  Fixes crash on cutting last line discovered by Eitan Adler <eitanadlerlist@gmail.com>.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4397 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-07-27 04:16:44 +00:00
Chris Allegretta ad37e67dd2 2009-07-11 Chris Allegretta <chrisa@asty.org>
* nano-regress: Small tweaks
	* Change undo code to off unless unabled via a command line option (-u/--undo).  Until this code
	  stabilizes this is the only responsible way to treat it.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4395 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-07-12 03:36:58 +00:00
Chris Allegretta a4c2b99e40 More wrapping redo fixes. Just make do-wrap() undo aware.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4394 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-04-29 22:34:27 +00:00
Chris Allegretta 8b9fb360c2 Comimt point for roll-back of latest undo/redo of split changes.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4393 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-04-29 04:43:58 +00:00
Chris Allegretta e061a0d604 Add undoing check for do_enter so redo doesn't blow up.
Hate to piecemeal these fixed but system unstability is teh suck.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4392 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-04-25 03:31:30 +00:00
Chris Allegretta b843a51b79 Add undo for line break via enter, separate from line wrap
Change message for line split to line wrap, since split ~= break



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4391 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-04-21 05:34:08 +00:00
Chris Allegretta df543e78df - Remove a debug line I left in
- Fix undo line split uglyness.  Still not perfect but switching work envs.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4390 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-04-12 06:13:16 +00:00
Chris Allegretta 12ba55732f First pass at fixing the line splitting undo since it's currently broken beyond belief.
I believe more is broken but committing will motivate me to get closer to a real fix :)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4389 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-03-26 01:01:48 +00:00
Chris Allegretta b71cf301da Okay that will not work. Revert forcing reset_multis on !viewok as it's too expensive
for things like deleting text.  Will have to go back and force inside functions.
Add check in reset_multis for CNONE type since that's slowing us down and is dumb
to leave out.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-16 23:06:09 +00:00
Chris Allegretta fd265af15a 2009-02-05 Chris Allegretta <chrisa@asty.org>
* More color syntax speedups:  Determine in reset_multis() whether we really need to call
          edit_refresh().  Additional global var edit_refresh_needed() to hopefully reduce  
          repeated calls to the function.  New helper funcs reset_multis_before() and 
          reset_multis_after().



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4364 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-06 03:41:02 +00:00
Chris Allegretta a117163a4c 2009-01-19 Chris Allegretta <chrisa@asty.org>
* Change funcion definitions to shorts instead of (void *)s.  New mapping function
          iso_me_harder_funcmap().  Fixes compilation complaints with -pedantic, 
          reported by Eitan Adler <eitanadlerlist@gmail.com>.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4349 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-01-19 19:10:39 +00:00
Chris Allegretta 4e12cb8455 Get rid of some unused variables with -Wall
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4342 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-10-14 19:55:34 +00:00
Chris Allegretta c81cf52cf2 Eliminate linescut variable from undo structure as its an unneeded pain in the ass.
Also initialize to_end, because for some reason it seems to be not getting set even when
type == CUT in add_undo (?!)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4340 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-10-14 04:34:56 +00:00
Chris Allegretta c84e765b8e 2008-10-13 Chris Allegretta <chrisa@asty.org>
* Remove CUTTOEND as an undo type as it's unneeded, fix u->to_end logic in undo struct.
        * undo.c (update_undo): Don't free cutbuffer if NULL, fix for Savannah bug #24499



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-10-14 01:14:12 +00:00
Chris Allegretta 5c1c143ed2 2008-10-04 Chris Allegretta <chrisa@asty.org>
* cut.c (Add_undo): Save last cut undo information so it can be used for next uncut, fixes
          Savannah bug 24183.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4338 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-10-04 11:10:11 +00:00
Chris Allegretta b549f3761a 2008-09-16 Chris Allegretta <chrisa@asty.org>
* text.c: Add support for undoing a text uncut.  Split out the undo and redo of a text cut
          in order to avoid code duplication.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4327 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-09-16 21:35:19 +00:00
Chris Allegretta dc7136a082 * text.c (do_enter): Fix issue when compiled with --enable-debug, fixes Savannah bug 24092.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4309 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-21 04:24:25 +00:00
Chris Allegretta 77bf1b5197 2008-08-21 Chris Allegretta <chrisa@asty.org>
* text.c: Change error messages where we may possibly get into a bad state and urge
          the user to save when this happens.  Originally by Benno Schulenberg <bensberg@justemail.net>



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4308 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-21 04:21:06 +00:00
Chris Allegretta 80ea9c5de9 * text.c (add_undo): Fix check for multi-line cut check skips adding other new legit events.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4300 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 10:08:33 +00:00
Chris Allegretta 5c27d723c9 * text.c (do_redo): Fix improperly restoring the text when redoing a line split.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4298 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 09:28:07 +00:00
Chris Allegretta 6f681c1be2 * text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly
mistakenly think this is an update when it's really an add.  Also
          Fix an extra ; after an if statement which makes nano try to free a struct which
          may be NULL 



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-08 03:02:03 +00:00
Chris Allegretta ea577874ef - Add redo of an insert
- Fix bug in fsfromlineno
- Tiny cleanups in undo



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4292 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-03 20:19:42 +00:00
Chris Allegretta 14c8620e0b - Change add_undo and current_undo to only take action arg, as openfilestruct arg is always openfile
- Add ability to undo a file/cmd insert, needed to add undoable flag to read_file and open_buffer as a result



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4291 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-03 04:48:05 +00:00
Chris Allegretta 3c1131a5b3 - Add very basic undo for text replace.
- Fix lots of warnings whe using -Wall
- Fix some comments



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4290 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-02 22:31:01 +00:00
Chris Allegretta d31ddb789f Allow basic multi-^K cuts to be redone properly. Code getting uglier by the second.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4288 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 07:29:06 +00:00
Chris Allegretta 8f76112084 - When undoing a cut, set cutbuffer to NULL after freeing the current one
- When updating a normal consecutive ^K cut, bail from add_undo since it's not an add, and in update_undo free the old cutbuffer before copying it again.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4287 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 06:52:15 +00:00
Chris Allegretta 1f37c4514d When redoing a text add, actually copy the beginning of the line back!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4286 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 04:11:57 +00:00
Chris Allegretta 91a1862eed Add undoing argument to do_cut_text as we don't want to be messing around with the undo contents when we're in the
middle of an undo.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 03:50:20 +00:00
Chris Allegretta 12dc8cae80 Commit back some undo/redo rewrites
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4283 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-31 04:24:04 +00:00
Chris Allegretta 0b499d465b Add xflags to undo struct so we can add extra info to the undo process (e.g. backspace vs delete)
Fix redo of a line join.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4282 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-14 07:18:22 +00:00
Chris Allegretta fa406949ec Allow backspace to be bound to keys in .nanorc
Allow kdel to be rebound
Add note about rebinding kdel to backspace for those using OSX or PuTTY to connect to remote Linux machines in nanorc.sample.in

When undoing text deletes, move current_x to proper location



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4281 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-13 16:44:19 +00:00
Chris Allegretta 274142cb10 Clean up some unused variables from old undo implementation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4278 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:48:20 +00:00
Chris Allegretta 09b8124859 Savannah bug 23751: Segfault when viewing help using Japanese locale
Fix break_line crashing when using certain locales from Mitsuya Shibata



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 01:54:49 +00:00
Chris Allegretta 07fcc4c973 Add beginning undo feature, since I want to start fixing bugs from savannah and don't want to manager another checking, and the code basically works for some operations.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4271 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-10 20:13:04 +00:00
Chris Allegretta 8b6461fc80 files.c,proto.h,text.c: Fix for conflicts with AIX curses variables, from William Jojo <jojowil@hvcc.edu>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 23:09:40 +00:00
Chris Allegretta 10f868d33c - Update man page a little bit more
- Change do_prompt and get_prompt_line to pass meta_key and func_key
  so the calling program can DTRT when it calsl get_shortcut.  In
  particular this allows the "new file buffer" toggle on the insert file
  menu to work, and presumably other rebinding stuff should now work also.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4226 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-14 04:08:51 +00:00
Chris Allegretta 0018d8ed6f - Fix tiny mode again after breaking it again
- Resurrect IFSCHELP to get rid of some needless help message stubs
- Add support for rebinding the suspend key
- Fix wrong refresh help message


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4224 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-13 08:23:52 +00:00
Chris Allegretta 79a33bb38d New keybindings code and backend. New structs subnfunc for menu functions
and toggles and sc for shortcut keys, old 'shortcut' and 'toggles' structs are
gone.  The current implementation has a bunch of broken stuff (some of which is
documented in BUGS).  Updated nanorc.5 with some mostly complete documentation
on configuring.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-05 07:34:01 +00:00
David Lawrence Ramsey 8b9c91b80d in execute_command(), call terminal_init() instead of just
disable_signals() after executing the command, as the command may have
changed the terminal settings


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 01:28:53 +00:00
David Lawrence Ramsey d8a1d37161 update copyright notices, as Chris Allegretta's copyrights have now been
assigned to the Free Software Foundation; also, make copyright notices
consistent in style


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 05:01:32 +00:00
David Lawrence Ramsey c9694b7636 update copyright notices, as my copyrights have now been assigned to the
Free Software Foundation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-05 16:44:45 +00:00
David Lawrence Ramsey d0035b4ab2 convert to GPLv3 or later
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-11 05:17:36 +00:00
David Lawrence Ramsey ee43ea6a74 in backup_lines(), avoid a segfault when the mark begins and ends on the
line after the last line of the paragraph


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4099 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-22 15:04:05 +00:00
David Lawrence Ramsey 0e1df431a8 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4036 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-12 02:58:12 +00:00
David Lawrence Ramsey e44cd2dfba yet more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4032 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 22:54:55 +00:00
David Lawrence Ramsey 9e7b2d572c more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4031 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 22:46:22 +00:00
David Lawrence Ramsey 6335fb54d5 miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 05:15:32 +00:00
David Lawrence Ramsey f1982f01d1 still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3992 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-10 17:57:09 +00:00
David Lawrence Ramsey ad36bdc773 per Itay Perl's patch with a few additions of mine, fix various minor
memory leaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-02 17:22:21 +00:00
David Lawrence Ramsey b6c4dbffdb in do_spell(), when setting i to the return value of
write_(marked_)?file(), use the "?" operator instead of an if/else
clause


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3970 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 22:38:17 +00:00
David Lawrence Ramsey cb801d63a3 cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3950 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 02:47:11 +00:00
David Lawrence Ramsey 84d22e3f53 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3948 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 13:05:50 +00:00
David Lawrence Ramsey 7b0531aa0b per Benno Schulenberg's patch with a few tweaks by me, add various
clarifications to translated strings


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3828 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-07-31 01:30:31 +00:00
David Lawrence Ramsey b159f941e8 per Benno Schulenberg's patch with a few additions by me, fix
punctuation relating to "i.e." in comments and documentation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3821 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-07-28 17:06:27 +00:00
David Lawrence Ramsey 9a145d906f in do_insertfile(), if we're in view mode, as we can be if multibuffer
mode is on, don't mark the file as modified (and remove the code that
does this in execute_command()); also, if we execute a command in a new
buffer, move back to the beginning of the first line of the buffer
afterwards, for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3785 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-07-13 03:06:36 +00:00
David Lawrence Ramsey aee00d4d14 if the mark isn't on, allow Meta-} and Meta-{ to indent and unindent
only the current line, just as it would if the mark covered only the
current line, instead of displaying a statusbar message and quitting


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3758 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-07-05 18:42:22 +00:00
David Lawrence Ramsey 03979d7a08 another comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3657 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-11 19:15:59 +00:00
David Lawrence Ramsey d4686b8e51 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3656 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-11 19:14:14 +00:00
David Lawrence Ramsey f32e1dd589 in do_spell(), set currshortcut to main_list before calling
total_refresh() near the end of the function, so that we don't display
the wrong shortcut list


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3651 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-09 17:09:51 +00:00
David Lawrence Ramsey 3ce7e9dcac in do_spell(), call total_redraw() instead of total_refresh() after
running the spell-checker, since the latter will display the wrong
shortcut list


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-09 16:34:00 +00:00
David Lawrence Ramsey 8602fd6aaa typo fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3591 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-28 18:43:21 +00:00
David Lawrence Ramsey a620e683e7 don't blank the statusbar after getting verbatim input if constant
cursor position display is on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3587 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-27 18:19:03 +00:00
David Lawrence Ramsey 6fb6689f0f various input/output fixes: allow normal typing of high-bit control
characters, as Pico does; in do_verbatim_input(), unconditionally blank
the statusbar as soon as we're finished getting input; and in
parse_verbatim_kbinput(), don't include the ability to enter a Unicode
sequence via verbatim input mode if ENABLE_UTF8 isn't defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3584 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-27 17:39:19 +00:00
David Lawrence Ramsey f451d6a64a add Benno Schulenberg's translator comments, and fix typos in the last
changelog entry


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3582 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-27 16:02:48 +00:00
David Lawrence Ramsey 3af1e50855 per Benno Schulenberg's patch, fix the statusbar's not blanking properly
after verbatim input


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3557 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-24 18:23:21 +00:00
David Lawrence Ramsey ef0d5a7637 handle prepending of wrapped text in one place instead of many, so that
it always works consistently


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3547 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-22 02:08:49 +00:00
David Lawrence Ramsey 139fa65c66 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3545 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-22 01:26:24 +00:00
David Lawrence Ramsey 2829aae635 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3544 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-22 01:24:09 +00:00
David Lawrence Ramsey ce8623669b handle statusbar blanking in one place instead of many, so that it
always works consistently, per Benno Schulenberg's patch (with a few
tweaks of mine); also, blank the statusbar after 26 keystrokes instead
of 25, for compatibility with Pico


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3541 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-21 21:23:21 +00:00
David Lawrence Ramsey 39bd1b3597 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3531 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-20 13:11:56 +00:00
David Lawrence Ramsey cd243f558a in break_line(), handle newlines consistently when searching for the
last blank in the first group of blanks in the range of (goal - 1)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-19 23:27:16 +00:00
David Lawrence Ramsey 75e9dfe5a4 comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3525 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-18 17:50:08 +00:00
David Lawrence Ramsey 2d3d1e9324 in break_line(), fix problem where tab widths in columns are always
calculated as tabsize


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3523 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-18 17:28:16 +00:00
David Lawrence Ramsey 1c5af644b5 avoid unnecessary state saving for when we resize
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-10 15:15:06 +00:00
David Lawrence Ramsey fc0f8f8c57 allow unjustifying if we resize the window immediately after justifying,
as Pico does, and make input handling across resizes more consistent


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3495 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-10 13:41:53 +00:00
David Lawrence Ramsey 5bb7727740 another formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3478 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-06 14:37:33 +00:00
David Lawrence Ramsey b22c80ad1d remove various redundant key checks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3477 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-06 13:41:59 +00:00
David Lawrence Ramsey 0a208b3b62 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3472 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-06 02:22:02 +00:00
David Lawrence Ramsey 2545686481 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3471 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-05 15:43:52 +00:00
David Lawrence Ramsey 80669c34bb in do_indent_marked(), only use line_indent and line_indent_len when
necessary


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3470 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-05 15:41:43 +00:00
David Lawrence Ramsey 9e73d98a60 better handle position shifting when indenting marked text
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3469 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-05 15:20:36 +00:00
David Lawrence Ramsey eb4f90e182 better handle position shifting when unindenting marked text
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3468 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-05 14:22:42 +00:00
David Lawrence Ramsey f0e3ca6e88 clarify error messages
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3466 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-03 13:11:00 +00:00
David Lawrence Ramsey ac37b04737 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3465 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-03 12:59:05 +00:00
David Lawrence Ramsey af9052d7c7 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3463 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-01 17:14:25 +00:00
David Lawrence Ramsey 2ca3fc9fa6 consistency fix for do_indent_marked(): remove indentation from just
before the non-whitespace text on lines instead of the beginnings of
lines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3462 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-01 16:48:12 +00:00
David Lawrence Ramsey fd3cceee44 fix yet more do_indent_marked() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3458 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-30 01:29:51 +00:00
David Lawrence Ramsey 7194a617c4 fix still more do_indent_marked() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3457 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-29 16:11:21 +00:00
David Lawrence Ramsey 2e8fac6487 fix more do_indent_marked() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3456 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-29 15:44:58 +00:00
David Lawrence Ramsey 5c819b53e1 really fix do_indent_marked() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3455 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-29 15:12:07 +00:00
David Lawrence Ramsey d9eca4b8bf fix do_indent_marked() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3454 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-29 15:07:37 +00:00
David Lawrence Ramsey 4527da5e9b when indenting lines, properly keep track of the mark coordinates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3449 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-28 13:37:42 +00:00
David Lawrence Ramsey f85001a368 add the ability to indent and unindent all marked lines of text, via
Meta-[ (Meta-}) and Meta-] (Meta-}), per Chris' patch with some changes
by me


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3446 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-28 13:19:56 +00:00
David Lawrence Ramsey c838a4cd45 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3439 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-26 18:33:50 +00:00
David Lawrence Ramsey 6816007242 make sure browser_refresh() is used when refreshing or doing tab
completion at the prompt in the file browser


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-02-18 21:32:29 +00:00
David Lawrence Ramsey 33f2a08b5c update copyright years
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3281 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-02-07 21:11:49 +00:00
David Lawrence Ramsey 9d8c284135 allow tab completion of directories at the "Go To Directory" prompt
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3280 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-02-07 21:11:05 +00:00
David Lawrence Ramsey 5b7b3e3c9c cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3253 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-31 21:22:54 +00:00
David Lawrence Ramsey 30bdadd4d5 revert previous erroneous change, and clarify comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3252 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-31 21:08:10 +00:00
David Lawrence Ramsey 89b6e6b9dd in justify_format(), remove redundant character parsing
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3251 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-31 20:37:56 +00:00
David Lawrence Ramsey b0e04c0de3 a few last comment and consistency fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3238 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-08 07:24:54 +00:00
David Lawrence Ramsey 6d6a36c647 add descriptive comments to pretty much all functions and major
variables that don't have them, plus a few miscellaneous minor fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3237 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-08 07:09:08 +00:00
David Lawrence Ramsey 034b994eb5 since proto.h includes nano.h, and nano.h includes config.h first,
include proto.h first and remove redundant includes of config.h in all
non-header source files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-08 02:47:10 +00:00
David Lawrence Ramsey 8befda6490 readd RETSIGTYPE return types for signal handlers, since any problems
with its being defined as the wrong type aren't nano's fault


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-06 19:39:56 +00:00
David Lawrence Ramsey 24777c0740 fix compilation with --enable-debug, and remove unneeded assert
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3234 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-01 05:49:08 +00:00
David Lawrence Ramsey a685468a18 efficiency and comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3233 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-30 21:19:42 +00:00
David Lawrence Ramsey c7c04bb665 in brak_line(), in the surrounding #ifdef, replace the combination of
!DISABLE_JUSTIFY and !DISABLE_WRAPPING with !DISABLE_WRAPJUSTIFY, for
consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3229 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 21:30:00 +00:00
David Lawrence Ramsey 3239ff22c8 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 20:01:06 +00:00
David Lawrence Ramsey ad1b64cdfa in do_justify(), renumber after justifying each individual paragraph,
since find_paragraph() needs the line numbers to be right as well as
edit_refresh(); this fixes a potential segfault when doing full justify
with auto-indent turned on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3226 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 19:00:09 +00:00
David Lawrence Ramsey 79383beef3 revert last changes, as they make full justify and justify act
differently


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3225 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 18:34:45 +00:00
David Lawrence Ramsey 9a065c089f in find_paragraph(), add parameter begin, the line that we can't move
further back than when searching for a paragraph; this is needed to
ensure that we don't justify the same lines more than once if
auto-indent is turned on, and the indentation of what should be the
previous paragraph matches that of what should be the current paragraph


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3224 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 18:25:53 +00:00
David Lawrence Ramsey 1932dfb131 another comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3223 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 05:52:49 +00:00
David Lawrence Ramsey eae8571ae4 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 05:48:06 +00:00
David Lawrence Ramsey 2e2112cad1 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 05:39:31 +00:00
David Lawrence Ramsey 5da68ee193 in execute_command(), instead of hardcoding /bin/sh as the shell to use
when executing a command, use $SHELL, and only fall back to /bin/sh if
$SHELL isn't set


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3220 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-29 05:21:06 +00:00
David Lawrence Ramsey 315eb3280a adjust copyright notices in all source files to account for Chris'
reassigning the 2005-2006 copyright on nano to me


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-28 19:35:29 +00:00
David Lawrence Ramsey b4e5c02474 more miscellaneous do_wrap() fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3214 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-25 13:48:09 +00:00
David Lawrence Ramsey 219a814de2 remove redundant code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-22 22:08:01 +00:00
David Lawrence Ramsey 615f4c71c0 tweak do_wrap() to remove the assumption that the file always ends in a
magicline


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-22 21:48:24 +00:00
David Lawrence Ramsey b9b2fd52ff in break_line(), only include the newline parameter if DISABLE_HELP
isn't defined, as it's only used then


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3209 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-22 21:13:36 +00:00
David Lawrence Ramsey ccd1b7b50a miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-18 20:21:48 +00:00
David Lawrence Ramsey bd0b3cd39b in do_justify(), don't save current_y and restore it if the user
unjustifies, as the reset_cursor() called by edit_refresh() after
restoring edittop and current will ensure that current_y is restored to
its original value


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-16 04:41:31 +00:00
David Lawrence Ramsey c5c5230b9d overhaul the bracket searching code so that it no longer requires regex
support to work, and add some miscellaneous search code cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-15 23:45:29 +00:00
David Lawrence Ramsey ebe3425f9f rename the NANO_SMALL #define to NANO_TINY
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-15 03:17:35 +00:00
David Lawrence Ramsey 3f7c8c5158 fix copyright years on source files; all functions in browser.c were
originally added in 2001; the oldest function in color.c is
do_colorinit() (now color_init()), which was originally added in 2001;
the oldest function in chars.c is revstrstr(), which was originally
added in 2001; the oldest function in help.c is do_help(), which was
originally added in 2000; the oldest function in prompt.c is statusq()
(now do_prompt()), which was originally added before 0.6.6, which was
apparently in 1999; all functions in rcfile.c were originally added in
2001; one of the oldest functions in search.c is do_search(), which was
originally added in 0.2.7, which was apparently in 1999; and one of the
oldest functions in text.c is do_wrap(), which was originally added in
0.3.1, which was apparently in 1999; also, for functions originally
adapted from other sources, add notices from the original files, as we
do with the tab completion functions adapted from busybox


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-14 22:20:35 +00:00
David Lawrence Ramsey d82dae0925 fix the last of the breakage (I hope) in find_paragraph() and
do_justify()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3161 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-11 05:13:28 +00:00
David Lawrence Ramsey bdff665b5d fix still more find_paragraph() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-11 04:14:33 +00:00
David Lawrence Ramsey 1be131a9f9 fix more find_paragraph() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3159 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-11 03:55:52 +00:00
David Lawrence Ramsey 8b203d6f22 fix yet more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3158 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-11 03:17:44 +00:00
David Lawrence Ramsey 53f641f909 fix still more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3157 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 21:57:56 +00:00
David Lawrence Ramsey 57f1bbd991 fix more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 21:53:46 +00:00
David Lawrence Ramsey cd8f73521e fix breakage in both backup_lines() and do_justify(); the latter's
return value is unneeded, as current will point to the same line when
it's done, and making first_par_line point to current in the former
ensures that the two will properly stay in sync


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 21:20:32 +00:00
David Lawrence Ramsey 52161ee3a1 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3154 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 19:56:26 +00:00
David Lawrence Ramsey 874ec8f259 fix more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 19:28:27 +00:00
David Lawrence Ramsey 985d586c3a revert change to do_justify(), since it's used when fileage may be
temporarily out of range


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 16:46:50 +00:00
David Lawrence Ramsey e74851451d more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3150 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 07:11:51 +00:00
David Lawrence Ramsey ad7cf31cbf comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3149 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 06:25:01 +00:00
David Lawrence Ramsey 75689f3901 fix still more find_paragraph() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3148 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 06:19:47 +00:00
David Lawrence Ramsey 82b5debb1b more do_justify() fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 06:07:57 +00:00
David Lawrence Ramsey b2d1c5f5b2 fix yet more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3146 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 06:01:41 +00:00
David Lawrence Ramsey b885c9c5e9 revert change to edit_update(), since it's used when fileage may be
temporarily out of range, and fix a comment


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 05:20:25 +00:00
David Lawrence Ramsey e99223dd25 tweak do_wrap(), remove_magicline(), edit_scroll(), and edit_update() to
rely on fileage and filebot instead of NULL for their checks to detect
the top or bottom of the file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3143 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 04:27:30 +00:00
David Lawrence Ramsey 6195f7c34c comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3142 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 04:14:51 +00:00
David Lawrence Ramsey 653a5a3a45 tweak do_justify() to rely on fileage instead of NULL for its check to
detect the top of the file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3141 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 04:03:05 +00:00
David Lawrence Ramsey e8d505ba02 fix still *more* backup_lines() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 03:40:45 +00:00
David Lawrence Ramsey 5d6f127948 fix still more backup_lines() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3139 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-10 03:32:59 +00:00
David Lawrence Ramsey f0575cfa10 fix still more backup_lines() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 23:27:51 +00:00
David Lawrence Ramsey af5a9997fd more do_justify() breakage fixes, and miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3137 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 23:06:44 +00:00
David Lawrence Ramsey c82bc8ba84 fix more backup_lines() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3136 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 22:59:51 +00:00
David Lawrence Ramsey 1836a0fb7a fix break_lines() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3135 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 22:42:37 +00:00
David Lawrence Ramsey 12090dd320 fix more find_paragraph() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 21:53:21 +00:00
David Lawrence Ramsey 2101403824 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3133 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 20:33:42 +00:00
David Lawrence Ramsey 5455b6af46 fix more do_justify() breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3132 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 20:17:12 +00:00
David Lawrence Ramsey 9bedc4b71c fix breakage in find_paragraph() and do_justify()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3131 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 19:51:48 +00:00
David Lawrence Ramsey 47b693e582 add comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3130 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 19:22:29 +00:00
David Lawrence Ramsey 2c5d0ecbb3 tweak find_paragraph() and do_justify() to remove the assumption that
the file always ends in a magicline; note that the latter isn't
completely fixed yet


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 19:06:01 +00:00
David Lawrence Ramsey 5c33e88b25 finish tweaking backup_lines() to remove the assumption that the file
always ends in a magicline, and add documentation fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3128 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 18:58:04 +00:00
David Lawrence Ramsey 8bd960bbc9 minor backup_lines() cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3127 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 18:49:16 +00:00
David Lawrence Ramsey 0083bd29d2 tweak begpar() to rely on fileage instead of NULL for its check to
detect the top of the file, and make it return NULL if foo is NULL, just
as inpar() does


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 18:26:44 +00:00
David Lawrence Ramsey 32bd29e3cc cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3122 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 03:44:23 +00:00
David Lawrence Ramsey 0f6236f556 *really* make deleting and cutting text consistent with each other, and
fix comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3115 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 00:08:29 +00:00
David Lawrence Ramsey c9820ac098 more fixes for files that don't end in magiclines: make cut_line() cut
the text of the current line (if any), minus the nonexistent newline,
when we're on the last line of the file, and make sure again that the
file isn't marked as modified if the magicline is deleted and we're
supposed to have one, as it's more consistent that way (a marked cut of
the magicline adds a newline to the cutbuffer, while deleting the
magicline adds nothing)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3114 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 23:59:29 +00:00
David Lawrence Ramsey 0ed7171138 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3113 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 23:09:47 +00:00
David Lawrence Ramsey 4ed8134699 revert last change, as the new bahavior is consistent with the behavior
when you cut the magicline with the mark


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3112 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 23:08:08 +00:00
David Lawrence Ramsey d84cfb03df tweak do_delete() to not mark the file as modified if we delete the
newline before filebot and a magicline is added as a result, as it did
before the NO_NEWLINES flag was added


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 22:59:10 +00:00
David Lawrence Ramsey 9c984e8e63 in do_alt_speller(), move the code that replaces the text of the current
file with the text of the spell-checked file into its own function,
replace_buffer()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3109 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 19:15:58 +00:00
David Lawrence Ramsey 1e0e235cbb make do_int_spell_fix() and do_alt_speller() take the NO_NEWLINES flag
into account


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3108 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 18:34:12 +00:00
David Lawrence Ramsey 8779a17ffe initialize the static pid_t pid in text.c, just in case
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3107 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 16:45:22 +00:00
David Lawrence Ramsey f400c23279 tweak do_alt_speller() to remove the assumption that the file always
ends in a magicline


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3106 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-08 16:37:29 +00:00
David Lawrence Ramsey e19449ec50 actually use statusbar_pww in the statusbar prompt code to cut down on
redundant updates, add related functions to do that, and rename a few of
the statusbar prompt functions for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3099 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-07 21:45:44 +00:00
David Lawrence Ramsey 37ddfa9dbd move do_verbatim_input() from nano.c to text.c, since it's an advanced
text-based operation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3096 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-07 06:06:05 +00:00
David Lawrence Ramsey a0168ca896 add new -L/--nonewlines command line option, and new "nonewlines" rcfile
option, to control whether nano adds magiclines to the ends of files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3091 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-05 17:35:44 +00:00
David Lawrence Ramsey b7dc8f3a12 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3087 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-04 16:34:51 +00:00
David Lawrence Ramsey 2ffdea4fc1 tweak a few functions to remove the assumption that the file always ends
in a magicline, and to rely on fileage and filebot instead of NULL for
their checks to detect the top or bottom of the file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3080 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-03 21:08:39 +00:00
David Lawrence Ramsey ee11c6a62f add missing stdio.h #include to text.c too
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3077 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-02 19:42:02 +00:00
David Lawrence Ramsey c85e4f43b5 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3071 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-01 19:29:56 +00:00
David Lawrence Ramsey 4005fc6257 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3042 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-10-08 06:12:41 +00:00
David Lawrence Ramsey 90b07fc2fd in do_tab(), make sure that we insert the correct number of spaces if
the TABS_TO_SPACES flag is set and placewewant is greater than the
current column position of the cursor


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3041 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-10-07 15:57:48 +00:00
David Lawrence Ramsey 7b71f573e7 add missing string translation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3040 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-10-06 20:46:11 +00:00
David Lawrence Ramsey ae4c3a6206 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3028 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 19:46:39 +00:00
David Lawrence Ramsey 95ef337b1a revert previous changes, as lines are broken on tabs regardless of goal
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3027 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 19:44:19 +00:00
David Lawrence Ramsey 9c4488bf0c in break_line(), fix another problem where goal could be miscalculated
on lines containing tabs


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3026 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 19:36:39 +00:00
David Lawrence Ramsey 5ab12ca761 miscellaneous minor fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3025 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 17:52:52 +00:00
David Lawrence Ramsey ca37ee67d9 *really* fix the previous break_line() problem
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3024 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 17:47:27 +00:00
David Lawrence Ramsey bdc1b9b568 really fix the previous break_line() problem
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3023 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 16:36:08 +00:00
David Lawrence Ramsey cd9a5f0377 in break_line(), fix a problem where a line could be broken in the
middle of a multibyte character


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3022 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-09-20 06:12:54 +00:00