-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multibyte / locale and ignore support #49
base: master
Are you sure you want to change the base?
Conversation
This is gonna take a bit longer than expected, as (In addition to multibyte, another way column counting may break is... control characters in linebuf. editline now correctly show them in caret-escape form, so despite them being one byte they take 2 columns.) The mblen thing, on the other hand, might be a bit easier to deal with now. I figured instead of the 100% correct left-to-right approach (parse the whole string), I can go right to left without breaking too many non-self-synchonizing legacy encodings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far.
[East Asian ambiguous]: http://www.unicode.org/reports/tr11/tr11-38.html | ||
|
||
The input handling is not yet multibyte-aware. Specifically, the presence of | ||
non-self-synchonizing encodings requires always segmenting the whole string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/synchonizing/synchronizing/ maybe?
@@ -125,6 +125,9 @@ extern void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhand | |||
extern void rl_callback_read_char (void); | |||
extern void rl_callback_handler_remove (void); | |||
|
|||
#define RL_PROMPT_START_IGNORE '\1' | |||
#define RL_PROMPT_END_IGNORE '\2' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor indent level issue?
@@ -61,6 +61,9 @@ AC_ARG_ENABLE(terminal-bell, | |||
AC_ARG_ENABLE(termcap, | |||
AS_HELP_STRING([--enable-termcap], [Use termcap library to query terminal size.])) | |||
|
|||
AC_ARG_ENABLE(locale, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer for this to be enabled by default, since that's what ppl expect, and detect capability and fall-back to non-utf-8 capable.
Why hasn't this been merged |
@mcfriend99 because it's unfinished? Op clearly states "This PR, when completed ..." and "This is gonna take a bit longer than expected ...", not to mention the unaddressed review comments of mine that are yet to be resolved. |
This PR, when completed, shall close #37 and close #48. The handling for multibyte in the prompt is done, but not for the input.