Skip to content

Commit bd59d6b

Browse files
committed
feat: accept "winborder"
See: - #436
1 parent a852690 commit bd59d6b

File tree

6 files changed

+42
-12
lines changed

6 files changed

+42
-12
lines changed

doc/command-t.txt

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ notice at any time; for example:
462462
},
463463
margin = 10,
464464
match_listing = {
465-
-- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', or a
466-
-- list of strings.
465+
-- 'double', 'none', 'rounded', 'shadow', 'single', 'solid',
466+
-- 'winborder', or a list of strings.
467467
border = { '', '', '', '│', '┘', '─', '└', '│' },
468468
icons = true,
469469
truncate = 'middle', -- 'beginning', 'end', true, false.
@@ -472,8 +472,8 @@ notice at any time; for example:
472472
order = 'forward', -- 'forward' or 'reverse'.
473473
position = 'center', -- 'bottom', 'center' or 'top'.
474474
prompt = {
475-
-- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', or a
476-
-- list of strings.
475+
-- 'double', 'none', 'rounded', 'shadow', 'single', 'solid',
476+
-- 'winborder', or a list of strings.
477477
border = { '┌', '─', '┐', '│', '┤', '─', '├', '│' },
478478
479479
},
@@ -508,9 +508,11 @@ passed to |commandt.setup()|:
508508

509509
- |commandt.setup.always_show_dot_files|
510510
- |commandt.setup.ignore_case|
511+
- |commandt.setup.match_listing.border|
511512
- |commandt.setup.match_listing.icons|
512513
- |commandt.setup.match_listing.truncate|
513514
- |commandt.setup.never_show_dot_files|
515+
- |commandt.setup.prompt.border|
514516
- |commandt.setup.root_markers|
515517
- |commandt.setup.scanners.max_files|
516518
- |commandt.setup.smart_case|
@@ -549,6 +551,17 @@ the value of Neovim's |'ignorecase'| setting is used instead.
549551

550552
See also |commandt.setup.smart_case|.
551553

554+
*commandt.setup.match_listing.border*
555+
string or list (default: { '', '', '', '│', '┘', '─', '└', '│' })
556+
557+
Controls the border of the match listing window. Valid string values are
558+
"double", "none", "rounded", "shadow", "single", or "solid". The special
559+
value, "winborder", can be used to indicate that the value of the
560+
|'winborder'| setting should be used instead.
561+
562+
Alternatively, a list of characters can be used to completely control the
563+
appearance of the border.
564+
552565
*commandt.setup.match_listing.icons*
553566
boolean or function (default: true)
554567

@@ -616,6 +629,16 @@ Note that this setting has no effect in buffer listings (ie. those shown by
616629

617630
require('wincent.commandt').setup({ never_show_dot_files = true })
618631

632+
*commandt.setup.prompt.border*
633+
string or list (default: { '┌', '─', '┐', '│', '┤', '─', '├', '│' })
634+
635+
Controls the border of the prompt window. Valid string values are "double",
636+
"none", "rounded", "shadow", "single", or "solid". The special value,
637+
"winborder", can be used to indicate that the value of the |'winborder'|
638+
setting should be used instead.
639+
640+
Alternatively, a list of characters can be used to completely control the
641+
appearance of the border.
619642
*commandt.setup.root_markers*
620643
list of strings (default: various)
621644

@@ -945,7 +968,10 @@ HISTORY *command-t-history*
945968

946969
main (not yet released) ~
947970

948-
- ...
971+
- feat: |commandt.setup.match_listing.border| and |commandt.setup.prompt.border|
972+
now accept "winborder" as a possible value, instructing Command-T to use the
973+
value of the |'winborder'| setting to control the border appearance
974+
(https://github.com/wincent/command-t/issues/436).
949975

950976
6.1 (14 June 2025) ~
951977

lua/wincent/commandt/init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ local options_spec = {
214214
'shadow',
215215
'single',
216216
'solid',
217+
'winborder',
217218
{ kind = 'list', of = { kind = 'string' } },
218219
},
219220
},
@@ -255,6 +256,7 @@ local options_spec = {
255256
'shadow',
256257
'single',
257258
'solid',
259+
'winborder',
258260
{ kind = 'list', of = { kind = 'string' } },
259261
},
260262
},
@@ -586,15 +588,15 @@ local default_options = {
586588
},
587589
margin = 10,
588590
match_listing = {
589-
border = { '', '', '', '', '', '', '', '' }, -- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', or a list of strings.
591+
border = { '', '', '', '', '', '', '', '' }, -- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', 'winborder', or a list of strings.
590592
icons = true,
591593
truncate = 'middle',
592594
},
593595
never_show_dot_files = false,
594596
order = 'forward', -- 'forward', 'reverse'.
595597
position = 'center', -- 'bottom', 'center', 'top'.
596598
prompt = {
597-
border = { '', '', '', '', '', '', '', '' }, -- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', or a list of strings.
599+
border = { '', '', '', '', '', '', '', '' }, -- 'double', 'none', 'rounded', 'shadow', 'single', 'solid', 'winborder', or a list of strings.
598600
},
599601
open = smart_open,
600602
root_markers = { '.git', '.hg', '.svn', '.bzr', '_darcs' },

lua/wincent/commandt/private/match_listing.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local mt = {
1919

2020
function MatchListing.new(options)
2121
options = merge({
22-
border = { '', '', '', ' ', '', '', '', ' ' },
22+
border = nil,
2323
height = 15,
2424
icons = true,
2525
margin = 0,

lua/wincent/commandt/private/prompt.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ local mt = {
2121

2222
function Prompt.new(options)
2323
options = merge({
24-
border = 'single',
24+
border = nil,
2525
mappings = {},
2626
margin = 0,
2727
height = 15,

lua/wincent/commandt/private/ui.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ ui.show = function(finder, options)
105105
-- reset every time we show a new UI.
106106
vim.api.nvim_create_augroup('CommandTWindow', { clear = true })
107107

108+
local border = options.match_listing.border ~= 'winborder' and options.match_listing.border or nil
108109
match_listing = MatchListing.new({
109-
border = options.match_listing.border,
110+
border = border,
110111
height = options.height,
111112
icons = options.kind ~= 'virtual' and options.match_listing.icons or false,
112113
margin = options.margin,
@@ -118,8 +119,9 @@ ui.show = function(finder, options)
118119

119120
results = nil
120121
selected = nil
122+
border = options.prompt.border ~= 'winborder' and options.prompt.border or nil
121123
prompt = Prompt.new({
122-
border = options.prompt.border,
124+
border = border,
123125
height = options.height,
124126
mappings = options.mappings,
125127
margin = options.margin,

lua/wincent/commandt/private/window.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ end
5858

5959
function Window.new(options)
6060
options = merge({
61-
border = 'single',
61+
border = nil,
6262
bottom = nil,
6363
buftype = 'nofile', -- Also, 'prompt'.
6464
filetype = nil,

0 commit comments

Comments
 (0)