Skip to content

Commit 76b1350

Browse files
committed
resolve conflict shortcut for windows
1 parent 8bc8fef commit 76b1350

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/main/java/com/chuntung/plugin/gistsnippet/service/GistSnippetService.java

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public void deleteGist(GithubAccount account, List<String> gistIds) {
153153
GithubApiRequestExecutor executor = GithubApiRequestExecutorManager.getInstance().getExecutor(account);
154154
for (String gistId : gistIds) {
155155
String url = String.format(GIST_DETAIL_URL, gistId);
156+
// 2018.3
156157
GithubApiRequest.Delete delete = new GithubApiRequest.Delete(url);
157158
executor.execute(delete);
158159
gistCache.remove(gistId);

src/main/java/com/chuntung/plugin/gistsnippet/view/InsertGistDialog.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ public void mouseClicked(MouseEvent e) {
146146
treeModel.addTreeModelListener(new TreeModelAdapter() {
147147
protected void process(@NotNull TreeModelEvent event, @NotNull EventType type) {
148148
if (snippetRoot.children().size() > 0 && snippetTree.getSelectionCount() == 0) {
149-
snippetStructure.getInvoker().runOrInvokeLater(() -> {
150-
snippetTree.setSelectionRow(0);
151-
snippetTree.requestFocusInWindow();
149+
UIUtil.invokeLaterIfNeeded(() -> {
150+
if (snippetRoot.children().size() > 0 && snippetTree.getSelectionCount() == 0) {
151+
snippetTree.setSelectionRow(0);
152+
snippetTree.requestFocusInWindow();
153+
}
152154
});
153155
}
154156
}

src/main/resources/META-INF/plugin.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
description="Search gist and then insert selection into current editor"
2828
class="com.chuntung.plugin.gistsnippet.action.InsertAction">
2929
<add-to-group group-id="EditorPopupMenu" anchor="after" relative-to-action="Github.Create.Gist"/>
30-
<keyboard-shortcut keymap="$default" first-keystroke="control alt I" />
31-
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="control alt I" replace-all="true"/>
30+
<keyboard-shortcut keymap="$default" first-keystroke="alt I" />
31+
<keyboard-shortcut keymap="Mac OS X" first-keystroke="control alt I" replace-all="true"/>
32+
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="meta alt I" replace-all="true"/>
3233
</action>
3334
</actions>
3435
</idea-plugin>

0 commit comments

Comments
 (0)