FFF::PreviewPanel
Inherits Reference < Object
PreviewPanel — Side panel showing directory contents or file preview. Activated via FFF_PREVIEW=1 env or config.json "preview": true. Minimum terminal width: 80 columns. Below that, preview is hidden.
Constants
MAX_PANEL_W = 50
MIN_WIDTH = 80
PANEL_RATIO = 0.4
TEXT_FILE_EXTENSIONS = {".txt", ".cr", ".sh", ".py", ".js", ".ts", ".json", ".yaml", ".yml", ".md", ".html", ".css", ".xml", ".rb", ".go", ".rs", ".c", ".h", ".cpp", ".hpp", ".java", ".php", ".swift", ".kt", ".toml", ".env", ".log", ".csv", ".sql", ".lua", ".ex", ".exs"}
Constructors
Instance methods
draw(term_width : Int32, term_height : Int32, path : String | Nil, theme : Theme, start_row : Int32, end_row : Int32)
Draw the preview panel
panel_width(term_width : Int32) : Int32
Calculate panel width. Returns 0 if terminal is too narrow. Supports preview_width config: "40%" (ratio), "30" (absolute cols), nil (default 40% capped at 50) Cap applies to default only — explicit user config is respected as-is.