Skip to content

Commit 64f9b49

Browse files
committed
chore(preview): setlocal list for preview window
1 parent ecb8dcf commit 64f9b49

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lua/ufo/preview.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ function Preview:peekFoldedLinesUnderCursor(maxHeight, nextLineIncluded, enter)
218218
local text = bufmanager:get(curBufnr):lines(lnum, endLnum)
219219
local height = math.min(#text, maxHeight or 20)
220220
floatwin:display(api.nvim_get_current_win(), height, text, enter)
221+
utils.winCall(floatwin.winid, function()
222+
cmd('norm! ze')
223+
end)
221224
render.mapHighlightLimitByRange(curBufnr, floatwin.bufnr,
222225
{lnum - 1, 0}, {endLnum - 1, #text[endLnum - lnum + 1]},
223226
text, self.ns)

lua/ufo/preview/floatwin.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,13 @@ function FloatWin:display(targetWinid, height, text, enter)
134134
self.winblend = self.config.winblend
135135
local wo = vim.wo[self.winid]
136136
wo.wrap = false
137-
wo.spell, wo.list = false, false
137+
wo.spell, wo.list = false, true
138138
wo.nu, wo.rnu = false, false
139139
wo.fen, wo.fdm, wo.fdc = false, 'manual', '0'
140140
wo.cursorline = false
141141
wo.signcolumn, wo.colorcolumn = 'no', ''
142142
wo.winhl = self.config.winhighlight
143143
wo.winblend = self.winblend
144-
wo.sidescrolloff = 0
145144
end
146145
vim.bo[self.bufnr].modifiable = true
147146
api.nvim_buf_set_lines(self.bufnr, 0, -1, true, text)

0 commit comments

Comments
 (0)