CodeEdit icon indicating copy to clipboard operation
CodeEdit copied to clipboard

🐞 File opened via "Open In Tab" should be selected in Project Navigator

Open dscyrescotti opened this issue 1 year ago • 6 comments

Description

If a file is opened through "Open In Tab", the file is not selected in Project Navigator and it still highlights the previous file (if there is a file opened by manual click) even though the new tab opens file.

To Reproduce

  1. Open the app
  2. Select a file in Project Navigator by clicking on it (you can skip it)
  3. Then open file using "Open In Tab" menu

Expected Behavior

The expected behavior should be to highlight the file opened via "Open In Tab" in Project Navigation.

Version Information

CodeEdit: 0.0.3-alpha.32 macOS: 13.3.1 Xcode: Version 14.3 (14E222b)

Additional Context

No response

Screenshots

https://github.com/CodeEditApp/CodeEdit/assets/67727096/c677b4bc-2c4b-430b-8ed8-e26da12fb3c4

dscyrescotti avatar Jun 03 '23 03:06 dscyrescotti

After digging out the bug, I found that the Project Navigator highlights the file opened via "Open In Tab" as soon as the window is no longer active.

https://github.com/CodeEditApp/CodeEdit/assets/67727096/162bf97f-5657-4417-bb91-0ff21f0cfae9

dscyrescotti avatar Jun 03 '23 03:06 dscyrescotti

@dscyrescotti good find! Thanks for bringing that to our attention!

@Wouter01 i wonder if it is related to this. I will check if this still happens in that branch.

austincondiff avatar Jun 03 '23 03:06 austincondiff

@dscyrescotti good find! Thanks for bringing that to our attention!

@Wouter01 i wonder if it is related to this. I will check if this still happens in that branch.

I think it's somewhere inside the outlineview where it doesn't get some kind of event, but I haven't had a look at it

Wouter01 avatar Jun 03 '23 10:06 Wouter01

@Wouter01 yes it's indeed with the outlineview which doesn't update properly when tab is changed. So, it causes state inconsistency between the outlineview and active tab group. After a long investigation, I figured out to fix it by explicitly adding a listener to active tab group for the outlineview.

dscyrescotti avatar Jun 04 '23 03:06 dscyrescotti

@dscyrescotti is this fixed with #1296?

thecoolwinter avatar Jun 24 '23 05:06 thecoolwinter

Yes, the fix was already included on that PR.

dscyrescotti avatar Jun 24 '23 06:06 dscyrescotti

Awesome!

thecoolwinter avatar Jul 01 '23 15:07 thecoolwinter