Skip to content

Commit

Permalink
fix!: don't return native commentstring from ft.get()
Browse files Browse the repository at this point in the history
Fixes #328
  • Loading branch information
numToStr committed Apr 12, 2023
1 parent ab62084 commit 534ff73
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/Comment/ft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ end
---@param lang string Filetype/Language of the buffer
---@param ctype? integer See |comment.utils.ctype|. If given `nil`, it'll
---return a copy of { line, block } commentstring.
---@return nil|string|string[] #Returns stored commentstring, if {lang} is not
---recognized then returns native |commentstring|
---@return nil|string|string[] #Returns stored commentstring
---@usage [[
---local ft = require('Comment.ft')
---local U = require('Comment.utils')
Expand All @@ -201,7 +200,7 @@ end
function ft.get(lang, ctype)
local tuple = L[lang]
if not tuple then
return vim.bo.commentstring
return nil
end
if not ctype then
return vim.deepcopy(tuple)
Expand Down

0 comments on commit 534ff73

Please sign in to comment.