Skip to content

Commit

Permalink
feat(notifications): Add option to disable "info" notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijanhusak committed Jan 3, 2025
1 parent 0fec59e commit b4b95e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions autoload/db_ui/notifications.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ function! s:notification(msg, opts) abort
return
endif

let type = get(a:opts, 'type', 'info')

if type ==? 'info' && g:db_ui_disable_info_notifications
return
endif

let use_echo = get(a:opts, 'echo', 0)
if !use_echo
let use_echo = g:db_ui_force_echo_notifications
Expand Down
8 changes: 7 additions & 1 deletion doc/dadbod-ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,12 @@ g:db_ui_force_echo_notifications
Notifications are shown via popups when supported. To force
echoing messages to command line set this value to 1.

Default value: `0`

*g:db_ui_disable_info_notifications*
g:db_ui_disable_info_notifications
Disable all notifications with "info" severity.

Default value: `0`

*g:db_ui_use_postgres_views*
Expand Down Expand Up @@ -849,7 +855,7 @@ g:Db_ui_buffer_name_generator
<

Default value: `0`

*g:Db_ui_table_name_sorter
g:Db_ui_table_name_sorter
Custom function for sorting table names.
Expand Down
1 change: 1 addition & 0 deletions plugin/db_ui.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ let g:db_ui_show_help = get(g:, 'db_ui_show_help', 1)
let g:db_ui_use_nerd_fonts = get(g:, 'db_ui_use_nerd_fonts', 0)
let g:db_ui_execute_on_save = get(g:, 'db_ui_execute_on_save', 1)
let g:db_ui_force_echo_notifications = get(g:, 'db_ui_force_echo_notifications', 0)
let g:db_ui_disable_info_notifications = get(g:, 'db_ui_disable_info_notifications', 0)
let g:db_ui_use_nvim_notify = get(g:, 'db_ui_use_nvim_notify', 0)
let g:Db_ui_buffer_name_generator = get(g:, 'Db_ui_buffer_name_generator', 0)
let g:Db_ui_table_name_sorter = get(g:, 'Db_ui_table_name_sorter', 0)
Expand Down

0 comments on commit b4b95e0

Please sign in to comment.