-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 editor onFocusChanged event to update active editor when switching editors #9013
Conversation
Signed-off-by: odelia <odelia.zehavi@sap.com>
My testing reveals the following behavior:
I believe 1. and 3. are incorrect, and 4. may or may not be desirable - the other icons appear regardless of whether the editor is focused - but @avishaik will need to weigh in on whether the intended behavior is that the icon should only appear when the editor is focused, or any time a JSON editor is open and visible. |
@colin-grant-work, did you update the when statement in the package.json before creating the extension? |
@odeliat, Thanks for the reminder, I hadn't updated the In Theia, we still get no toolbar icon in that case: I'm not sure it's desirable to require that plugins that might be used in Theia add |
@colin-grant-work The VSCode behavior is different than Theia. My code suggestion is to trigger the active editor to the correct one when the cursor is in the same position. |
@odeliat, I agree your code fixes the specific problem of failure to update the focused editor, so I'm fine merging this as long as we track the remaining cases where Theia's behavior deviates from VSCode in handling editor-related |
Signed-off-by: odelia odelia.zehavi@sap.com
What it does
Fixes: #9042
Relates to: #8921
When we split 2 editors side by side and switch between them leaving the cursor in the same spot the focus doesn't update.
On the editor-widget.ts we have an event onSelectionChanged but when the cursor doesn't change it won't fire
packages\editor\src\browser\editor-widget.ts:
I added the onFocusChanged event to update
this.selectionService.selection
also on focus change.How to test
I used the extension from the bug report.
The extension add a button on the editor/title when the file is .json
We need to change the when statement in the package.json to show the button only on files that under the page folder.
Review checklist
Reminder for reviewers