-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 sublime text editor as external push application #10104
Conversation
Fixes #10098 Co-authored-by: AdamWysokinski <[email protected]>
@AdamWysokinski you can test the version here if it already works |
|
||
@Override | ||
protected String[] getCommandLine(String keyString) { | ||
return new String[] {commandPath, "--command \'insert {\"characters\": \"\\", getCiteCommand() + "{" + keyString + "}\\}\'"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've placed some backslashes incorrectly, I think the returned string should be:
return new String[] {commandPath, "--command \'insert {\"characters\": \"", getCiteCommand() + "{" + keyString + "}\"}\'"};
I installed Sublime text on mac as well and tested around, from the command line it works
but not from JabRef yet, not exactly sure, Maybe it works for you? New version wil be built automatically |
It doesn't work here, either. Now it switches the focus to Sublime Text, but does not paste anything. Previously it has been creating an empty file named Can we log or output the command string that is being generated? Also, the Sublime command should be Also also, I thinks this icon: https://icon-sets.iconify.design/simple-icons/sublimetext/ is perfect for the job. |
fix path
I tested with setting path to subl and various simple arguments like -v. That works. My valid guess is that something in the ProcessBuilder does not work the json string arg, but I don't know why. |
Ok, let's try again, I think I know where the problem is. Please try this:
|
todo test with windows
* upstream/main: (32 commits) Bump org.junit.platform:junit-platform-launcher from 1.9.3 to 1.10.0 New translations JabRef_en.properties (Indonesian) New translations JabRef_en.properties (Italian) New translations JabRef_en.properties (French) Bump org.openrewrite.rewrite from 6.1.16 to 6.1.19 Bump org.junit.jupiter:junit-jupiter from 5.9.3 to 5.10.0 Bump org.openrewrite.recipe:rewrite-recipe-bom from 2.0.7 to 2.1.0 Bump appleboy/ssh-action from 0.1.10 to 1.0.0 New translations JabRef_en.properties (Tagalog) New translations JabRef_en.properties (Persian) New translations JabRef_en.properties (Indonesian) New translations JabRef_en.properties (Portuguese, Brazilian) New translations JabRef_en.properties (Vietnamese) New translations JabRef_en.properties (Chinese Traditional) New translations JabRef_en.properties (Chinese Simplified) New translations JabRef_en.properties (Ukrainian) New translations JabRef_en.properties (Turkish) New translations JabRef_en.properties (Swedish) New translations JabRef_en.properties (Russian) New translations JabRef_en.properties (Portuguese) ...
@AdamWysokinski I made it work now by starting a shell first and giving the whole application path + command string as argument for the shell. In the log the caller string is shown as well Regarding your string: The process builder takes the first array arg as program and every. In your case, the argument getCitecommand was interpreted as the file argument I am having a mac and here it works, guess lInux should work as well. Windows needs probably some more escaping of double quotes |
It works great on Linux after entering the whole path for subl command (/usr/bin/subl). |
Now with proper icon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small code style comments. If it does not work on Windows, we can fix later
* upstream/main: New translations JabRef_en.properties (Dutch) New translations JabRef_en.properties (Dutch) New translations JabRef_en.properties (German)
add svg
Your code currently does not meet JabRef's code guidelines. The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues. More information on code quality in JabRef is available at https://devdocs.jabref.org/getting-into-the-code/development-strategy.html. |
This reverts commit 7f00f8f.
* upstream/main: Bump org.apache.commons:commons-lang3 from 3.12.0 to 3.13.0 Bump com.puppycrawl.tools:checkstyle from 10.12.1 to 10.12.2 Bump org.bouncycastle:bcprov-jdk18on from 1.75 to 1.76 New translations JabRef_en.properties (Dutch)
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
Fixes #10098
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)