This is my latest patch to add 'u' (Undo) command support to BusyBox vi and it
is a major improvement over the previous two.

Improvements over v2:
* Seems to work with all editing functions I could test
* Find-and-replace undo now works; can reverse e.g. :1,3 s/foo/bar/
* Friendly constants for undo flags (UNDO_INS, ALLOW_UNDO, etc.)
* Removed dot_delete() (was only calling another function and only used once)
* Proper #if/#else/#endif (builds without undo don't waste a parameter now)
* Patch also uses file_modified in a MUCH more logical/sane manner

Tested on x86_64, probably works everywhere though. On x86_64, it only weighs in
at +1266 bytes of text with no change in data/bss. I feel that this patch is
largely complete; however, I would like to eventually implement some form of
input grouping so that it doesn't malloc() twice for every single action taken
including a single character being typed within insert mode (and it doubles for
replace mode), which is the biggest problem I can see. Fortunately, it is
unlikely that this will exhaust memory on systems with even a modest amount of
RAM.

I am very happy to be able to contribute something of value to BusyBox! :-)

Signed-off-by: Jody Bruchon <j...@jodybruchon.com>

Attachment: busybox_vi_undo_v3.patch
Description: Binary data

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to