gh-87820: IDLE: fix config disabling tab completion#26421
gh-87820: IDLE: fix config disabling tab completion#26421taleinat wants to merge 1 commit intopython:mainfrom
Conversation
This removes three key bindings from the key configuration mechanism, which are required to always be bound to specific keys for IDLE to behave properly: * '<<smart-backspace>>': ['<Key-BackSpace>'], * '<<newline-and-indent>>': ['<Key-Return>', '<Key-KP_Enter>'], * '<<smart-indent>>': ['<Key-Tab>'], Signed-off-by: Tal Einat <532281+taleinat@users.noreply.github.com>
terryjreedy
left a comment
There was a problem hiding this comment.
I would like to merge the code and .def changes as are but am not quite sure that we should. See comment on the issue.
| # Bind keys to pseudoevents for non-configurable key-specific handlers. | ||
| text.event_add('<<smart-backspace>>', '<Key-BackSpace>') |
There was a problem hiding this comment.
The only function reason to keep these fixed keys separate from those that follow is that the pseudoevent -- handler bindings are done above for these and below for the existing fixed key keys. And this is related to where the handler are defined. So keep the separation for now.
| ``<<newline-and-indent>>`` (Return, Enter) and ``<<smart-backspace>>`` | ||
| (Backspace) from the configuration mechanism, making them hard-coded | ||
| instead. |
There was a problem hiding this comment.
These two are not relevant to tab completion. So it we do these together, I think we need to change the PR title (see my issue title revision) and reword this a bit.
There was a problem hiding this comment.
I'm not sure the PR/commit title must describe all of the technical changes made. The additional change to the <<newline-and-indent>> and <<smart-backspace>> bindings has negligible significance to users, since even before this change, changing these bindings breaks IDLE rather badly.
Having this detail in the NEWS entry, and possibly in the body of the commit message, seems right to me.
There was a problem hiding this comment.
To be clear, I now think that the existing PR title is good, since it describes the only significant bug being fixed.
There was a problem hiding this comment.
Today I think the title is fine as is. The message that follows can say more.
|
This PR is stale because it has been open for 30 days with no activity. |
|
This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today. |
|
This PR is stale because it has been open for 30 days with no activity. |
(Alternative PR to GH-26403.)
The underlying issue causing tab-completion to be broken after using the config dialog: Two events are bound to
<Key-Tab>:<<smart-indent>>and<<autocomplete>>. The order these are bound is important: The binding to<<autocomplete>>must be done last so that it will be invoked first. The current bug is that<<smart-indent>>is unbound and then bound again by the config dialog, which changes the order and breaks tab-completion.This PR removes three key bindings from the key configuration mechanism, which are required to always be bound to specific keys for IDLE to behave properly:
I manually verified that having a
config-keys.cfgfile in.idlercwith those keys defined in it doesn't cause any issues after this change is made. (IdleConf.GetCoreKeys()is written in a way that ensures this.)