only change error stuff when zen mode is active

This commit is contained in:
Ivar Fatland
2026-04-14 09:28:35 +02:00
parent dcfcf0a0fc
commit 98a85e967e
+18 -5
View File
@@ -27,7 +27,6 @@ vim.cmd [[
set noswapfile set noswapfile
set list set list
set makeprg=just set makeprg=just
set statusline=%<%f\ %h%w%m%r\ %=%{%\ &showcmdloc\ ==\ 'statusline'\ ?\ '%-10.S\ '\ :\ ''\ %}%{%\ exists('b:keymap_name')\ ?\ '<'..b:keymap_name..'>\ '\ :\ ''\ %}%{%\ &ruler\ ?\ (\ &rulerformat\ ==\ ''\ ?\ '%-14.(%l,%c%V%)\ %P'\ :\ &rulerformat\ )\ :\ ''\ %}
nnoremap ,co :copen<CR> nnoremap ,co :copen<CR>
nnoremap ,cc :cclose<CR> nnoremap ,cc :cclose<CR>
@@ -212,6 +211,7 @@ do
end end
return nil return nil
end end
local original_statusline = vim.opt_global.statusline
local padding_buffer = _G[ID] local padding_buffer = _G[ID]
if padding_buffer == nil then if padding_buffer == nil then
@@ -258,6 +258,11 @@ do
local padding = calculate_padding() local padding = calculate_padding()
if padding == nil then if padding == nil then
vim.api.nvim_win_close(padding_window, true) vim.api.nvim_win_close(padding_window, true)
vim.opt_global.statusline = original_statusline
vim.diagnostic.config{
signs=true,
underline=true,
}
else else
vim.api.nvim_win_set_width(padding_window, padding) vim.api.nvim_win_set_width(padding_window, padding)
end end
@@ -288,8 +293,20 @@ do
vim.api.nvim_set_option_value('winfixwidth', true, {win = win}) vim.api.nvim_set_option_value('winfixwidth', true, {win = win})
vim.api.nvim_set_option_value("fillchars", "eob: ", { win = win }) vim.api.nvim_set_option_value("fillchars", "eob: ", { win = win })
vim.cmd"wincmd =" vim.cmd"wincmd ="
vim.cmd[[
set statusline=%<%f\ %h%w%m%r\ %=%{%\ &showcmdloc\ ==\ 'statusline'\ ?\ '%-10.S\ '\ :\ ''\ %}%{%\ exists('b:keymap_name')\ ?\ '<'..b:keymap_name..'>\ '\ :\ ''\ %}%{%\ &ruler\ ?\ (\ &rulerformat\ ==\ ''\ ?\ '%-14.(%l,%c%V%)\ %P'\ :\ &rulerformat\ )\ :\ ''\ %}
]]
vim.diagnostic.config{
signs=false,
underline=false,
}
else else
vim.api.nvim_win_close(padding_window, true) vim.api.nvim_win_close(padding_window, true)
vim.opt_global.statusline = original_statusline
vim.diagnostic.config{
signs=true,
underline=true,
}
end end
end end
@@ -544,10 +561,6 @@ require'lazy'.setup{ --{{{1
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
}, },
config = function() config = function()
vim.diagnostic.config{
signs=false,
underline=false,
}
require'mason'.setup{ require'mason'.setup{
registries={ registries={