[Toybox] generic editor code (was [Patch] - adding '-B' to grep)

ibid.ag at gmail.com ibid.ag at gmail.com
Tue Dec 24 10:41:39 PST 2013


On Tue, Dec 24, 2013 at 01:18:46PM +1000, David Seikel wrote:
> > 
> > I note that patch does something really similar to this. Maintaining 
> > these kind of line buffers is something we've got code and there
> > might be some opportunities for code sharing. I'll have to look...
> 
> This is why I wanted to include sed as one of the various editors I
> wanted to support in my generic editor code.  Less, grep, sed, vi,
> emacs, etc. all need to deal with line buffers.  s/foo/bar/g works in
> most of the editors, including sed.  Lots and lots of common code
> there.  Still on my TODO list to cut it down into easier to digest
> bits for you, which is like your TODO, it runneth over, several times.
> 
FYI, there are a few small build fixes I needed:

diff --git a/boxes.c b/boxes.c
index 5945308..2eb1308 100644
--- a/boxes.c
+++ b/boxes.c
@@ -35,11 +35,11 @@ config BOXES
 */
 
 #include "toys.h"
-#include "toynet.h"
 
-DEFINE_GLOBALS(
+GLOBALS(
 	char *mode;
-	long h, w;
+	long h;
+	long w;
 	// TODO - actually, these should be globals in the library, and leave this buffer alone.
 	int stillRunning;
 	int overWriteMode;

But for reasons unknown to myself, boxes does not seem to ever exit
(apart from Ctrl-C; tested with joe and vi modes), I get the impression it 
doesn't save, and vi never clears the ":" once you run a command of that
sort.  I'd suspect it got stuck in ex mode, but since none of the
commands have an effect I can't tell...
Is that expected behavior at this point?

Thanks,
Isaac Dunham


 1387910499.0


More information about the Toybox mailing list