Skip to content

Commit

Permalink
Open jdb in other window and keep focus on current
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Klich committed Aug 16, 2015
1 parent c09fba2 commit 79d6e3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions eclim-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,19 @@
(add-hook 'comint-output-filter-functions
(lambda (txt) (eclim--debug-attach-when-ready txt project port))))))

(defun eclim-debug/jdb (command)
(let ((buffer (current-buffer)))
(toggle-maximize-buffer)
(switch-to-buffer-other-window buffer t)
(jdb command)
(switch-to-buffer-other-window buffer t)))

(defun eclim-debug-junit ()
(interactive)
(let ((project (eclim-project-name))
(classes (eclim-package-and-class)))
(jdb (eclim--debug-jdb-run-command project "org.junit.runner.JUnitCore" classes))))
(eclim-debug/jdb
(eclim--debug-jdb-run-command project "org.junit.runner.JUnitCore" classes))))

(defun eclim-debug-maven-test ()
(interactive)
Expand All @@ -107,7 +115,7 @@

(defun eclim-debug-attach (port project)
(interactive (list (read-number "Port: " 5005) (eclim-project-name)))
(jdb (eclim--debug-jdb-attach-command project port)))
(eclim-debug/jdb (eclim--debug-jdb-attach-command project port)))

(defun eclim-debug-test ()
(interactive)
Expand Down
2 changes: 1 addition & 1 deletion eclim-java-run.el
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
(eclim-java-run--debug-vm-args classpath sourcepath))))
(with-temp-buffer
(setq default-directory project-dir)
(jdb command))))
(eclim-debug/jdb command))))

(defun eclim-java-run--run-java (config classpath project-dir)
(let* ((name (eclim-java-run--get-value 'name config))
Expand Down
2 changes: 1 addition & 1 deletion eclim-java.el
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ declaration has been found. TYPE may be either 'class',
(save-excursion
(if (re-search-backward
(concat (or type "\\(class\\|interface\\|enum\\)") "\\s-+\\([^<{\s-]+\\)") nil t)
(match-string 2)
(match-string-no-properties 2)
"")))

(defun eclim--java-current-class-name ()
Expand Down

0 comments on commit 79d6e3a

Please sign in to comment.