[Toybox] [PATCH] vi.c: Backspace to merge lines when at beginning, get_endline is no more, cleanup

Oliver Webb aquahobbyist at proton.me
Wed Mar 6 20:31:37 PST 2024


Looking at vi.c again, (I _know_ I can write code better then I did in October, and
since the cleanup pass hasn't happened yet I thought I'd start improving things now)
noticed there was no support for merging lines when doing a backspace at the start
of a line (e.g. deleting blank lines by pressing backspace) So I added that. There
is a bug where it will delete the last character of the line you are merging into,
Still. That behavior is considerably better than nothing (And dunno how to debug it,
vi_join isn't doing it's job for some reason) so I added it into the patch.

As far as ex commands go, this patch removes the function get_endline, and replaces it with directly
probing the buffer. Which is much faster then redrawing the page 2 times.

Other then that, This replaces a couple of variable names and removes a unnecessary goto

-   Oliver Webb <aquahobbyist at proton.me>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-vi.c-Merge-with-backspace-at-beginning-of-line-suppo.patch
Type: text/x-patch
Size: 5280 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240307/0c9247c3/attachment.bin>


More information about the Toybox mailing list