From af919c3f9c82595e18d50c6159179194be3e4312 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Tue, 5 May 2015 12:17:56 +0800 Subject: [PATCH] ^X= buffer-position displays EOL character as \r for DOS. Number of characters in file is also reported correctly. --- random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random.c b/random.c index 1764282..2ecc43a 100644 --- a/random.c +++ b/random.c @@ -101,13 +101,13 @@ int showcpos(int f, int n) predchars = numchars + curwp->w_doto; len = llength( lp) ; if( (curwp->w_doto) == len) - curchar = '\n'; + curchar = (curbp->b_mode & MDDOS) ? '\r' : '\n' ; else bytes = utf8_to_unicode( lp->l_text, curwp->w_doto, len, &curchar) ; } /* on to the next line */ ++numlines; - numchars += llength(lp) + 1; + numchars += llength( lp) + ((curbp->b_mode & MDDOS) ? 2 : 1) ; lp = lforw(lp); }