Documentation
¶
Overview ¶
Package filepreview loads a regular file into a text preview. It is the shared loader for the Files plugin and docview, so neither surface needs to import the other.
Index ¶
Constants ¶
const ( // MaxPreviewSize is the raw-byte cap for a document preview. JSON-encoded // remote payloads may have to cut earlier; see contentservice.MaxEncodedBytes. MaxPreviewSize = 500 * 1024 // MaxPreviewLines caps the line split a viewer keeps from a preview. MaxPreviewLines = 10000 )
Variables ¶
This section is empty.
Functions ¶
func LoadPreview ¶
LoadPreview creates a command to load file content.
Types ¶
type PreviewLoadedMsg ¶
type PreviewLoadedMsg struct {
Epoch uint64
Result PreviewResult
Path string
}
PreviewLoadedMsg signals that file preview content is ready.
func (PreviewLoadedMsg) GetEpoch ¶
func (m PreviewLoadedMsg) GetEpoch() uint64
GetEpoch implements plugin.EpochMessage.