[201_2977] fix: trap-state condition in insert session transition (#2977)#2980
Open
Prashant27-07 wants to merge 5 commits intoMoganLab:mainfrom
Open
[201_2977] fix: trap-state condition in insert session transition (#2977)#2980Prashant27-07 wants to merge 5 commits intoMoganLab:mainfrom
Prashant27-07 wants to merge 5 commits intoMoganLab:mainfrom
Conversation
Contributor
|
Please add a documentation and a PR number, just like other PRs. |
Contributor
Author
|
@JackYansongLi Updated PR description and added devel/201_2977.md documentation. Please review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the trap-state condition that occurs during insert session transition.
The issue happens because the editor can remain in completion/input mode after generating the session completion command.
This patch explicitly resets the editor state by calling
set_input_normal()before returning the completion command insession_complete_command.This ensures the editor safely transitions back to normal mode and avoids getting stuck in an unintended input state.
What
When closing an insert session (e.g. Python session), the editor was stuck and could not transition from Insert Mode back to Normal Mode.
Why
The exit signal was not being handled correctly during the insert session transition, causing a trap-state where the program could not escape Insert Mode.
How
Fixed the session transition logic so that upon receiving an exit signal, the editor correctly exits the session and returns to Normal Mode.
How to test
Fixes #2977