[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] utf-8 and vile 9.61
From: |
Thomas Dickey |
Subject: |
Re: [vile] utf-8 and vile 9.61 |
Date: |
Wed, 19 Mar 2008 19:06:59 -0400 (EDT) |
On Wed, 19 Mar 2008, Thomas Dickey wrote:
On Wed, 19 Mar 2008, Chris G wrote:
If I edit a file with vile and enter pound characters it doesn't work
properly, vile gets its cursor positioning confused and the characters
actually written to file are not utf-8 pound characters.
I see the general problem of the positioning: when vile reads the UTF-8
characters that correspond to the Latin-1 range, it has to decide if they can
be represented as single-column characters. That's working fine on
_display_, but there's a bug in the keyboard part of it, so it's moving the
cursor as if it is really a multibyte character (will fix...).
Here's the fix - vile now has functions for inserting/deleting either
_bytes_ or _characters_:
diff -u -r1.160 insert.c
--- insert.c 2008/01/13 15:59:30 1.160
+++ insert.c 2008/03/19 22:57:50
@@ -429,7 +429,7 @@
if (isbackspace(c)) { /* vi beeps here */
s = TRUE; /* replaced with nothing */
} else {
- t = s = lins_bytes(n, c);
+ t = s = lins_chars(n, c);
}
}
}
@@ -884,7 +884,7 @@
}
autoindented = -1;
- return lins_bytes(1, c);
+ return lins_chars(1, c);
}
#if ! SMALLER
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net