commit 0c274cd8431ee0e443f75ffa2213d7ac7342ac62
parent ae5348e49603ee20b377e13f6735cf47038297dd
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date: Sat, 2 Apr 2011 03:28:35 +0200
Tiny change solves the matter with tabs after the fist vline
Diffstat:
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/TODO b/TODO
@@ -7,7 +7,6 @@ In no particular order, at sandy.c:
- Smart end? is it really needed?
- Scroll windows with wscrl?
- BUG: high CPU usage on continuous resize
-- BUG: tab characters after first vline
- BUG: Deal with the bigger-than-window line
- Improve regex search (backwards!!)
- Improve syntax highlight, multiline?
diff --git a/config.mk b/config.mk
@@ -1,5 +1,5 @@
# sandy version
-VERSION = 0.4
+VERSION = 0.5
# Customize below to fit your system
diff --git a/sandy.c b/sandy.c
@@ -1042,7 +1042,7 @@ i_scrtofpos(int x, int y) {
pos.l=l;
pos.o=0;
while(x>(ivchar%cols) || (ivchar/cols)<ixrow) {
- ivchar+=VLEN(l->c[pos.o], ivchar%cols);
+ ivchar+=VLEN(l->c[pos.o], ivchar%(cols-1));
pos.o++;
}
if(pos.o>pos.l->len) pos.o=pos.l->len;
@@ -1270,7 +1270,7 @@ i_update(void) {
if(l && ichar<l->len) {
if(l->c[ichar] == 0x09) { /* Tab nightmare */
wattrset(textwin, textattrs[SpcFG][ibg]);
- for(i=0; i<VLEN(0x09, ivchar%cols); i++) waddstr(textwin, ((i==0 && isutf8)?tabstr:" "));
+ for(i=0; i<VLEN(0x09, ivchar%(cols-1)); i++) waddstr(textwin, ((i==0 && isutf8)?tabstr:" "));
} else if(l->c[ichar] == ' ') { /* Space */
wattrset(textwin, textattrs[SpcFG][ibg]);
waddstr(textwin, (isutf8?spcstr:" "));
@@ -1286,7 +1286,7 @@ i_update(void) {
} else {
waddch(textwin, l->c[ichar]);
}
- ivchar+=VLEN(l->c[ichar], ivchar%cols);
+ ivchar+=VLEN(l->c[ichar], ivchar%(cols-1));
if(isutf8 && !ISASCII(l->c[ichar]) && i) ichar+=i; /* ...here */
else ichar++;
} else {
@@ -1586,7 +1586,7 @@ main(int argc, char **argv){
i++;
break;
} else if(!strcmp(argv[i], "-v"))
- i_die("sandy-"VERSION", © 2010 sandy engineers, see LICENSE for details\n");
+ i_die("sandy-"VERSION", © 2011 sandy engineers, see LICENSE for details\n");
else
i_usage();
}