Closed nisargjhaveri closed 7 years ago
Thanks for your issue report! We'll look into it.
I think this is causing the problem. I don't know if it is required any longer or for backward compatibility, but removing that and adding activatePane: false
to options for atom.workspace.open
seems to work for me.
Hope this helps! :)
@nisargjhaveri Thanks doing some research. The texPane.activate
is needed to ensure the right split, especially when using multiple jobs. I'll investigate and see if I can come up with a combination of settings that work for both cases.
One more observation. Just adding activatePane: false
to options for atom.workspace.open
seems to work, without removing texPane.activate
also. Only problem is that, if the pane is not already open, then the editor loses focus.
I got to playing with again because I noticed some other problem. It doesn't forward sync properly. It just goes to the page in PDF and doesn't scroll to the actual content location. This probably is unrelated, but just pointing out just in case.
I was looking more into it.
From what I understand markdown-preview
does the following.
It stores the previously active pane with previousActivePane = atom.workspace.getActivePane()
and then after opening new pane, it does previousActivePane.activate()
. See, https://github.com/atom/markdown-preview/blob/master/lib/main.coffee#L82-L89
Adding the first line after line 8 and second line at line 23 seems to work for me nice, for both the case, if the pane is already open or if it is not. I don't think I know enough cases to test it and send a PR.
@nisargjhaveri I've integrated your suggestions into #416. So far it doesn't look like it breaks any existing functionality.
@nisargjhaveri Thanks for all your hard work on this issue! We really appreciate the help :bowing_man:
No problem! Happy it got resolved! :D
I have "Open Result in Background" option ticked and I've selected "Opener" to be
pdf-view
and "Pdf View Split Direction" toright
. I also have "Build in save" and "Open Result after Successful Build" ticked.It correctly builds the PDF on save and opens it in the right panel, but the focus now is on the PDF and not on the editor pane. Which means I have to manually focus the edit pane every time I press
ctrl+s
.I believe "Open Result in Background" means that this should not happen and after opening the PDF in right pane, the focus should be retained at the editor pane.
latex
version installed is0.46.0