mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-112105: Make completer delims work on libedit (gh-112106)
This commit is contained in:
parent
ac4b44266d
commit
2df26d8348
3 changed files with 37 additions and 0 deletions
|
|
@ -592,6 +592,13 @@ readline_set_completer_delims(PyObject *module, PyObject *string)
|
|||
if (break_chars) {
|
||||
free(completer_word_break_characters);
|
||||
completer_word_break_characters = break_chars;
|
||||
#ifdef WITH_EDITLINE
|
||||
rl_basic_word_break_characters = break_chars;
|
||||
#else
|
||||
if (using_libedit_emulation) {
|
||||
rl_basic_word_break_characters = break_chars;
|
||||
}
|
||||
#endif
|
||||
rl_completer_word_break_characters = break_chars;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
@ -1309,6 +1316,15 @@ setup_readline(readlinestate *mod_state)
|
|||
completer_word_break_characters =
|
||||
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||
/* All nonalphanums except '.' */
|
||||
#ifdef WITH_EDITLINE
|
||||
// libedit uses rl_basic_word_break_characters instead of
|
||||
// rl_completer_word_break_characters as complete delimiter
|
||||
rl_basic_word_break_characters = completer_word_break_characters;
|
||||
#else
|
||||
if (using_libedit_emulation) {
|
||||
rl_basic_word_break_characters = completer_word_break_characters;
|
||||
}
|
||||
#endif
|
||||
rl_completer_word_break_characters = completer_word_break_characters;
|
||||
|
||||
mod_state->begidx = PyLong_FromLong(0L);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue