Skip to content

Commit

Permalink
add hackly for rust wrong format diagnostic message
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed May 23, 2024
1 parent bf8c54f commit e050ff4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/lspsaga/diagnostic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ function diag:goto_pos(pos, opts)
(is_forward and vim.diagnostic.goto_next or vim.diagnostic.goto_prev)(vim.tbl_extend('keep', {
float = {
border = config.ui.border,
format = function(diagnostic)
if not vim.bo[api.nvim_get_current_buf()].filetype == 'rust' then
return diagnostic.message
end
return diagnostic.message:find('\n`') and diagnostic.message:gsub('\n`', '`')
or diagnostic.message
end,
header = '',
prefix = { '', 'Title' },
},
Expand Down

0 comments on commit e050ff4

Please sign in to comment.