Commit Graph

160 Commits (9fece9deb02d212348ed578da1b53b022c2cad1f)

Author SHA1 Message Date
David Lawrence Ramsey abd8993660 in update_history(), add a check to make sure the parameter we pass to
renumber() isn't NULL, and update related comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-08-10 20:03:58 +00:00
David Lawrence Ramsey db57ad757f comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2956 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-31 20:57:38 +00:00
David Lawrence Ramsey 691698a954 move advanced text operations (command execution in a buffer, wrapping,
spell checking, justifying, and word counting) to their own source file,
text.c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2919 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-24 19:57:51 +00:00
David Lawrence Ramsey d1dc23bd78 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2907 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-21 17:52:36 +00:00
David Lawrence Ramsey 3a9a32996b in do_find_bracket(), add comments and minor cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2905 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-21 02:20:01 +00:00
David Lawrence Ramsey 96e6d56571 in find_history() and get_history_completion(), make parameters const
where possible


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2896 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-19 04:53:45 +00:00
David Lawrence Ramsey 91d468d7fd for consistency, revert handling of cases where a search string and a
match to it are not the same length in bytes, since the same technique
can't be made to work with tab completion matches


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2893 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-18 19:29:27 +00:00
David Lawrence Ramsey 0e581b3524 make sure that the current position in the history list is properly set
to the bottom if we cancel out of the prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2890 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-18 07:48:50 +00:00
David Lawrence Ramsey 24b1563068 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2889 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-18 05:23:04 +00:00
David Lawrence Ramsey a0aa4df041 properly handle cases where a search string and a match to it are not
the same length in bytes, i.e, when the latter contains invalid
multibyte characters interpreted as normal characters


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2888 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-18 05:17:59 +00:00
David Lawrence Ramsey 5b44f373fd really fix color breakage by decoupling edit_update() and
edit_refresh(); edit_update() is only called without edit_refresh() in
do_gotolinecolumn() if allow_update is FALSE, and in edit_refresh()
itself if edittop is out of range of current


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 22:47:12 +00:00
David Lawrence Ramsey 8f4762a842 cosmetic and #ifdef fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 22:35:11 +00:00
David Lawrence Ramsey 8f1afee813 fix color breakage; also, in main(), when opening files with
"+LINE,COLUMN" arguments on the command line, don't update the screen
when moving to their specified lines and columns


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2873 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 07:06:36 +00:00
David Lawrence Ramsey 0532296a10 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2864 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-14 23:51:52 +00:00
David Lawrence Ramsey db95802a18 add breakage fixes, type fixes, and as-needed color regex compilation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2854 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-13 20:18:46 +00:00
David Lawrence Ramsey 5128de8308 fix marking breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-12 17:40:16 +00:00
David Lawrence Ramsey dbcaa3b1fb fix some breakage caused by the restructuring
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2836 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 20:59:24 +00:00
David Lawrence Ramsey 6ad59cd29b restructure things so that every file has its own openfilestruct, and so
that the values in it are used directly instead of being periodically
synced up with the globals; accordingly, remove the globals; this
changes pretty much every function


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2835 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 20:09:16 +00:00
David Lawrence Ramsey 612b41615b clean up the search code a bit
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2809 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-02 17:56:29 +00:00
David Lawrence Ramsey e3df8788b7 in do_replace(), blank out last_replace properly again just before
displaying the "Replace" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2808 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-02 17:49:27 +00:00
David Lawrence Ramsey 5beae58597 add one missing type change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2792 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 00:17:18 +00:00
David Lawrence Ramsey 2cf6d717f1 add various type changes to avoid problems on systems where int and
ssize_t are different sizes.  Make filestruct->lineno a ssize_t (so that
we can avoid negative line numbers at the "Go To Line" prompt),
current_y a ssize_t (in order to hold the maximum difference between two
filestruct->lineno's), totlines a size_t, and change related variables
to match


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2782 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 06:25:34 +00:00
David Lawrence Ramsey 7a3f49c019 remove all instances of charcpy() and replace them with strncpy(), for
ease of maintenance


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2758 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-22 00:24:11 +00:00
David Lawrence Ramsey 0517c482e4 typo fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2756 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 22:37:47 +00:00
David Lawrence Ramsey 16799baccd change some instances of charcpy() back to strncpy(), as the latter's
numm-termination is needed in some places


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2755 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 22:32:50 +00:00
David Lawrence Ramsey c4ca596a90 various #ifdef fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2703 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 20:58:19 +00:00
David Lawrence Ramsey 5c8197d78f miscellaneous cleanups in do_find_bracket(): rename variables for
consistency, and save the search direction and regexp setting in two
bools instead of one flags variable


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2702 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 20:41:20 +00:00
David Lawrence Ramsey f3ecffd24d add the "regexp" rcfile option back in at DB's suggestion, the
"casesensitive" and "backwards" rcfile options for consistency,
documentation updates, and related cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2700 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 18:48:30 +00:00
David Lawrence Ramsey da72453859 add missing blank lines
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2678 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 19:15:14 +00:00
David Lawrence Ramsey e221311f2e don't count punctuation when searching for a whole word in
is_whole_word()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 03:03:45 +00:00
David Lawrence Ramsey bdfa927d62 more miscellaneous cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2662 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 23:36:13 +00:00
David Lawrence Ramsey 8b698f4a29 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2647 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 05:16:55 +00:00
David Lawrence Ramsey 9880afc47a remove unneeded blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2646 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 05:13:14 +00:00
David Lawrence Ramsey 5ed8819f35 revert the simplification of the display_string() call in
do_replace_loop(), as it breaks display in some ways


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2645 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 04:37:28 +00:00
David Lawrence Ramsey 7291daabe3 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2644 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 04:11:20 +00:00
David Lawrence Ramsey d2edb8a538 when doing history string tab completion, skip over an exact match
unless it's the only match, as the old history code did


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2643 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 03:52:33 +00:00
David Lawrence Ramsey 33d07ef055 in do_replace_loop(), simplify the display_string() call that we use to
get the word that we're going to highlight


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2642 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 03:19:50 +00:00
David Lawrence Ramsey 67287088dc detect words more accurately by taking punctuation into account, and
convert all word-detecting functions to use the same wrapper function
for ease of maintenance


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 02:40:04 +00:00
David Lawrence Ramsey c4dbdd55f5 in do_replace_loop(), when moving to the next match, update the screen
using edit_refresh() instead of edit_redraw(), as the latter won't work
properly when we've replaced one or more instances of a string in copy
and haven't yet updated current->data to match copy


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2599 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 03:46:32 +00:00
David Lawrence Ramsey 81e49a0d4a fix #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2589 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 21:00:55 +00:00
David Lawrence Ramsey c10d8ffe9f for consistency, remove -R/--regexp command line option, and allow the
toggle unconditionally


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2588 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 20:51:39 +00:00
David Lawrence Ramsey 8fda94246b remove erroneous if block in update_history() preventing the history
list position from being properly moved to the bottom in some cases


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2587 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 20:18:46 +00:00
David Lawrence Ramsey 1addd601bc really fix bad #ifdefs; history functions are left out when NANO_SMALL
is defined, and history saving and loading functions are left out when
NANO_SMALL is defined and/or ENABLE_NANORC isn't defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2586 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 19:28:30 +00:00
David Lawrence Ramsey 47ae0d764e remove now-unnecessary null_at()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2583 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 14:30:52 +00:00
David Lawrence Ramsey 34bdc35d94 readd tab completion of history strings, with a few minor tweaks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2577 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 18:41:31 +00:00
David Lawrence Ramsey 95778fda70 fix mismatched #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 02:27:12 +00:00
David Lawrence Ramsey e0b55138b9 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2572 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 17:35:11 +00:00
David Lawrence Ramsey e3970f503c replace all instances of strncpy() with charcpy(), since the only
difference between them is that the former pads strings with nulls when
they're longer than the number of characters specified, which doesn't
appear to be used anywhere


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2542 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 03:47:24 +00:00
David Lawrence Ramsey 16f88134f7 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2541 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 03:32:41 +00:00
David Lawrence Ramsey 8b3266e83c fix inaccurate comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 02:46:42 +00:00