mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Implement previews for plain text files
This commit is contained in:
@@ -44,6 +44,7 @@ func NewSanitizeControlCodes(replace_tab_by string) *SanitizeControlCodes {
|
||||
|
||||
type Highlighter interface {
|
||||
HighlightFile(path string, srd StyleResolveData) (highlighted_string string, err error)
|
||||
Sanitize(string) string
|
||||
}
|
||||
|
||||
func NewHighlighter(sanitize func(string) string) Highlighter {
|
||||
|
||||
@@ -180,6 +180,8 @@ type highlighter struct {
|
||||
sanitize func(string) string
|
||||
}
|
||||
|
||||
func (h *highlighter) Sanitize(x string) string { return h.sanitize(x) }
|
||||
|
||||
func (h *highlighter) HighlightFile(path string, srd StyleResolveData) (highlighted_string string, err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
||||
Reference in New Issue
Block a user