Skip to content

Commit

Permalink
Use CITE_COMMENT not only for external latex editors but also for cop… (
Browse files Browse the repository at this point in the history
#3351)

* Use CITE_COMMENT not only for external latex editors but also for copy to clipboard

* Simplified algorithm
  • Loading branch information
simonharrer authored and lenhard committed Oct 26, 2017
1 parent 106d912 commit 3d4b510
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,10 @@ private void copyCiteKey() {
}

String sb = String.join(",", keys);
StringSelection ss = new StringSelection("\\cite{" + sb + '}');
String citeCommand = Optional.ofNullable(Globals.prefs.get(JabRefPreferences.CITE_COMMAND))
.filter(cite -> cite.contains("\\")) // must contain \
.orElse("\\cite");
StringSelection ss = new StringSelection(citeCommand + "{" + sb + '}');
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, BasePanel.this);

if (keys.size() == bes.size()) {
Expand Down

0 comments on commit 3d4b510

Please sign in to comment.