Commit Graph

209 Commits (f8f90272951eb016b2e90b182291558cc34b8767)

Author SHA1 Message Date
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