diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2013-03-25 11:41:45 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2013-03-25 11:41:45 +0000 |
commit | 98fa97bb051198f5534ce2012a7c723f9c9d3ed1 (patch) | |
tree | 89286b13a39fba00d04687348c4009791f2e3333 /usr.bin/mg | |
parent | 2e8a964a090864ca5dd7930f1568ca58f9f8c24b (diff) |
Display the window's column number in mode line not the
column number of the active window.
OK jasper@
Diffstat (limited to 'usr.bin/mg')
-rw-r--r-- | usr.bin/mg/util.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mg/util.c b/usr.bin/mg/util.c index ecf84087c85..1ac19cdba03 100644 --- a/usr.bin/mg/util.c +++ b/usr.bin/mg/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.31 2012/05/18 02:13:44 lum Exp $ */ +/* $OpenBSD: util.c,v 1.32 2013/03/25 11:41:44 florian Exp $ */ /* This file is in the public domain. */ @@ -68,12 +68,12 @@ showcpos(int f, int n) /* NOSTRICT */ ratio = nchar ? (100L * cchar) / nchar : 100; ewprintf("Char: %c (0%o) point=%ld(%d%%) line=%d row=%d col=%d", - cbyte, cbyte, cchar, ratio, cline, row, getcolpos()); + cbyte, cbyte, cchar, ratio, cline, row, getcolpos(curwp)); return (TRUE); } int -getcolpos(void) +getcolpos(struct mgwin *wp) { int col, i, c; char tmp[5]; @@ -81,11 +81,11 @@ getcolpos(void) /* determine column */ col = 0; - for (i = 0; i < curwp->w_doto; ++i) { - c = lgetc(curwp->w_dotp, i); + for (i = 0; i < wp->w_doto; ++i) { + c = lgetc(wp->w_dotp, i); if (c == '\t' #ifdef NOTAB - && !(curbp->b_flag & BFNOTAB) + && !(wp->w_bufp->b_flag & BFNOTAB) #endif /* NOTAB */ ) { col |= 0x07; |