mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-11 02:59:40 +02:00
Show filename in text file preview
This commit is contained in:
@@ -222,7 +222,7 @@ func (p *TextFilePreview) Render(h *Handler, x, y, width, height int) {
|
||||
s := utils.NewLineScanner(text)
|
||||
buf := strings.Builder{}
|
||||
buf.Grow(1024 * height)
|
||||
for num := 0; s.Scan() && num < height; num++ {
|
||||
for num := 1 + h.render_wrapped_text_in_region(filepath.Base(p.path), x, y, width, height, true); s.Scan() && num < height; num++ {
|
||||
line := s.Text()
|
||||
truncated := wcswidth.TruncateToVisualLength(line, width)
|
||||
buf.WriteString(fmt.Sprintf(loop.MoveCursorToTemplate, y+num, x))
|
||||
|
||||
Reference in New Issue
Block a user