@@ -138,9 +138,10 @@ local function project_list(config, callback)
138138 if list then
139139 list = vim .list_slice (list , # list - config .project .limit )
140140 end
141+ local blank_size = config .shortcuts_left_side and 4 or 3
141142 for _ , dir in ipairs (list or {}) do
142143 dir = dir :gsub (vim .env .HOME , ' ~' )
143- table.insert (res , (' ' ):rep (3 ) .. ' ' .. dir )
144+ table.insert (res , (' ' ):rep (blank_size ) .. ' ' .. dir )
144145 end
145146
146147 if # res == 0 then
@@ -200,6 +201,7 @@ local function mru_list(config)
200201 end , mlist )
201202 end
202203
204+ local blank_size = config .shortcuts_left_side and 4 or 3
203205 for _ , file in pairs (vim .list_slice (mlist , 1 , config .mru .limit )) do
204206 local filename = vim .fn .fnamemodify (file , ' :t' )
205207 local icon , group = utils .get_icon (filename )
@@ -211,7 +213,7 @@ local function mru_list(config)
211213 end
212214 file = icon .. ' ' .. file
213215 table.insert (groups , { # icon , group })
214- table.insert (list , (' ' ):rep (3 ) .. file )
216+ table.insert (list , (' ' ):rep (blank_size ) .. file )
215217 end
216218
217219 if # list == 1 then
@@ -414,10 +416,17 @@ local function gen_center(plist, config)
414416 local text = api .nvim_buf_get_lines (config .bufnr , first_line + i - 1 , first_line + i , false )[1 ]
415417 if text and text :find (' %w' ) and not text :find (' empty' ) then
416418 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
421430 map_key (config , key , text )
422431 end
423432 end
@@ -464,10 +473,17 @@ local function gen_center(plist, config)
464473 )[1 ]
465474 if text and text :find (' %w' ) then
466475 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
471487 map_key (config , key , text )
472488 end
473489 end
0 commit comments