File tree 3 files changed +5
-3
lines changed
objects/edit_special/types
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -397,7 +397,7 @@ function Config:setup_ts_predicates()
397
397
if not text or vim .trim (text ) == ' ' then
398
398
return
399
399
end
400
- metadata [' injection.language' ] = utils .detect_filetype (text ) or text : lower ()
400
+ metadata [' injection.language' ] = utils .detect_filetype (text )
401
401
end , { force = true })
402
402
end
403
403
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ function EditSpecialSrc:init()
74
74
-- so base the range off of the name of the block
75
75
local ft = self .src_block .children .parameters .text
76
76
if ft then
77
- ft = utils .detect_filetype (ft ) or ft : lower ()
77
+ ft = utils .detect_filetype (ft )
78
78
end
79
79
80
80
local bufnr = es_utils .make_temp_buf ()
Original file line number Diff line number Diff line change @@ -567,6 +567,8 @@ function utils.find(entries, check_fn)
567
567
return nil
568
568
end
569
569
570
+ --- @param name string
571
+ --- @return string
570
572
function utils .detect_filetype (name )
571
573
local map = {
572
574
[' emacs-lisp' ] = ' lisp' ,
@@ -586,7 +588,7 @@ function utils.detect_filetype(name)
586
588
if map [name ] then
587
589
return map [name ]
588
590
end
589
- return nil
591
+ return name : lower ()
590
592
end
591
593
592
594
return utils
You can’t perform that action at this time.
0 commit comments