Skip to content

Commit

Permalink
refactor: set filetype after other options
Browse files Browse the repository at this point in the history
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#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
  • Loading branch information
ss-raicangu committed Aug 7, 2024
1 parent 607d1c1 commit 296374a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/db_ui/query.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 <silent><buffer><Plug>(DBUI_EditBindParameters) :call <sid>method('edit_bind_parameters')<CR>
Expand Down

0 comments on commit 296374a

Please sign in to comment.