mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 23:36:23 -05:00
Insure correct UTF-8 encoding: asc( chr( 0x800)) == 0x800.
buffer-position displays unicode value of character under cursor instead of first byte of unicode sequence.
This commit is contained in:
parent
4cbf1e9ae1
commit
2cef071492
9
random.c
9
random.c
@ -73,7 +73,7 @@ int showcpos(int f, int n)
|
||||
int numlines; /* # of lines in file */
|
||||
long predchars; /* # chars preceding point */
|
||||
int predlines; /* # lines preceding point */
|
||||
int curchar; /* character under cursor */
|
||||
unicode_t curchar ; /* character under cursor */
|
||||
int ratio;
|
||||
int col;
|
||||
int savepos; /* temp save for current offset */
|
||||
@ -91,12 +91,15 @@ int showcpos(int f, int n)
|
||||
while (lp != curbp->b_linep) {
|
||||
/* if we are on the current line, record it */
|
||||
if (lp == curwp->w_dotp) {
|
||||
int len ;
|
||||
|
||||
predlines = numlines;
|
||||
predchars = numchars + curwp->w_doto;
|
||||
if ((curwp->w_doto) == llength(lp))
|
||||
len = llength( lp) ;
|
||||
if( (curwp->w_doto) == len)
|
||||
curchar = '\n';
|
||||
else
|
||||
curchar = lgetc(lp, curwp->w_doto);
|
||||
(void) utf8_to_unicode( lp->l_text, curwp->w_doto, len, &curchar) ;
|
||||
}
|
||||
/* on to the next line */
|
||||
++numlines;
|
||||
|
Loading…
Reference in New Issue
Block a user