Skip to content

Commit c0e33f0

Browse files
feat(notifications): Add option to disable "info" notifications
1 parent 0fec59e commit c0e33f0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

autoload/db_ui/notifications.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ function! s:notification(msg, opts) abort
5252
return
5353
endif
5454

55+
let type = get(a:opts, 'type', 'info')
56+
57+
if type ==? 'info' && g:db_ui_disable_info_notifications
58+
return
59+
end
60+
5561
let use_echo = get(a:opts, 'echo', 0)
5662
if !use_echo
5763
let use_echo = g:db_ui_force_echo_notifications

doc/dadbod-ui.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,12 @@ g:db_ui_force_echo_notifications
787787
Notifications are shown via popups when supported. To force
788788
echoing messages to command line set this value to 1.
789789

790+
Default value: `0`
791+
792+
*g:db_ui_disable_info_notifications*
793+
g:db_ui_disable_info_notifications
794+
Disable all notifications with "info" severity.
795+
790796
Default value: `0`
791797

792798
*g:db_ui_use_postgres_views*
@@ -849,7 +855,7 @@ g:Db_ui_buffer_name_generator
849855
<
850856

851857
Default value: `0`
852-
858+
853859
*g:Db_ui_table_name_sorter
854860
g:Db_ui_table_name_sorter
855861
Custom function for sorting table names.

plugin/db_ui.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let g:db_ui_show_help = get(g:, 'db_ui_show_help', 1)
2525
let g:db_ui_use_nerd_fonts = get(g:, 'db_ui_use_nerd_fonts', 0)
2626
let g:db_ui_execute_on_save = get(g:, 'db_ui_execute_on_save', 1)
2727
let g:db_ui_force_echo_notifications = get(g:, 'db_ui_force_echo_notifications', 0)
28+
let g:db_ui_disable_info_notifications = get(g:, 'db_ui_disable_info_notifications', 0)
2829
let g:db_ui_use_nvim_notify = get(g:, 'db_ui_use_nvim_notify', 0)
2930
let g:Db_ui_buffer_name_generator = get(g:, 'Db_ui_buffer_name_generator', 0)
3031
let g:Db_ui_table_name_sorter = get(g:, 'Db_ui_table_name_sorter', 0)

0 commit comments

Comments
 (0)