-
Notifications
You must be signed in to change notification settings - Fork 391
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 option to control whether Skim gets focus upon first open #2286
Conversation
Thanks. However, I think this could be solved in a better way. Right now, the Instead, perhaps we could instead make these changes:
This would allow the configuration possibility you want in a way that seems to @clason - comments? |
I don't quite understand what the difference is to the already existing |
Ah, I didn't look into the code very thoroughly, which is probably the source of my misunderstanding — but now I see what you mean. I agree with your suggestion @lervag — it is more technically correct and that's always a good thing! I can rework this a bit later.
@clason As I understand it (and in my experience), that option only applies to forward search, not the initial compilation (with latexmk). Happy to hear any other suggestions! |
I mean, why not use the (Which reminds me that I've been meaning to try to simplify the AppleScript code -- the most recent |
That I'm not entirely sure about; after a bit of experimentation, it appears that the latexmk previewer option might not be needed, because the compiler callback opens Skim for the initial compilation anyway. With my PR, one would be able to control the initial compilation & subsequent compilations independently. (Indeed, the current default behaviour is already different, because Skim is focused initially and not subsequently.) But if that's not worth having, then it seems that it could be simplified. Not sure where |
If that is the case, I'd vote for removing that (unused?) option completely to prevent confusion.
Yes, the question is exactly whether that is desired. (Not for me, but other people may have different opinions, and those I'd like to hear.)
Yes, that is very much by design -- imagine if your editor lost focus every time you saved ;)
Yes, that is correct. My point was that "first open" and "explicit forward search" probably share much of the same desired behavior? |
Ok, good, I'm on the same page! 😄 Anyway, I renamed the option for the time being according to @lervag's comment. Feel free to ignore if you all want to move in a different direction. |
If I understand correctly, the motivation for this change is not to have Skim steal focus when first opening after a compilation? If so, my proposal would be to make a different change (not in this PR necessarily):
@lervag what is the role of the EDIT: I could combine this with the switch to JavaScript, see #2279 (comment) |
Yes - the point is that latexmk has its own feature for opening the viewer, and that VimTeX has traditionally "played nice" with this feature by passing on the necessary option to make latexmk open the correct viewer in the correct way. This would typically imply that things are more or less seamless. However, as is apparent e.g. from this issue, the result is not fully seamless, as we have things like
It's not an unreasonable proposal. But let's consider it properly. So, the idea is to generally prevent latexmk from opening the viewer and instead open the viewer from VimTeX through callbacks. The benefits:
The cons:
I don't mind having all of this implemented in #2289. So perhaps we should continue the discussion there? |
OK, I checked out #2289 and it "works for me" from the perspective of a user. When I made this PR I had in mind to not remove any configurability / break somebody's workflow, but personally, I totally don't care about having separate behaviour for compilation & forward search. Essentially, I never want Skim to be focused :-) I'll close this now and look forward to that being merged into master. Thanks for picking it up, @clason. |
Refactor the Skim viewer backend to * use JavaScript instead of AppleScript (nicer, and should fix #2279) * make the initial start respect `g:vimtex_view_skim_activate` (alternative to #2286) * factor out common script parts into script function * correct off-by-one line number for forward search * introduce new option `g:vimtex_view_skim_sync` to perform forward search after compilation (syncing viewer and editor), default false * change default for `g:vimtex_view_skim_reading_bar` to false (location is highlighted anyway on sync)
Just a tiny PR which introduces an option
g:vimtex_view_skim_activate_on_start
, to control whether Skim is brought to the foreground when it's first opened (using\ll
or\lv
). The default value is kept to1
to match the current behaviour, i.e. bring to foreground. Seems to work nicely on my Mac (Monterey 12.0 here).(Somewhat related to #180; but rather less general, because it's only Skim and hence only macOS.)