File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
src/main/java/com/chuntung/plugin/gistsnippet/view Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change
1
+ .gradle /
2
+ .idea /
3
+ build /
Original file line number Diff line number Diff line change 1
1
# Fri Jan 03 09:29:20 CST 2020
2
- distributionUrl =https\://services .gradle.org /distributions/gradle-5.2.1 -bin.zip
2
+ distributionUrl =https\://downloads .gradle-dn.com /distributions/gradle-6.8.3 -bin.zip
3
3
distributionBase =GRADLE_USER_HOME
4
4
distributionPath =wrapper/dists
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -319,12 +319,16 @@ private void initYoursPane(List<GithubAccount> accountList) {
319
319
}
320
320
321
321
private void onSelect (TreeSelectionEvent e ) {
322
- DefaultMutableTreeNode selected = null ;
323
322
TreePath treePath = e .getNewLeadSelectionPath ();
324
- if (treePath ! = null ) {
325
- selected = ( DefaultMutableTreeNode ) treePath . getLastPathComponent () ;
323
+ if (treePath == null || treePath . getLastPathComponent () = = null ) {
324
+ return ;
326
325
}
327
- if (selected != null && selected .isLeaf () && selected .getUserObject () instanceof GistFileDTO ) {
326
+ DefaultMutableTreeNode selected = (DefaultMutableTreeNode ) treePath .getLastPathComponent ();
327
+ // show the first file when gist item is selected
328
+ if (selected .getUserObject () instanceof SnippetNodeDTO && selected .getChildCount () > 0 ) {
329
+ selected = (DefaultMutableTreeNode ) selected .getFirstChild ();
330
+ }
331
+ if (selected .getUserObject () instanceof GistFileDTO ) {
328
332
// show file content
329
333
GistFileDTO gistFileDTO = getUserObject (selected );
330
334
showingFileUrl = gistFileDTO .getRawUrl ();
You can’t perform that action at this time.
0 commit comments