mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(win): correctly deal with initial text containing newlines. Fixes #542
This commit is contained in:
parent
7c25aec372
commit
825c106f40
1 changed files with 1 additions and 1 deletions
|
@ -603,7 +603,7 @@ function M:scratch()
|
|||
vim.bo[self.buf].swapfile = false
|
||||
self.scratch_buf = self.buf
|
||||
local text = type(self.opts.text) == "function" and self.opts.text() or self.opts.text
|
||||
text = type(text) == "string" and { text } or text
|
||||
text = type(text) == "string" and vim.split(text, "\n") or text
|
||||
if text then
|
||||
---@cast text string[]
|
||||
vim.api.nvim_buf_set_lines(self.buf, 0, -1, false, text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue