mirror of
https://github.com/rfivet/uemacs.git
synced 2025-01-03 06:56:29 -05: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) {
|
||||
unicode_t c ;
|
||||
boolean eof_f = FALSE ;
|
||||
|
||||
assert( !(curbp->b_mode & MDVIEW)) ;
|
||||
|
||||
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 ;
|
||||
|
||||
if( curwp->w_doto == len) { /* at end of line */
|
||||
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 */
|
||||
ldelchar( 1, FALSE) ;
|
||||
backchar( FALSE, 1) ;
|
||||
forwchar( FALSE, 1) ;
|
||||
if( len == 1)
|
||||
linsert_byte( 1, c) ;
|
||||
else
|
||||
linsert( 1, c) ;
|
||||
|
||||
if( eof_f == TRUE)
|
||||
forwchar( FALSE, 1) ;
|
||||
|
||||
lchange( WFEDIT) ;
|
||||
return TRUE ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user