mirror of
https://github.com/rfivet/uemacs.git
synced 2024-06-10 05:50:42 +00:00
Fix twiddle movement and at EOL with single Unicode.
This commit is contained in:
parent
3d83877086
commit
cd2f848e0a
15
random.c
15
random.c
|
@ -219,30 +219,31 @@ boolean setccol( int pos) {
|
||||||
*/
|
*/
|
||||||
BBINDABLE( twiddle) {
|
BBINDABLE( twiddle) {
|
||||||
unicode_t c ;
|
unicode_t c ;
|
||||||
boolean eof_f = FALSE ;
|
|
||||||
|
|
||||||
assert( !(curbp->b_mode & MDVIEW)) ;
|
assert( !(curbp->b_mode & MDVIEW)) ;
|
||||||
|
|
||||||
int len = llength( curwp->w_dotp) ;
|
int len = llength( curwp->w_dotp) ;
|
||||||
if( len < 2 || curwp->w_doto == 0) /* at least 2 chars & not bol */
|
if( len < 2 || curwp->w_doto == 0) /* at least 2 bytes & not bol */
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
|
|
||||||
if( curwp->w_doto == len) { /* at end of line */
|
if( curwp->w_doto == len) { /* at end of line */
|
||||||
backchar( FALSE, 1) ;
|
backchar( FALSE, 1) ;
|
||||||
eof_f = TRUE ;
|
if( curwp->w_doto == 0) {
|
||||||
|
/* only one combined character on this line */
|
||||||
|
forwchar( FALSE, 1) ;
|
||||||
|
return FALSE ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backchar( FALSE, 1) ;
|
||||||
len = lgetchar( &c) ; /* len => unicode or extended ASCII */
|
len = lgetchar( &c) ; /* len => unicode or extended ASCII */
|
||||||
ldelchar( 1, FALSE) ;
|
ldelchar( 1, FALSE) ;
|
||||||
backchar( FALSE, 1) ;
|
forwchar( FALSE, 1) ;
|
||||||
if( len == 1)
|
if( len == 1)
|
||||||
linsert_byte( 1, c) ;
|
linsert_byte( 1, c) ;
|
||||||
else
|
else
|
||||||
linsert( 1, c) ;
|
linsert( 1, c) ;
|
||||||
|
|
||||||
if( eof_f == TRUE)
|
|
||||||
forwchar( FALSE, 1) ;
|
|
||||||
|
|
||||||
lchange( WFEDIT) ;
|
lchange( WFEDIT) ;
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user