version 1.8, 2002/05/30 16:07:57 |
version 1.9, 2003/05/16 19:28:59 |
|
|
*/ |
*/ |
|
|
#include "def.h" |
#include "def.h" |
|
#include <ctype.h> |
|
|
/* |
/* |
* Display a bunch of useful information about the current location of dot. |
* Display a bunch of useful information about the current location of dot. |
|
|
} |
} |
|
|
int |
int |
getcolpos() |
getcolpos(void) |
{ |
{ |
int col, i, c; |
int col, i, c; |
|
|
/* determine column */ |
/* determine column */ |
col = 1; |
col = 0; |
|
|
for (i = 0; i < curwp->w_doto; ++i) { |
for (i = 0; i < curwp->w_doto; ++i) { |
c = lgetc(curwp->w_dotp, i); |
c = lgetc(curwp->w_dotp, i); |
|
|
#endif /* NOTAB */ |
#endif /* NOTAB */ |
) { |
) { |
col |= 0x07; |
col |= 0x07; |
++col; |
col++; |
} else if (ISCTRL(c) != FALSE) |
} else if (ISCTRL(c) != FALSE) |
++col; |
col += 2; |
++col; |
else if (isprint(c)) |
|
col++; |
|
else { |
|
char tmp[5]; |
|
snprintf(tmp, sizeof tmp, "\\%o", c); |
|
col += strlen(tmp); |
|
} |
|
|
} |
} |
return col; |
return col; |
} |
} |