File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local vim = vim
22local uv = vim .loop
33local M = {}
44
5+ M .global_status_line = false
56M .section = {}
67M .section .left = {}
78M .section .right = {}
@@ -208,7 +209,12 @@ async_combin = uv.new_async(vim.schedule_wrap(function()
208209 line = short_line
209210 end
210211
211- vim .wo .statusline = line
212+ if M .global_status_line then
213+ vim .go .statusline = line
214+ else
215+ vim .wo .statusline = line
216+ end
217+
212218 M .init_colorscheme ()
213219end ))
214220
@@ -230,7 +236,12 @@ function M.init_colorscheme()
230236end
231237
232238function M .disable_galaxyline ()
233- vim .wo .statusline = ' '
239+ if M .global_status_line then
240+ vim .go .statusline = ' '
241+ else
242+ vim .wo .statusline = ' '
243+ end
244+
234245 vim .api .nvim_command (' augroup galaxyline' )
235246 vim .api .nvim_command (' autocmd!' )
236247 vim .api .nvim_command (' augroup END!' )
@@ -243,7 +254,11 @@ function M.galaxyline_augroup()
243254 local command = string.format (' autocmd %s * lua require("galaxyline").load_galaxyline()' ,def )
244255 vim .api .nvim_command (command )
245256 end
246- vim .api .nvim_command (' autocmd WinLeave * lua require("galaxyline").inactive_galaxyline()' )
257+
258+ if not M .global_status_line then
259+ vim .api .nvim_command (' autocmd WinLeave * lua require("galaxyline").inactive_galaxyline()' )
260+ end
261+
247262 vim .api .nvim_command (' augroup END' )
248263end
249264
Original file line number Diff line number Diff line change 1212
1313let g: loaded_galaxyline = 1
1414
15+ if &laststatus == 3
16+ lua require (' galaxyline' ).global_status_line = true
17+ endif
18+
1519lua require (' galaxyline' ).galaxyline_augroup ()
1620
1721let &cpo = s: save_cpo
You can’t perform that action at this time.
0 commit comments