Skip to content

Commit

Permalink
Add log split width and height percentage config
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Mar 1, 2025
1 parent 9fd944e commit c5f427c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
12 changes: 12 additions & 0 deletions doc/conjure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,18 @@ configure the ones you care about one at a time you can set:
How long should the highlight last in milliseconds.
Default: `500`

*g:conjure#log#split#width*
`g:conjure#log#split#width`
Width of the log vsplit as a percentage of the editor width.
A float between 0.0 and 1.0.
Default: `nil`

*g:conjure#log#split#height*
`g:conjure#log#split#height`
Height of the log split as a percentage of the editor height.
A float between 0.0 and 1.0.
Default: `nil`

*g:conjure#log#hud#width*
`g:conjure#log#hud#width`
Width of the HUD as a percentage of the editor width.
Expand Down
2 changes: 2 additions & 0 deletions fnl/conjure/config.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
{:wrap false
:diagnostics false
:treesitter true
:split {:width nil
:height nil}
:hud {:width 0.42
:height 0.3
:zindex 1
Expand Down
10 changes: 8 additions & 2 deletions fnl/conjure/log.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,16 @@
(buffer.unlist buf)))

(fn split []
(create-win :split))
(create-win :split)
(let [height (config.get-in [:log :split :height])]
(when height
(vim.api.nvim_win_set_height 0 (editor.percent-height height)))))

(fn vsplit []
(create-win :vsplit))
(create-win :vsplit)
(let [width (config.get-in [:log :split :width])]
(when width
(vim.api.nvim_win_set_width 0 (editor.percent-width width)))))

(fn tab []
(create-win :tabnew))
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/config.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions lua/conjure/log.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5f427c

Please sign in to comment.