kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.54k stars 94 forks source link

[neovim] Notification dialog overlaps the query result #93

Closed przepompownia closed 3 years ago

przepompownia commented 3 years ago

Right after executing query I have to wait 7 second (hardcoded let s:delay = 7000) until notification message disappears:

image

I found that the notification API allows using echo instead

call db_ui#notifications#info('Executing query...', {'echo': 1})

but it seems to be not used by s:query.execute_query(...).

przepompownia commented 3 years ago

Independently of position of such window it would be good to allow simply close it by some mapping, for example, <Plug>(DBUI_Close_notifications).

kristijanhusak commented 3 years ago

It should not overlap the results but instead be above them. I'll check. Clicking on it (focusing the notification) should immediately hide it.

przepompownia commented 3 years ago

Indeed, clicking closes it, but keyboard action (I have Esc for float windows coming from CoC) would be more convenient.

I have no good idea where such window could be placed when the result window have no free space. Sometimes there is a lot of empty lines at the bottom of the result window.

kristijanhusak commented 3 years ago

This should be fixed now. Notification should appear above the out window, not in the bottom right corner. Also, I added a command :DBUIHideNotifications that should hide any notifications that are currently visible.

przepompownia commented 3 years ago

Thanks for acdf245, The new command (or configuration that forces using echo) can be still needed despite it.

Please test execute a query, go the dbout window, resize +10 on it and execute the query again.

image

I have not found how to configure (percent or line) height of the dbout window.

kristijanhusak commented 3 years ago

Ah, yeah, that case is not considered. I take &previewheight to figure out the position. I'll take a look.

kristijanhusak commented 3 years ago

I just pushed a fix. Output window height is now properly calculated, so notification should be above it even when window is resized. Also, I added an option g:db_ui_force_echo_notifications which will echo all notifications instead of showing them in popup, when the setting is enabled (disabled by default).

przepompownia commented 3 years ago

Notifications now are displayed on the drawer space. g:db_ui_force_echo_notifications works as expected. Thanks! :tada: