Commit Graph

58 Commits (385e772e543e0a32f04f807a3e2c41855d713ed3)

Author SHA1 Message Date
David Lawrence Ramsey ab8c7162d3 in do_cut_text(), when uncutting text in the process of copying it,
always set placewewant, as do_uncut_text() does, so that the current
line is always updated properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3907 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-16 19:44:13 +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 bac8908814 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3664 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-18 15:26:51 +00:00
David Lawrence Ramsey ee995b7d27 fix screen update problem when copying the last line on the screen with
the mark off and CUT_TO_END set to FALSE


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3663 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-06-18 15:21:11 +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 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 41b8972dc9 various miscellaneous cutting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-21 20:03:43 +00:00
David Lawrence Ramsey 0547f51816 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-11 11:13:54 +00:00
David Lawrence Ramsey 08f16e2fc7 in free_chararray(), assert that array isn't NULL, for consistency with
the other free_.*() functions; also fix potential memory corruption
problem when copying text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3500 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-11 01:53:33 +00:00
David Lawrence Ramsey c208ef7f23 fix breakage when NO_NEWLINES is FALSE and we copy text that would
require adding a new magicline then


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3440 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-26 19:03:50 +00:00
David Lawrence Ramsey 7504714882 fix segfault if we try to copy an empty selection
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3432 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-25 02:56:54 +00:00
David Lawrence Ramsey 714c522413 add missing #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3431 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-25 02:40:58 +00:00
David Lawrence Ramsey c87e0c0965 add the ability to copy text into the cutbuffer without cutting it, via
Meta-^ (Meta-6); note that this is disabled when NANO_TINY is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3429 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-25 02:23:28 +00:00
David Lawrence Ramsey 9ea05902ec comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3422 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-04-24 19:44:04 +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 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 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 aa20fcf7b0 remove unneeded blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-13 07:05:37 +00:00
David Lawrence Ramsey 53bd1ddad7 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3120 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 02:23:54 +00:00
David Lawrence Ramsey 212ab782df simplify cut_line() further
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3119 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 02:13:07 +00:00
David Lawrence Ramsey a016d1939d comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3117 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 00:25:30 +00:00
David Lawrence Ramsey b387137af7 in cut_line(), since placewewant will always be zero after the line is
cut, set it to zero directly instead of assigning it the value of
xplustabs()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3116 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-09 00:23:12 +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 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 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 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 6e925cf330 update the Free Software Foundation's mailing address in various
comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2510 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-15 19:57:17 +00:00
David Lawrence Ramsey 02173c05dc in cut_line(), set placewewant properly after cutting a line, to avoid a
problem where the screen won't be updated if (a) we're not on the first
page when we cut the line, and (b) immediately after we cut the line, we
hit End to move to the end of the line after it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2504 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 18:41:25 +00:00
David Lawrence Ramsey e527e458f4 various #include fixes: since proto.h includes nano.h, only include the
former in source files; also add an #include guard to proto.h, and make
the config.h #include in nano.h match the config.h #includes everywhere
else


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2471 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-15 18:07:26 +00:00
David Lawrence Ramsey b80d49f071 make sure that all references to cut-to-end are left out when NANO_SMALL
is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-26 22:49:46 +00:00
David Lawrence Ramsey c8857a2c26 in cut_to_eol(), fix an inaccurate comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2425 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-25 06:24:13 +00:00
David Lawrence Ramsey 295d172f2d implement cutting from the current position to the end of the file,
using Ctrl-X from the search prompt and Meta-T from the edit window;
also update the copyright years of more modified files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-01 07:43:32 +00:00
David Lawrence Ramsey eeec999548 oops again; adding an extra magicline unconditionally when uncutting is
inconsistent with how file insertion behaves, so it apparently is a bug;
revert the previous behavior


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2131 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-24 20:12:57 +00:00
David Lawrence Ramsey cc89513f14 oops; Pico's adding a new magicline unconditionally when uncutting
leaves the cursor on the current magicline is actually consistent (and
hence not a bug), so duplicate that behavior again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2130 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-23 23:42:12 +00:00
David Lawrence Ramsey 4d6ec37676 in do_cut_text(), if keep_cutbuffer is FALSE, only blow away the text in
the cutbuffer if the cutbuffer isn't empty


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-23 17:59:32 +00:00
David Lawrence Ramsey 93c8405bfa overhaul the cutting and uncutting routines and the justify-related
routines to back up and restore unjustified text to use the partitioning
code, as it greatly simplifies how they work; also back up and restore
unjustified text in its own buffer instead of the cutbuffer, and add a
few minor bug fixes to the overhauled routines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2124 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-23 04:08:28 +00:00
Jordi Mallach 55381aa614 Include <config.h> only if HAVE_CONFIG_H.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2107 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-17 23:17:05 +00:00
David Lawrence Ramsey 649b431171 in cut_marked_segment(), respect concatenate_cut, as we need to use it
if we do a marked cut and immediately follow it with a cut-to-end (which
uses that function)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2095 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-13 01:32:17 +00:00
David Lawrence Ramsey bfb98f8bd4 in do_cut_text(), set concatenate_cut to TRUE unconditionally when doing
a marked cut; this fixes an incompatibility with Pico where an extra
line is uncut if we do a marked cut that includes the magicline and
immediately follow it with an unmarked cut


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2094 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-12 21:46:14 +00:00
David Lawrence Ramsey fd9da07e6c fix enum/#define conflict
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2086 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-07 23:05:48 +00:00
David Lawrence Ramsey 7105cf4f8e formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2081 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-07 16:13:19 +00:00
David Lawrence Ramsey 00cca05ebb in do_uncut_text(), maintain current_y's value when uncutting blocks so
that smooth scrolling works correctly; also add a few miscellaneous
cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2075 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-06 20:33:43 +00:00
David Lawrence Ramsey 90e59c1a18 when doing marked spell-check, properly handle the case where the mark
ends in the middle of a word and that word is spell-checked; also move
the logic to detect an upside-down mark to mark_order() instead of using
the same logic in three different places, and rename a few variables for
consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2070 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-05 23:03:03 +00:00
David Lawrence Ramsey 07e2589f80 in cut.c, make marked_line a static enum instead of a static int, and
add a few formatting cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2056 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-04 13:47:28 +00:00
David Lawrence Ramsey 7a97e18667 make current_x a size_t instead of an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2034 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-30 01:03:15 +00:00
David Lawrence Ramsey ace1037faf cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2032 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-29 15:42:02 +00:00
David Lawrence Ramsey e5d8f32834 add a bunch of key-related fixes: put Meta-( (Meta-9), Meta-) (Meta-0),
and Meta-J back in the shortcut list since Meta-G is used in the file
browser and not as a toggle, tweak nanogetstr() and statusq() so that
resetstatuspos can be reduced to a static bool, change the names of some
keys to be more consistent, and add the ^R^X^X and ^W^T^T shortcuts
(note that the latter doesn't preserve the contents of the statusbar yet
when ^T is pressed at the "Go To Line" prompt), and add a few other
miscellaneous tweaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1954 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-30 22:07:21 +00:00
David Lawrence Ramsey 82dc1c17f2 add more int -> bool conversions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1893 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 03:27:54 +00:00