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 11# 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
33distributionBase =GRADLE_USER_HOME
44distributionPath =wrapper/dists
55zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -319,12 +319,16 @@ private void initYoursPane(List<GithubAccount> accountList) {
319319 }
320320
321321 private void onSelect (TreeSelectionEvent e ) {
322- DefaultMutableTreeNode selected = null ;
323322 TreePath treePath = e .getNewLeadSelectionPath ();
324- if (treePath ! = null ) {
325- selected = ( DefaultMutableTreeNode ) treePath . getLastPathComponent () ;
323+ if (treePath == null || treePath . getLastPathComponent () = = null ) {
324+ return ;
326325 }
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 ) {
328332 // show file content
329333 GistFileDTO gistFileDTO = getUserObject (selected );
330334 showingFileUrl = gistFileDTO .getRawUrl ();
You can’t perform that action at this time.
0 commit comments