File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ local get_pick_letter = function(filename, bufnr)
113
113
-- If the config option pick.use_filename is true, and the initial letter
114
114
-- of the filename is valid and it hasn't already been assigned return that.
115
115
if _G .cokeline .config .pick .use_filename then
116
- local init_letter = filename : sub ( 1 , 1 )
116
+ local init_letter = vim . fn . strcharpart ( filename , 0 , 1 )
117
117
if valid_pick_letters :find (init_letter , nil , true ) then
118
118
valid_pick_letters = valid_pick_letters :gsub (init_letter , " " )
119
119
taken_pick_letters [bufnr ] = init_letter
@@ -123,8 +123,8 @@ local get_pick_letter = function(filename, bufnr)
123
123
124
124
-- Return the first valid letter if there is one.
125
125
if # valid_pick_letters > 0 then
126
- local first_valid = valid_pick_letters : sub ( 1 , 1 )
127
- valid_pick_letters = valid_pick_letters : sub ( 2 )
126
+ local first_valid = vim . fn . strcharpart ( valid_pick_letters , 0 , 1 )
127
+ valid_pick_letters = vim . fn . strcharpart ( valid_pick_letters , 1 , # valid_pick_letters - 1 )
128
128
taken_pick_letters [bufnr ] = first_valid
129
129
return first_valid
130
130
end
You can’t perform that action at this time.
0 commit comments