Skip to content

Commit 8ca593b

Browse files
committed
feat: language support in ---@usage
1 parent e0f39c5 commit 8ca593b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/vimdoc/usage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ impl ToDoc for UsageDoc {
1010
fn to_doc(n: &Self::N, _: &super::Settings) -> String {
1111
let mut doc = String::new();
1212
doc.push_str(&description("Usage: ~"));
13-
doc.push_str(" >\n");
13+
doc.push_str(">lua\n");
1414
doc.push_str(&textwrap::indent(&n.code, " "));
1515
doc.push('\n');
16-
doc.push_str(" <\n\n");
16+
doc.push_str("<\n\n");
1717
doc
1818
}
1919
}

tests/basic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ U.sub({this}, {that}) *U.sub*
260260
we don't know about
261261
262262
Usage: ~
263-
>
263+
>lua
264264
require('module.U').sub(10, 5)
265-
<
265+
<
266266
267267
268268
U.magical({this}, {that}) *U.magical*
@@ -469,12 +469,12 @@ U:create() *U:create*
469469
(Human)
470470
471471
Usage: ~
472-
>
472+
>lua
473473
local H = require('Human')
474474
local human = H:create()
475475
476476
print(getmetatable(human))
477-
<
477+
<
478478
479479
480480
================================================================================
@@ -614,9 +614,9 @@ U.VMODE *U.VMODE*
614614
(VMode)
615615
616616
Usage: ~
617-
>
617+
>lua
618618
print(require('plugin').VMODE)
619-
<
619+
<
620620
621621
622622
"#

tests/with_settings.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ U:create() *U:create*
6868
(number)
6969
7070
Usage: ~
71-
>
71+
>lua
7272
require('Pi'):create()
73-
<
73+
<
7474
7575
7676
"
@@ -126,9 +126,9 @@ U:create() *awesome:create*
126126
(number)
127127
128128
Usage: ~
129-
>
129+
>lua
130130
require('Pi'):create()
131-
<
131+
<
132132
133133
134134
"

0 commit comments

Comments
 (0)