seanmcl avatar seanmcl committed 2ae30ef

window-selection work

Comments (0)

Files changed (1)

               (null Omake.Window.Error)
               (nequal Omake.Window.Code Omake.Window.Error))))
 
+(defmacro Omake.Frame.uniconify1 (w f)
+  `(progn
+     (Omake.check-dedicated)
+     (make-frame-visible ,f)
+     (when ,w (make-frame-visible (window-frame ,w)))))
+
+(defun Omake.Frame.uniconify (kind)
+  (case kind
+    ('error (Omake.Frame.uniconify1 Omake.Window.Error Omake.Frame.Error))
+    ('code (Omake.Frame.uniconify1 Omake.Window.Code Omake.Frame.Code))
+    (t (error "Impossible"))))
+
 (defun Omake.Window.get (kind)
   (assert (Omake.Window.kindp kind))
   (case kind
 
 (defun Omake.next-error (&optional user-num)
   (interactive "P")
-  (make-frame-visible Omake.Frame.Error)
+  ;; We'll definitely show the error window, so uniconify the error frame if it exists
+  (Omake.Frame.uniconify 'error)
   (let* ((model (Omake.Model.current))
          (result (Omake.model-result model))
          (status (Omake.model-status model))
                  (n (mod user-num num-errors))
                  (_ (assert (< n num-errors)))
                  (e (Omake.Ring.nth ring n)))
-            (make-frame-visible Omake.Frame.Code)
+            ;; Make sure the code frame is visible
+            (Omake.Frame.uniconify 'code)
             (Omake.Error.eval e)
             (message "There are errors")))))))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.