We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8289fb3 commit 3a2ba4fCopy full SHA for 3a2ba4f
README.md
@@ -362,6 +362,7 @@ local ft = require('Comment.ft')
362
ft.set('javascript', {'//%s', '/*%s*/'})
363
364
-- set line, block and override commentstring
365
+-- for particular treesitter nodes
366
ft.set("javascript", {
367
"// %s",
368
"/*%s*/",
@@ -447,17 +448,6 @@ There are multiple ways to contribute reporting/fixing bugs, feature requests. Y
447
448
- Live upto the expectation of `tcomment`
449
- Basic INSERT mode mappings
450
- Doc comment i.e `/**%s*/` (js), `///%s` (rust)
-
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
461
- Header comment
462
463
```lua
lua/Comment/comment.lua
@@ -15,7 +15,6 @@ function C.comment()
15
local pattern = U.get_pattern(C.config.ignore)
16
if not U.ignore(line, pattern) then
17
local ctx = Ctx:new({
18
- lang = U.get_lang(),
19
cmode = U.cmode.comment,
20
cmotion = U.cmotion.line,
21
ctype = U.ctype.line,
lua/Comment/ctx.lua
@@ -18,7 +18,6 @@ function Ctx:new(opts)
opts.lang = ts.get_lang()
opts.contained = ts.get_containing_node()
- opts.other = true
22
23
return setmetatable(opts, self)
24
end
lua/Comment/ft.lua
@@ -26,8 +26,28 @@ local L = {
26
html = { M.html_b, M.html_b },
27
idris = { M.dash, M.haskell_b },
28
java = { M.cxx_l, M.cxx_b },
29
- javascript = { M.cxx_l, M.cxx_b },
30
- javascriptreact = { M.cxx_l, M.cxx_b },
+ javascript = {
+ 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
42
43
44
45
46
47
48
49
50
51
julia = { M.hash, '#=%s=#' },
52
lidris = { M.dash, M.haskell_b },
53
lua = { M.dash, '--[[%s--]]' },
0 commit comments