Skip to content

Commit

Permalink
chore: Improving notifications, fixing scrollback
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed Nov 30, 2023
1 parent 9c679c3 commit e70165e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ cursor_stop_blinking_after 15.0

#: Scrollback {{{

scrollback_lines 2000
scrollback_lines 10000

#: Number of lines of history to keep in memory for scrolling back.
#: Memory is allocated on demand. Negative numbers are (effectively)
Expand Down
1 change: 1 addition & 0 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "user.plugins"
require "user.theme"
require "user.notifications"
require "user.editor"
require "user.telescope"
require "user.treesitter"
Expand Down
7 changes: 0 additions & 7 deletions nvim/lua/user/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ nnoremap <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '>
-- end,
-- })

-- Overwrite the default notify method with the new one
local notify = require("notify")
notify.setup({
background_colour = "#000000",
})
vim.notify = notify

require('dressing').setup({
input = {
-- Set to false to disable the vim.ui.input implementation
Expand Down
27 changes: 27 additions & 0 deletions nvim/lua/user/notifications.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- Overwrite the default notify method with the new one
local betterNotify = require("notify")
betterNotify.setup({
background_colour = "#000000",
})
local ignoreMessages = {
'[LSP] Format request failed, no matching language servers.',
};

function Contains(list, x)
for _, v in ipairs(list) do
if v == x then
return true
end
end
return false
end

--- No idea why this is necessary?
---@diagnostic disable-next-line: duplicate-set-field
vim.notify = function(msg, level, opt)
if Contains(ignoreMessages, msg) then
return
end

return betterNotify(msg, level, opt)
end

0 comments on commit e70165e

Please sign in to comment.