fix(lsp): respect global syntax setting in open float preview (#15225)

This commit is contained in:
Elton Leander Pinto 2022-05-25 12:47:49 -04:00 committed by GitHub
parent 24352cba01
commit c6d6b8c7eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1477,7 +1477,7 @@ function M.open_floating_preview(contents, syntax, opts)
})
opts = opts or {}
opts.wrap = opts.wrap ~= false -- wrapping by default
opts.stylize_markdown = opts.stylize_markdown ~= false
opts.stylize_markdown = opts.stylize_markdown ~= false and vim.g.syntax_on ~= nil
opts.focus = opts.focus ~= false
opts.close_events = opts.close_events or { 'CursorMoved', 'CursorMovedI', 'InsertCharPre' }