Skip to content

Commit ed18b8a

Browse files
committed
fixup
1 parent 6537549 commit ed18b8a

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ local ft = require('Comment.ft')
370370
ft.set('javascript', {'//%s', '/*%s*/'})
371371

372372
-- set line, block and override commentstring
373+
-- for particular treesitter nodes
373374
ft.set("javascript", {
374375
"// %s",
375376
"/*%s*/",
@@ -455,17 +456,6 @@ There are multiple ways to contribute reporting/fixing bugs, feature requests. Y
455456
- Live upto the expectation of `tcomment`
456457
- Basic INSERT mode mappings
457458
- Doc comment i.e `/**%s*/` (js), `///%s` (rust)
458-
459-
- Inbuilt context commentstring using treesitter
460-
461-
```lua
462-
{
463-
pre_hook = function()
464-
return require('Comment.ts').commentstring()
465-
end
466-
}
467-
```
468-
469459
- Header comment
470460

471461
```lua

lua/Comment/comment.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function C.comment()
1515
local pattern = U.get_pattern(C.config.ignore)
1616
if not U.ignore(line, pattern) then
1717
local ctx = Ctx:new({
18-
lang = U.get_lang(),
1918
cmode = U.cmode.comment,
2019
cmotion = U.cmotion.line,
2120
ctype = U.ctype.line,

lua/Comment/ctx.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function Ctx:new(opts)
1818

1919
opts.lang = ts.get_lang()
2020
opts.contained = ts.get_containing_node()
21-
opts.other = true
2221

2322
return setmetatable(opts, self)
2423
end

lua/Comment/ft.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,28 @@ local L = {
2828
html = { M.html_b, M.html_b },
2929
idris = { M.dash, M.haskell_b },
3030
java = { M.cxx_l, M.cxx_b },
31-
javascript = { M.cxx_l, M.cxx_b },
32-
javascriptreact = { M.cxx_l, M.cxx_b },
31+
javascript = {
32+
M.cxx_l,
33+
M.cxx_b,
34+
35+
jsx_fragment = { '{/* %s */}' },
36+
jsx_element = { '{/* %s */}' },
37+
jsx_attribute = { '// %s' },
38+
jsx_expression = { '// %s', '/*%s*/' },
39+
call_expression = { '// %s', '/*%s*/' },
40+
statement_block = { '// %s' },
41+
},
42+
javascriptreact = {
43+
M.cxx_l,
44+
M.cxx_b,
45+
46+
jsx_fragment = { '{/* %s */}' },
47+
jsx_element = { '{/* %s */}' },
48+
jsx_attribute = { '// %s' },
49+
jsx_expression = { '// %s', '/*%s*/' },
50+
call_expression = { '// %s', '/*%s*/' },
51+
statement_block = { '// %s' },
52+
},
3353
julia = { M.hash, '#=%s=#' },
3454
lidris = { M.dash, M.haskell_b },
3555
lua = { M.dash, '--[[%s--]]' },

0 commit comments

Comments
 (0)