Skip to content

Fix typing in rename preview changes#55774

Merged
ryzngard merged 1 commit intodotnet:mainfrom
ryzngard:issues/54876_rename_modal
Aug 31, 2021
Merged

Fix typing in rename preview changes#55774
ryzngard merged 1 commit intodotnet:mainfrom
ryzngard:issues/54876_rename_modal

Conversation

@ryzngard
Copy link
Copy Markdown
Contributor

When typing in preview changes, which is a readonly text buffer, the inline rename engine was defaulting to try and commit again. This results in extra modal dialogs being open that can't be closed. Fix by checking that the open buffers contains the area that is attempting to be edited before trying to commit. For the case of the preview pane, the open buffers are tracked differently.

Fixes #54876

…uffer that is not tracked as open in the workspace. This prevents keys from being intercepted when a user tries to type in the preview window
@ryzngard ryzngard requested a review from a team as a code owner August 20, 2021 23:00
@ghost ghost added the Area-IDE label Aug 20, 2021
Comment on lines +891 to +892
internal bool IsInOpenTextBuffer(SnapshotPoint point)
=> _openTextBuffers.ContainsKey(point.Snapshot.TextBuffer);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be my lack of context, but when I read IsInOpenTextBuffer(SnapshotPoint) I think "Is this point in any open text buffer". Realistically this method is actually "Is this buffer open", so I think it would make more sense to have the parameter here be a ITextBuffer and put the .Shapshot.TextBuffer bit in the caller on line 79.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of. Technically it's "Is this point in any open buffer that is being tracked". The point is still in an open buffer, but it's tracked by a separate workspace when doing a preview.

@ryzngard ryzngard merged commit 8efaf83 into dotnet:main Aug 31, 2021
@ghost ghost added this to the Next milestone Aug 31, 2021
@ryzngard ryzngard deleted the issues/54876_rename_modal branch August 31, 2021 20:00
@dibarbet dibarbet modified the milestones: Next, 17.0.P4 Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempting to edit code in a rename preview causes inescapable modal

3 participants