kristijanhusak / vim-dadbod-ui

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

Possible to Add Option for Nvim-Notify to Track Query Time? #212

Closed jtw023 closed 7 months ago

jtw023 commented 7 months ago

I was looking at this December 2021 feature request from the nvim-notify repo and thought it would be kind of cool to have notify also handle tracking the query length since all my other notifications are routed through there(see below screenshot). I gave it a shot using that update function to make use of the spinner frames shown in the video but I just don't know enough vimscript/lua. Figured I would swing by to see if anyone else is interested in this or had the time to make it happen.

Screenshot 2023-11-27 at 11 30 55 PM

jtw023 commented 7 months ago

In order to get some practice I decided to change the "Execute query" time format - see screenshot. Not sure if this has been asked for but let me know if you'd like a pull request for this one. Could probably make it into a flag that is set in your config. Haven't made any progress on turning this into a notify alert. Screenshot 2023-11-28 at 6 50 04 PM

jtw023 commented 7 months ago

Closed by mistake. Reopening issue.

kristijanhusak commented 7 months ago

The current window works in both Vim and Neovim. You can see how it's implemented starting from here.

I would suggest creating a separate small plugin that would do this, since it's more straightforward. You can hook into same autocommands like it's done here, and you can remove these by overriding autocmds in the augroup, or we can add an option here to hide the progress if the user does not want to see it.

I'm trying to keep the plugin compatible with both Vim and Neovim since vim-dadbod does the same, so having some implementations that are strictly supported for one or another is out of scope. Using vim.notify was an exception because it does not depend on any other plugin, but since you need to use update from nvim-notify, it creates a dependency on that plugin.

jtw023 commented 7 months ago

Ok, thanks! I'll play around with it over the next few weeks and report back when I get something to show.