Skip to content

Commit 3f1ad54

Browse files
committed
Support Vimscript comments (")
1 parent ab4f3cc commit 3f1ad54

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/vimscript/exCommandParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type ArgParser = Parser<ExCommand>;
6767
*/
6868
export const builtinExCommands: ReadonlyArray<[[string, string], ArgParser | undefined]> = [
6969
[['', ''], succeed(new GotoLineCommand())],
70+
[['"', ''], all.map((_) => new NoOpCommand())],
7071
[['!', ''], BangCommand.argParser],
7172
[['#', ''], PrintCommand.argParser({ printNumbers: true, printText: true })],
7273
[['#!', ''], all.map((_) => new NoOpCommand())],
@@ -705,7 +706,6 @@ export const exCommandParser: Parser<{
705706
const [command, trailing] = result.value;
706707
if (trailing) {
707708
// TODO: Implement `:help :bar`
708-
// TODO: Implement `:help :comment`
709709
throw VimError.TrailingCharacters(trailing);
710710
}
711711
return { name, lineRange, command };

test/vimscript/exCommandParse.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ suite('Ex command parsing', () => {
7474
exParseTest(':,', new GotoLineCommand());
7575
});
7676

77+
suite(':"', () => {
78+
exParseTest(':"', new NoOpCommand());
79+
exParseTest(':"I am a comment', new NoOpCommand());
80+
});
81+
7782
suite(':!', () => {
7883
// TODO
7984
});

0 commit comments

Comments
 (0)