tvi: o and O for empty buffers - neatvi - [fork] simple vi-type editor with UTF… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 4b7eb1d70cfc9a1ac8d1bd602d461b60f40ba3f5 | |
parent c3ab582a5343baa7caccc526f432318eca7e9eb5 | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Thu, 7 May 2015 23:00:42 +0430 | |
vi: o and O for empty buffers | |
Diffstat: | |
M vi.c | 2 ++ | |
1 file changed, 2 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/vi.c b/vi.c | |
t@@ -499,6 +499,8 @@ static void vc_insert(int cmd) | |
pref = ln ? uc_sub(ln, 0, off) : uc_dup(""); | |
post = ln ? uc_sub(ln, off, -1) : uc_dup("\n"); | |
rep = led_input(pref, post, &row, &col); | |
+ if ((cmd == 'o' || cmd == 'O') && !lbuf_len(xb)) | |
+ lbuf_put(xb, 0, "\n"); | |
if (rep) { | |
if (cmd != 'o' && cmd != 'O') | |
lbuf_rm(xb, xrow, xrow + 1); |