From efac8350f4afe0b49f278129ef92ffb0a02d1c6f Mon Sep 17 00:00:00 2001 From: Ben Lubas <56943754+benlubas@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:57:02 -0500 Subject: [PATCH] feat(concealer): code block background `min_width` (#1328) closes https://github.com/nvim-neorg/neorg/issues/1327 --- lua/neorg/modules/core/concealer/module.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/neorg/modules/core/concealer/module.lua b/lua/neorg/modules/core/concealer/module.lua index 5e155ff93..550831ee0 100644 --- a/lua/neorg/modules/core/concealer/module.lua +++ b/lua/neorg/modules/core/concealer/module.lua @@ -638,7 +638,7 @@ module.public = { end local line_lengths = {} - local max_len = 0 + local max_len = config.min_width or 0 for row_0b = row_start_0b, row_end_0bin do local len = get_line_length(bufid, row_0b) if len > max_len then @@ -929,6 +929,10 @@ module.config.public = { -- within the code block. width = "fullwidth", + -- When set to a number, the code block background will be at least + -- this many chars wide. Useful in conjunction with `width = "content"` + min_width = nil, + -- Additional padding to apply to either the left or the right. Making -- these values negative is considered undefined behaviour (it is -- likely to work, but it's not officially supported).