kristijanhusak / vim-dadbod-ui

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

Can't auto execute table helpers when not executing on save #53

Closed petobens closed 4 years ago

petobens commented 4 years ago

Consider the following minimal init.vim file:

let $DOTVIM = expand('$HOME/.config/nvim')

set runtimepath+=$DOTVIM/bundle/repos/github.com/kristijanhusak/vim-dadbod_async-query
set runtimepath+=$DOTVIM/bundle/repos/github.com/kristijanhusak/vim-dadbod-ui
filetype plugin indent on

let g:db_ui_auto_execute_table_helpers = 1
let g:db_ui_execute_on_save = 0
" let g:dbs = _some_postgres_db

augroup ps_dadbodui
    au!
    au Filetype dbui nmap <silent><buffer> <CR> <Plug>(DBUI_SelectLine)
augroup END

If I now run :DBUI and press enter on one of the postgres tables List or Columns queries then the helper query is not auto executed. If I now change g:db_ui_execute_on_save to 1 then it is. I don't know if this is a bug or a feature.

kristijanhusak commented 4 years ago

I'd say it's a bug. I didn't consider usage of those two at the same time. auto execute depends on execute on save, because it just writes the buffer. I'll fix it.

Today I added <CR> as part of the default mappings for open, so you don't need to bind that manually.

kristijanhusak commented 4 years ago

@petobens this should be fixed now. Please give it a test.

glepnir commented 4 years ago

@kristijanhusak Are you mention wrong people?

kristijanhusak commented 4 years ago

@glepnir sorry.

petobens commented 4 years ago

Seems to work. Thanks!