Skip to content
Snippets Groups Projects
Commit c371bfe0 authored by Michael Hauspie's avatar Michael Hauspie
Browse files

Add tweaks to compile window

parent c5e5a2a4
No related branches found
No related tags found
No related merge requests found
...@@ -826,10 +826,29 @@ information from a language server dedicated to the programming ...@@ -826,10 +826,29 @@ information from a language server dedicated to the programming
language currently in use. language currently in use.
First, configure the compilation buffer so that it scrolls to the end or to the first encountered First, configure the compilation buffer so that it scrolls to the end or to the first encountered
error if any error if any and sets its height.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq compilation-scroll-output 'first-error) (setq compilation-scroll-output 'first-error)
(setq compilation-window-height 15)
(defun my-select-bottom-window ()
(let ((bottom-window (selected-window))
window-below)
(while (setq window-below (window-in-direction 'below bottom-window))
(setq bottom-window window-below))
(select-window bottom-window)))
(defun my-compilation-hook ()
(when (not (get-buffer-window "*compilation*"))
(save-selected-window
(save-excursion
(my-select-bottom-window)
(let* ((w (split-window-vertically))
(h (window-height w)))
(select-window w)
(switch-to-buffer "*compilation*")
(shrink-window (- h compilation-window-height)))))))
(add-hook 'compilation-mode-hook 'my-compilation-hook)
#+end_src #+end_src
** LSP ** LSP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment