[Toybox] [PATCH] vi: various fixes.

enh enh at google.com
Tue Mar 16 22:36:11 PDT 2021


I've been using toybox vi as a makeshift "less" lately. This patch
contains all the fixes I've made...

$ should go to the last character before the newline, not the newline.

Fix ^b and ^f, and ^e and ^y (which was mistakenly ^u before, which is
also a movement key, but half of ^d/^u, neither of which we actually
implement, and neither of which I've ever used myself --- I might have
large hands, but they're not _that_ large).

Fix the display of lines longer than 1024 characters.

Fix the display of the "~"s after the end of the file, and use VT100 dim
to make it a bit more obvious that they're not actually part of the
file. Also be a bit more consistent about \033 which is the most common
way to write \x1b in toybox.

Don't show the status while in ex mode.

Make what the status is showing a little less unclear by adding a "C"
for the byte offset and file size, and add a percentage (albeit one
based on bytes rather than lines).

Fix the flickering seen on updates with the usual stupid trick of
setting a large buffer.

Handle SIGWINCH.

Add support for Home/End/PageUp/PageDown.

Remove a bit of duplication around calls to draw_page().
---
 toys/pending/vi.c | 147 +++++++++++++++++++++++++++++-----------------
 1 file changed, 92 insertions(+), 55 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210316/371ca15c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-vi-various-fixes.patch
Type: text/x-patch
Size: 9485 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210316/371ca15c/attachment-0002.bin>


More information about the Toybox mailing list