From 296374af294d41a2ea15017adb9c2ee146ee5f6c Mon Sep 17 00:00:00 2001 From: ss-raicangu Date: Wed, 7 Aug 2024 23:07:24 +1200 Subject: [PATCH] refactor: set `filetype` after other options This allows filetype plugins, such as `mysql.vim`, to override any of the special query buffer settings if needed. A similar pattern of setting `filetype` before other settings is present for the DBUI drawer. I assume this is more deliberate, and is out of scope for kristijanhusak/vim-dadbod-ui#267, so I haven't changed this part. This change was not signed off, so might be reverted. BREAKING-CHANGE: Options set in filetype plugins are now preferred for query buffers. Link: https://github.com/kristijanhusak/vim-dadbod-ui/blob/0f51d8de368c8c6220973e8acd156d17da746f4c/autoload/db_ui/drawer.vim?plain=1#L38 --- autoload/db_ui/query.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/db_ui/query.vim b/autoload/db_ui/query.vim index 28fb07f..2cbdfb2 100644 --- a/autoload/db_ui/query.vim +++ b/autoload/db_ui/query.vim @@ -167,7 +167,7 @@ function! s:query.setup_buffer(db, opts, buffer_name, was_single_win) abort endif if &filetype !=? a:db.filetype || !is_existing_buffer - silent! exe 'setlocal filetype='.a:db.filetype.' noswapfile nowrap nospell modifiable' + silent! exe 'setlocal noswapfile nowrap nospell modifiable filetype='.a:db.filetype endif let is_sql = &filetype ==? a:db.filetype nnoremap (DBUI_EditBindParameters) :call method('edit_bind_parameters')