@@ -138,9 +138,10 @@ local function project_list(config, callback)
138
138
if list then
139
139
list = vim .list_slice (list , # list - config .project .limit )
140
140
end
141
+ local blank_size = config .shortcuts_left_side and 4 or 3
141
142
for _ , dir in ipairs (list or {}) do
142
143
dir = dir :gsub (vim .env .HOME , ' ~' )
143
- table.insert (res , (' ' ):rep (3 ) .. ' ' .. dir )
144
+ table.insert (res , (' ' ):rep (blank_size ) .. ' ' .. dir )
144
145
end
145
146
146
147
if # res == 0 then
@@ -200,6 +201,7 @@ local function mru_list(config)
200
201
end , mlist )
201
202
end
202
203
204
+ local blank_size = config .shortcuts_left_side and 4 or 3
203
205
for _ , file in pairs (vim .list_slice (mlist , 1 , config .mru .limit )) do
204
206
local filename = vim .fn .fnamemodify (file , ' :t' )
205
207
local icon , group = utils .get_icon (filename )
@@ -211,7 +213,7 @@ local function mru_list(config)
211
213
end
212
214
file = icon .. ' ' .. file
213
215
table.insert (groups , { # icon , group })
214
- table.insert (list , (' ' ):rep (3 ) .. file )
216
+ table.insert (list , (' ' ):rep (blank_size ) .. file )
215
217
end
216
218
217
219
if # list == 1 then
@@ -414,10 +416,17 @@ local function gen_center(plist, config)
414
416
local text = api .nvim_buf_get_lines (config .bufnr , first_line + i - 1 , first_line + i , false )[1 ]
415
417
if text and text :find (' %w' ) and not text :find (' empty' ) then
416
418
local key = tostring (hotkey ())
417
- api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i - 1 , 0 , {
418
- virt_text = { { key , ' DashboardShortCut' } },
419
- virt_text_pos = ' eol' ,
420
- })
419
+ if config .shortcuts_left_side then
420
+ api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i - 1 , start_col - 1 , {
421
+ virt_text = { { key , ' DashboardShortCut' } },
422
+ virt_text_pos = ' inline' ,
423
+ })
424
+ else
425
+ api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i - 1 , 0 , {
426
+ virt_text = { { key , ' DashboardShortCut' } },
427
+ virt_text_pos = ' eol' ,
428
+ })
429
+ end
421
430
map_key (config , key , text )
422
431
end
423
432
end
@@ -464,10 +473,17 @@ local function gen_center(plist, config)
464
473
)[1 ]
465
474
if text and text :find (' %w' ) then
466
475
local key = tostring (hotkey ())
467
- api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i + plist_len , 0 , {
468
- virt_text = { { key , ' DashboardShortCut' } },
469
- virt_text_pos = ' eol' ,
470
- })
476
+ if config .shortcuts_left_side then
477
+ api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i + plist_len , start_col - 1 , {
478
+ virt_text = { { key , ' DashboardShortCut' } },
479
+ virt_text_pos = ' inline' ,
480
+ })
481
+ else
482
+ api .nvim_buf_set_extmark (config .bufnr , ns , first_line + i + plist_len , 0 , {
483
+ virt_text = { { key , ' DashboardShortCut' } },
484
+ virt_text_pos = ' eol' ,
485
+ })
486
+ end
471
487
map_key (config , key , text )
472
488
end
473
489
end
0 commit comments