1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-09-30 01:05:54 -04:00

buffer-position (CTL-X =) displays EOF as current character when at end of file.

This commit is contained in:
Renaud 2020-05-06 16:27:40 +08:00
parent 556ed8d41d
commit 3807410154

View File

@ -102,9 +102,7 @@ int showcpos(int f, int n)
if (curwp->w_dotp == curbp->b_linep) {
predlines = numlines;
predchars = numchars;
#if PKCODE
curchar = 0;
#endif
bytes = 0 ;
}
/* Get real column and end-of-line column. */
@ -119,9 +117,12 @@ int showcpos(int f, int n)
ratio = (100L * predchars) / numchars;
/* summarize and report the info */
mlwrite("Line %d/%d Col %d/%d Char %D/%D (%d%%) char = %s%x",
predlines + 1, numlines + 1, col, ecol,
predchars, numchars, ratio, (bytes > 1) ? "\\u" : "0x", curchar);
char fmtbuf[] = "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = %s%x" ;
if( bytes == 0)
strcpy( &fmtbuf[ 39], "EOF") ;
mlwrite( fmtbuf, predlines + 1, numlines + 1, col, ecol, predchars,
numchars, ratio, (bytes > 1) ? "\\u" : "0x", curchar) ;
return TRUE;
}