mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-21 00:26:27 -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 */
|
int numlines; /* # of lines in file */
|
||||||
long predchars; /* # chars preceding point */
|
long predchars; /* # chars preceding point */
|
||||||
int predlines; /* # lines preceding point */
|
int predlines; /* # lines preceding point */
|
||||||
int curchar; /* character under cursor */
|
unicode_t curchar ; /* character under cursor */
|
||||||
int ratio;
|
int ratio;
|
||||||
int col;
|
int col;
|
||||||
int savepos; /* temp save for current offset */
|
int savepos; /* temp save for current offset */
|
||||||
@ -91,12 +91,15 @@ int showcpos(int f, int n)
|
|||||||
while (lp != curbp->b_linep) {
|
while (lp != curbp->b_linep) {
|
||||||
/* if we are on the current line, record it */
|
/* if we are on the current line, record it */
|
||||||
if (lp == curwp->w_dotp) {
|
if (lp == curwp->w_dotp) {
|
||||||
|
int len ;
|
||||||
|
|
||||||
predlines = numlines;
|
predlines = numlines;
|
||||||
predchars = numchars + curwp->w_doto;
|
predchars = numchars + curwp->w_doto;
|
||||||
if ((curwp->w_doto) == llength(lp))
|
len = llength( lp) ;
|
||||||
|
if( (curwp->w_doto) == len)
|
||||||
curchar = '\n';
|
curchar = '\n';
|
||||||
else
|
else
|
||||||
curchar = lgetc(lp, curwp->w_doto);
|
(void) utf8_to_unicode( lp->l_text, curwp->w_doto, len, &curchar) ;
|
||||||
}
|
}
|
||||||
/* on to the next line */
|
/* on to the next line */
|
||||||
++numlines;
|
++numlines;
|
||||||
|
Loading…
Reference in New Issue
Block a user