Skip to content

Avoid closing preview panel when file switching #520

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

Merged
merged 2 commits into from
May 1, 2022

Conversation

OlivierCavadenti
Copy link
Contributor

@OlivierCavadenti OlivierCavadenti commented Apr 3, 2022

When we switch files with ANTLR4 preview panel, it's closed.
Now with this commit, we never close preview panel.
Each grammar have his preview conserved.
I keep it very simple (only remove hide previews calls), say me if we need more complex logic.

Resolve #409

@parrt
Copy link
Member

parrt commented Apr 15, 2022

Hi! What happens when you switch away from a grammar file though? Does it still show the preview? I think I remember that causing all sorts of issues because events are sent but we don't have a visible grammar to pull data from.

@parrt
Copy link
Member

parrt commented Apr 23, 2022

ping @OlivierCavadenti

@@ -278,11 +278,9 @@ public void currentEditorFileChangedEvent(VirtualFile oldFile, VirtualFile newFi
}
if ( newFile.getName().endsWith(".g") ) {
LOG.info("currentEditorFileChangedEvent ANTLR 4 cannot handle .g files, only .g4");
hidePreview();
Copy link
Member

Choose a reason for hiding this comment

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

probably should leave this one in. I can fix.

@parrt parrt added this to the 1.19 milestone Apr 29, 2022
@parrt
Copy link
Member

parrt commented Apr 29, 2022

It works well, actually! I can replicate easilly, but @OlivierCavadenti could you update your commit to use git -s to sign?

@OlivierCavadenti
Copy link
Contributor Author

It works well, actually! I can replicate easilly, but @OlivierCavadenti could you update your commit to use git -s to sign?

Hi, I just do it now, sorry for the delay by the way.

@parrt
Copy link
Member

parrt commented May 1, 2022

Hi! I think it's still has an issue with the "signature" on the commit: https://github.com/antlr/intellij-plugin-v4/pull/520/checks?check_run_id=6238810717

@parrt
Copy link
Member

parrt commented May 1, 2022

It's only one line and I can make the change if you want in my fork but I thought it would be good to give you credit for the PR :)

When we switch files with ANTLR4 preview panel opened, it's closed.
Now with this commit, we never close preview panel.
Each grammar have his preview conserved.

Signed-off-by: Olivier Cavadenti <[email protected]>
Signed-off-by: Olivier Cavadenti <[email protected]>
@OlivierCavadenti OlivierCavadenti force-pushed the avoid-closing-preview branch from 008078e to 85613b1 Compare May 1, 2022 19:39
@parrt
Copy link
Member

parrt commented May 1, 2022

awesome. thanks!

@parrt parrt merged commit 1f36fde into antlr:master May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "pin" feature to ANTLR Preview
2 participants