Skip to content

Commit 92988c1

Browse files
committed
...
1 parent bd0f555 commit 92988c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kittens/choose_files/preview.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ type TextFilePreview struct {
184184
plain_text, highlighted_text string
185185
highlighted_chan chan highlighed_data
186186
light bool
187+
path string
187188
}
188189

189190
func (p TextFilePreview) IsValidForColorScheme(light bool) bool { return p.light == light }
190191

191-
func (p TextFilePreview) Render(h *Handler, x, y, width, height int) {
192+
func (p *TextFilePreview) Render(h *Handler, x, y, width, height int) {
192193
if p.highlighted_chan != nil {
193194
select {
194195
case hd := <-p.highlighted_chan:
@@ -228,7 +229,7 @@ func NewTextFilePreview(abspath string, metadata fs.FileInfo, highlighted_chan c
228229
if !utf8.ValidString(text) {
229230
text = "Error: not valid utf-8 text"
230231
}
231-
return &TextFilePreview{plain_text: sanitize(text), highlighted_chan: highlighted_chan, light: use_light_colors}
232+
return &TextFilePreview{path: abspath, plain_text: sanitize(text), highlighted_chan: highlighted_chan, light: use_light_colors}
232233
}
233234

234235
type style_resolver struct {

0 commit comments

Comments
 (0)