[Toybox] [PATCH] vi.c: added v command, updated help text, Fixed memory leak in 'g' command

Rob Landley rob at landley.net
Tue Oct 17 02:45:45 PDT 2023


On 10/16/23 22:29, Oliver Webb wrote:
>> I was hoping to get stuff to share code, but I can worry about that in the
>> eventual cleanup pass.
> 
> If you are planning on code-sharing the regex line substitution stuff.
> Then this will probably be my last patch to vi.c for a while 
> (Unless there is something wrong with it that can be fixed reasonably).

"Planning" is a strong word. I would generally like code to be shared in the
toybox when that isn't hard to do, but I haven't evaluated how hard it is to do
here.

Elsewhere, I'm 3/4 of the way to convincing myself to just add hd/hexdump as a
fourth implementation of the same darn thing, because hexedit, xxd, and od
aren't really set up to share code with each other and neither of them is an
obvious base for hd either. The perfect is the enemy of the good and all that...

> I have removed some of the overhead to minimize throughput, Replacing "run_vi_cmd("j")" 
> with "cur_down(1, 1, 0)" The page clearing function calls with setting vi_mov_flag, etc. 

The person who ISN'T currently doing work shouldn't stand in the way of somebody
who's got momentum. You've built some familiarity with the vi codebase and seem
to be doing good things with it, I have no intention of stopping you, and I've
applied your patch.

Thanks,

Rob


More information about the Toybox mailing list