|  | @@ -126,18 +126,20 @@ function M.show_line_diagnostics()
 | 
	
		
			
				|  |  |      if diagnostic.code then
 | 
	
		
			
				|  |  |        diags[i].message = string.format("%s [%s]", diags[i].message, diagnostic.code)
 | 
	
		
			
				|  |  |      end
 | 
	
		
			
				|  |  | -    if diags[i].message:len() > width then
 | 
	
		
			
				|  |  | -      width = string.len(diags[i].message)
 | 
	
		
			
				|  |  | -    end
 | 
	
		
			
				|  |  | +    width = math.max(width, diags[i].message:len())
 | 
	
		
			
				|  |  |    end
 | 
	
		
			
				|  |  | +  local max_width = vim.fn.winwidth(0) - 10
 | 
	
		
			
				|  |  | +  width = math.min(width, max_width)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    opts = vim.lsp.util.make_floating_popup_options(width, height, opts)
 | 
	
		
			
				|  |  |    opts["style"] = "minimal"
 | 
	
		
			
				|  |  |    opts["border"] = "rounded"
 | 
	
		
			
				|  |  | +  opts["focusable"] = true
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe")
 | 
	
		
			
				|  |  |    local winnr = vim.api.nvim_open_win(bufnr, false, opts)
 | 
	
		
			
				|  |  |    vim.api.nvim_win_set_option(winnr, "winblend", 0)
 | 
	
		
			
				|  |  | +  vim.api.nvim_win_set_option(winnr, "wrap", true)
 | 
	
		
			
				|  |  |    vim.api.nvim_buf_set_var(bufnr, "lsp_floating_window", winnr)
 | 
	
		
			
				|  |  |    for i, diag in ipairs(diags) do
 | 
	
		
			
				|  |  |      local message = diag.message:gsub("[\n\r]", " ")
 |