Introduction
Introduction Statistics Contact Development Disclaimer Help
tex: restore xoff when switching buffers - neatvi - [fork] simple vi-type edito…
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit 1792d21d88ee1fcb629fed89d35406957cc305b3
parent ffadc288805a68e944bc6739ca3831e2c120dca0
Author: Ali Gholami Rudi <[email protected]>
Date: Mon, 6 Jul 2015 00:12:44 +0430
ex: restore xoff when switching buffers
Diffstat:
M ex.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/ex.c b/ex.c
t@@ -25,7 +25,7 @@ static struct buf {
char ft[32];
char *path;
struct lbuf *lb;
- int row;
+ int row, off;
} bufs[8];
static int bufs_find(char *path)
t@@ -56,6 +56,7 @@ static int bufs_open(char *path)
bufs[i].path = uc_dup(path);
bufs[i].lb = lbuf_make();
bufs[i].row = 0;
+ bufs[i].off = 0;
strcpy(bufs[i].ft, syn_filetype(path));
return i;
}
t@@ -76,6 +77,7 @@ static void bufs_switch(int idx)
bufs_swap(0, 1);
bufs_swap(0, idx);
xrow = bufs[0].row;
+ xoff = bufs[0].off;
}
char *ex_path(void)
t@@ -324,6 +326,7 @@ static int ec_edit(char *ec)
if (ex_expand(path, arg))
return 1;
bufs[0].row = xrow;
+ bufs[0].off = xoff;
if (arg[0] && bufs_find(path) >= 0) {
bufs_switch(bufs_find(path));
return 0;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.