From 08031a9fc67f73e09f2c94d1b993d9b4263c6a80 Mon Sep 17 00:00:00 2001 From: Jadon Brutcher Date: Sun, 26 Jul 2026 00:12:08 -0500 Subject: [PATCH] feat: accept custom border character arrays Allow users to pass a custom border table instead of just preset strings. Supports a table { border_chars, junction_chars } and falls back to existing preset system when a string is passed --- README.md | 5 +++++ lua/fff/conf.lua | 2 +- lua/fff/layout.lua | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 944186aff..141115e62 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,11 @@ require('fff').setup({ -- Border style for the picker windows. Leave unset (nil) to follow the -- global `vim.o.winborder`; set it to override fff's borders independently. border = nil, -- 'single' | 'double' | 'rounded' | 'solid' | 'shadow' | 'none' + -- border = { + -- { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, + -- { ' ', ' ', ' ', ' ', ' ', ' ' }, + -- }, + flex = { size = 130, wrap = 'top' }, min_list_height = 10, -- do not display anything except the list below this threshold show_scrollbar = true, diff --git a/lua/fff/conf.lua b/lua/fff/conf.lua index d9d806433..0b7ad0b06 100644 --- a/lua/fff/conf.lua +++ b/lua/fff/conf.lua @@ -9,7 +9,7 @@ local M = {} --- @field min_list_height number --- @field show_scrollbar boolean --- @field path_shorten_strategy string ---- @field border? 'single'|'double'|'rounded'|'solid'|'shadow'|'none' Border preset; falls back to `vim.o.winborder` when nil +--- @field border? 'single'|'double'|'rounded'|'solid'|'shadow'|'none'|table Border preset; falls back to `vim.o.winborder` when nil --- @class FffPreviewConfig --- @field enabled boolean diff --git a/lua/fff/layout.lua b/lua/fff/layout.lua index 809cfbf2a..298079dba 100644 --- a/lua/fff/layout.lua +++ b/lua/fff/layout.lua @@ -29,6 +29,9 @@ local function get_border_chars(config) if border == nil or border == '' then border = vim.o.winborder end if border == nil or border == '' then border = 'single' end + if type(border) == 'table' then + if #border == 2 and type(border[1]) == 'table' and type(border[2]) == 'table' then return border[1], border[2] end + end if BORDER_PRESETS[border] then return BORDER_PRESETS[border], T_JUNCTION_PRESETS[border] end return BORDER_PRESETS.single, T_JUNCTION_PRESETS.single end