Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global variables g:db_ui_* VS g:dbui_* are misleading #66

Closed
bew opened this issue Oct 28, 2020 · 2 comments
Closed

Global variables g:db_ui_* VS g:dbui_* are misleading #66

bew opened this issue Oct 28, 2020 · 2 comments

Comments

@bew
Copy link

bew commented Oct 28, 2020

Hello,
I think that the use of variables g:db_ui_* (for config) & g:dbui_* (in the plugin) are misleading, what I mean is that when I look at the source code of the plugin and find a g: variable, and I try to override it in my config, it does nothing.

For example, I wanted to disable to execution on write. Since I didn't see the option documented in the top readme (and didn't thought at checking the :h pages at that time, and went to check the source code and found

if g:dbui_execute_on_save && is_sql
autocmd BufWritePost <buffer> nested call s:method('execute_query')
endif

So I figured that setting g:dbui_execute_on_save to v:false (or 0) would disable this behavior.
Unfortunately, that variable is overwritten by
let g:dbui_execute_on_save = get(g:, 'db_ui_execute_on_save', 1)

which takes its value from g:db_ui_execute_on_save instead.

Why did you do this distinction? Would it be possible to keep a single source of truth, and maybe change all g:dbui_* to g:db_ui_* with default if they are not already set?

@kristijanhusak
Copy link
Owner

g:db_ui vars are for the user to change, where g:dbui is for internal purposes. I think I had some issues with tests or something, can't really remember at this moment.
I agree it's a bit misleading, but didn't really think about it since I presume that who checks the source code, can figure it out :)

Yeah, it could be unified, why not.

@kristijanhusak
Copy link
Owner

I updated this. Names are now unified. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants