Skip to content

Commit 3a2ba4f

Browse files
committed
fixup
1 parent 8289fb3 commit 3a2ba4f

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
@@ -362,6 +362,7 @@ local ft = require('Comment.ft')
362362
ft.set('javascript', {'//%s', '/*%s*/'})
363363

364364
-- set line, block and override commentstring
365+
-- for particular treesitter nodes
365366
ft.set("javascript", {
366367
"// %s",
367368
"/*%s*/",
@@ -447,17 +448,6 @@ There are multiple ways to contribute reporting/fixing bugs, feature requests. Y
447448
- Live upto the expectation of `tcomment`
448449
- Basic INSERT mode mappings
449450
- Doc comment i.e `/**%s*/` (js), `///%s` (rust)
450-
451-
- Inbuilt context commentstring using treesitter
452-
453-
```lua
454-
{
455-
pre_hook = function()
456-
return require('Comment.ts').commentstring()
457-
end
458-
}
459-
```
460-
461451
- Header comment
462452

463453
```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
@@ -26,8 +26,28 @@ local L = {
2626
html = { M.html_b, M.html_b },
2727
idris = { M.dash, M.haskell_b },
2828
java = { M.cxx_l, M.cxx_b },
29-
javascript = { M.cxx_l, M.cxx_b },
30-
javascriptreact = { M.cxx_l, M.cxx_b },
29+
javascript = {
30+
M.cxx_l,
31+
M.cxx_b,
32+
33+
jsx_fragment = { '{/* %s */}' },
34+
jsx_element = { '{/* %s */}' },
35+
jsx_attribute = { '// %s' },
36+
jsx_expression = { '// %s', '/*%s*/' },
37+
call_expression = { '// %s', '/*%s*/' },
38+
statement_block = { '// %s' },
39+
},
40+
javascriptreact = {
41+
M.cxx_l,
42+
M.cxx_b,
43+
44+
jsx_fragment = { '{/* %s */}' },
45+
jsx_element = { '{/* %s */}' },
46+
jsx_attribute = { '// %s' },
47+
jsx_expression = { '// %s', '/*%s*/' },
48+
call_expression = { '// %s', '/*%s*/' },
49+
statement_block = { '// %s' },
50+
},
3151
julia = { M.hash, '#=%s=#' },
3252
lidris = { M.dash, M.haskell_b },
3353
lua = { M.dash, '--[[%s--]]' },

0 commit comments

Comments
 (0)