@google/gemini-cli 0.1.13-nightly.250726.fb751c54 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/google-gemini-cli-0.1.13.tgz +0 -0
- package/dist/package.json +2 -2
- package/dist/src/config/settings.d.ts +0 -1
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +1 -3
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/ui/App.js +31 -42
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +8 -53
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +1 -3
- package/dist/src/ui/commands/types.js +0 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +0 -1
- package/dist/src/ui/components/Footer.js +2 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +0 -2
- package/dist/src/ui/components/InputPrompt.js +1 -5
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +2 -270
- package/dist/src/ui/components/shared/text-buffer.js +70 -415
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +62 -75
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.js +2 -7
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.js +2 -5
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/services/McpPromptLoader.d.ts +0 -25
- package/dist/src/services/McpPromptLoader.js +0 -192
- package/dist/src/services/McpPromptLoader.js.map +0 -1
- package/dist/src/ui/commands/vimCommand.d.ts +0 -7
- package/dist/src/ui/commands/vimCommand.js +0 -23
- package/dist/src/ui/commands/vimCommand.js.map +0 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +0 -72
- package/dist/src/ui/components/shared/vim-buffer-actions.js +0 -565
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +0 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +0 -19
- package/dist/src/ui/contexts/VimModeContext.js +0 -48
- package/dist/src/ui/contexts/VimModeContext.js.map +0 -1
- package/dist/src/ui/hooks/vim.d.ts +0 -28
- package/dist/src/ui/hooks/vim.js +0 -630
- package/dist/src/ui/hooks/vim.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/gemini-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Gemini CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"config": {
|
|
28
|
-
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.
|
|
28
|
+
"sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.14"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@google/gemini-cli-core": "0.1.
|
|
31
|
+
"@google/gemini-cli-core": "0.1.14",
|
|
32
32
|
"@google/genai": "1.9.0",
|
|
33
33
|
"@iarna/toml": "^2.2.5",
|
|
34
34
|
"@types/update-notifier": "^6.0.8",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { Config } from '@google/gemini-cli-core';
|
|
7
|
-
import { SlashCommand } from '../ui/commands/types.js';
|
|
8
|
-
import { ICommandLoader } from './types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Discovers and loads executable slash commands from prompts exposed by
|
|
11
|
-
* Model-Context-Protocol (MCP) servers.
|
|
12
|
-
*/
|
|
13
|
-
export declare class McpPromptLoader implements ICommandLoader {
|
|
14
|
-
private readonly config;
|
|
15
|
-
constructor(config: Config | null);
|
|
16
|
-
/**
|
|
17
|
-
* Loads all available prompts from all configured MCP servers and adapts
|
|
18
|
-
* them into executable SlashCommand objects.
|
|
19
|
-
*
|
|
20
|
-
* @param _signal An AbortSignal (unused for this synchronous loader).
|
|
21
|
-
* @returns A promise that resolves to an array of loaded SlashCommands.
|
|
22
|
-
*/
|
|
23
|
-
loadCommands(_signal: AbortSignal): Promise<SlashCommand[]>;
|
|
24
|
-
private parseArgs;
|
|
25
|
-
}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { getErrorMessage, getMCPServerPrompts, } from '@google/gemini-cli-core';
|
|
7
|
-
import { CommandKind, } from '../ui/commands/types.js';
|
|
8
|
-
/**
|
|
9
|
-
* Discovers and loads executable slash commands from prompts exposed by
|
|
10
|
-
* Model-Context-Protocol (MCP) servers.
|
|
11
|
-
*/
|
|
12
|
-
export class McpPromptLoader {
|
|
13
|
-
config;
|
|
14
|
-
constructor(config) {
|
|
15
|
-
this.config = config;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Loads all available prompts from all configured MCP servers and adapts
|
|
19
|
-
* them into executable SlashCommand objects.
|
|
20
|
-
*
|
|
21
|
-
* @param _signal An AbortSignal (unused for this synchronous loader).
|
|
22
|
-
* @returns A promise that resolves to an array of loaded SlashCommands.
|
|
23
|
-
*/
|
|
24
|
-
loadCommands(_signal) {
|
|
25
|
-
const promptCommands = [];
|
|
26
|
-
if (!this.config) {
|
|
27
|
-
return Promise.resolve([]);
|
|
28
|
-
}
|
|
29
|
-
const mcpServers = this.config.getMcpServers() || {};
|
|
30
|
-
for (const serverName in mcpServers) {
|
|
31
|
-
const prompts = getMCPServerPrompts(this.config, serverName) || [];
|
|
32
|
-
for (const prompt of prompts) {
|
|
33
|
-
const commandName = `${prompt.name}`;
|
|
34
|
-
const newPromptCommand = {
|
|
35
|
-
name: commandName,
|
|
36
|
-
description: prompt.description || `Invoke prompt ${prompt.name}`,
|
|
37
|
-
kind: CommandKind.MCP_PROMPT,
|
|
38
|
-
subCommands: [
|
|
39
|
-
{
|
|
40
|
-
name: 'help',
|
|
41
|
-
description: 'Show help for this prompt',
|
|
42
|
-
kind: CommandKind.MCP_PROMPT,
|
|
43
|
-
action: async () => {
|
|
44
|
-
if (!prompt.arguments || prompt.arguments.length === 0) {
|
|
45
|
-
return {
|
|
46
|
-
type: 'message',
|
|
47
|
-
messageType: 'info',
|
|
48
|
-
content: `Prompt "${prompt.name}" has no arguments.`,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
let helpMessage = `Arguments for "${prompt.name}":\n\n`;
|
|
52
|
-
if (prompt.arguments && prompt.arguments.length > 0) {
|
|
53
|
-
helpMessage += `You can provide arguments by name (e.g., --argName="value") or by position.\n\n`;
|
|
54
|
-
helpMessage += `e.g., ${prompt.name} ${prompt.arguments?.map((_) => `"foo"`)} is equivalent to ${prompt.name} ${prompt.arguments?.map((arg) => `--${arg.name}="foo"`)}\n\n`;
|
|
55
|
-
}
|
|
56
|
-
for (const arg of prompt.arguments) {
|
|
57
|
-
helpMessage += ` --${arg.name}\n`;
|
|
58
|
-
if (arg.description) {
|
|
59
|
-
helpMessage += ` ${arg.description}\n`;
|
|
60
|
-
}
|
|
61
|
-
helpMessage += ` (required: ${arg.required ? 'yes' : 'no'})\n\n`;
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
type: 'message',
|
|
65
|
-
messageType: 'info',
|
|
66
|
-
content: helpMessage,
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
action: async (context, args) => {
|
|
72
|
-
if (!this.config) {
|
|
73
|
-
return {
|
|
74
|
-
type: 'message',
|
|
75
|
-
messageType: 'error',
|
|
76
|
-
content: 'Config not loaded.',
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
const promptInputs = this.parseArgs(args, prompt.arguments);
|
|
80
|
-
if (promptInputs instanceof Error) {
|
|
81
|
-
return {
|
|
82
|
-
type: 'message',
|
|
83
|
-
messageType: 'error',
|
|
84
|
-
content: promptInputs.message,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
const mcpServers = this.config.getMcpServers() || {};
|
|
89
|
-
const mcpServerConfig = mcpServers[serverName];
|
|
90
|
-
if (!mcpServerConfig) {
|
|
91
|
-
return {
|
|
92
|
-
type: 'message',
|
|
93
|
-
messageType: 'error',
|
|
94
|
-
content: `MCP server config not found for '${serverName}'.`,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
const result = await prompt.invoke(promptInputs);
|
|
98
|
-
if (result.error) {
|
|
99
|
-
return {
|
|
100
|
-
type: 'message',
|
|
101
|
-
messageType: 'error',
|
|
102
|
-
content: `Error invoking prompt: ${result.error}`,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
if (!result.messages?.[0]?.content?.text) {
|
|
106
|
-
return {
|
|
107
|
-
type: 'message',
|
|
108
|
-
messageType: 'error',
|
|
109
|
-
content: 'Received an empty or invalid prompt response from the server.',
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
type: 'submit_prompt',
|
|
114
|
-
content: JSON.stringify(result.messages[0].content.text),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
return {
|
|
119
|
-
type: 'message',
|
|
120
|
-
messageType: 'error',
|
|
121
|
-
content: `Error: ${getErrorMessage(error)}`,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
completion: async (_, partialArg) => {
|
|
126
|
-
if (!prompt || !prompt.arguments) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
const suggestions = [];
|
|
130
|
-
const usedArgNames = new Set((partialArg.match(/--([^=]+)/g) || []).map((s) => s.substring(2)));
|
|
131
|
-
for (const arg of prompt.arguments) {
|
|
132
|
-
if (!usedArgNames.has(arg.name)) {
|
|
133
|
-
suggestions.push(`--${arg.name}=""`);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return suggestions;
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
promptCommands.push(newPromptCommand);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return Promise.resolve(promptCommands);
|
|
143
|
-
}
|
|
144
|
-
parseArgs(userArgs, promptArgs) {
|
|
145
|
-
const argValues = {};
|
|
146
|
-
const promptInputs = {};
|
|
147
|
-
// arg parsing: --key="value" or --key=value
|
|
148
|
-
const namedArgRegex = /--([^=]+)=(?:"((?:\\.|[^"\\])*)"|([^ ]*))/g;
|
|
149
|
-
let match;
|
|
150
|
-
const remainingArgs = [];
|
|
151
|
-
let lastIndex = 0;
|
|
152
|
-
while ((match = namedArgRegex.exec(userArgs)) !== null) {
|
|
153
|
-
const key = match[1];
|
|
154
|
-
const value = match[2] ?? match[3]; // Quoted or unquoted value
|
|
155
|
-
argValues[key] = value;
|
|
156
|
-
// Capture text between matches as potential positional args
|
|
157
|
-
if (match.index > lastIndex) {
|
|
158
|
-
remainingArgs.push(userArgs.substring(lastIndex, match.index).trim());
|
|
159
|
-
}
|
|
160
|
-
lastIndex = namedArgRegex.lastIndex;
|
|
161
|
-
}
|
|
162
|
-
// Capture any remaining text after the last named arg
|
|
163
|
-
if (lastIndex < userArgs.length) {
|
|
164
|
-
remainingArgs.push(userArgs.substring(lastIndex).trim());
|
|
165
|
-
}
|
|
166
|
-
const positionalArgs = remainingArgs.join(' ').split(/ +/);
|
|
167
|
-
if (!promptArgs) {
|
|
168
|
-
return promptInputs;
|
|
169
|
-
}
|
|
170
|
-
for (const arg of promptArgs) {
|
|
171
|
-
if (argValues[arg.name]) {
|
|
172
|
-
promptInputs[arg.name] = argValues[arg.name];
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const unfilledArgs = promptArgs.filter((arg) => arg.required && !promptInputs[arg.name]);
|
|
176
|
-
const missingArgs = [];
|
|
177
|
-
for (let i = 0; i < unfilledArgs.length; i++) {
|
|
178
|
-
if (positionalArgs.length > i && positionalArgs[i]) {
|
|
179
|
-
promptInputs[unfilledArgs[i].name] = positionalArgs[i];
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
missingArgs.push(unfilledArgs[i].name);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (missingArgs.length > 0) {
|
|
186
|
-
const missingArgNames = missingArgs.map((name) => `--${name}`).join(', ');
|
|
187
|
-
return new Error(`Missing required argument(s): ${missingArgNames}`);
|
|
188
|
-
}
|
|
189
|
-
return promptInputs;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
//# sourceMappingURL=McpPromptLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpPromptLoader.js","sourceRoot":"","sources":["../../../src/services/McpPromptLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,WAAW,GAGZ,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD;;;;;;OAMG;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E,EAAE,CAAC;YAC7C,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnD,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YACzD,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1E,OAAO,IAAI,KAAK,CAAC,iCAAiC,eAAe,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { CommandKind } from './types.js';
|
|
7
|
-
export const vimCommand = {
|
|
8
|
-
name: 'vim',
|
|
9
|
-
description: 'toggle vim mode on/off',
|
|
10
|
-
kind: CommandKind.BUILT_IN,
|
|
11
|
-
action: async (context, _args) => {
|
|
12
|
-
const newVimState = await context.ui.toggleVimEnabled();
|
|
13
|
-
const message = newVimState
|
|
14
|
-
? 'Entered Vim mode. Run /vim again to exit.'
|
|
15
|
-
: 'Exited Vim mode.';
|
|
16
|
-
return {
|
|
17
|
-
type: 'message',
|
|
18
|
-
messageType: 'info',
|
|
19
|
-
content: message,
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=vimCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vimCommand.js","sourceRoot":"","sources":["../../../../src/ui/commands/vimCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,UAAU,GAAiB;IACtC,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,WAAW,CAAC,QAAQ;IAC1B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAExD,MAAM,OAAO,GAAG,WAAW;YACzB,CAAC,CAAC,2CAA2C;YAC7C,CAAC,CAAC,kBAAkB,CAAC;QACvB,OAAO;YACL,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,MAAM;YACnB,OAAO,EAAE,OAAO;SACjB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { TextBufferState, TextBufferAction } from './text-buffer.js';
|
|
7
|
-
export type VimAction = Extract<TextBufferAction, {
|
|
8
|
-
type: 'vim_delete_word_forward';
|
|
9
|
-
} | {
|
|
10
|
-
type: 'vim_delete_word_backward';
|
|
11
|
-
} | {
|
|
12
|
-
type: 'vim_delete_word_end';
|
|
13
|
-
} | {
|
|
14
|
-
type: 'vim_change_word_forward';
|
|
15
|
-
} | {
|
|
16
|
-
type: 'vim_change_word_backward';
|
|
17
|
-
} | {
|
|
18
|
-
type: 'vim_change_word_end';
|
|
19
|
-
} | {
|
|
20
|
-
type: 'vim_delete_line';
|
|
21
|
-
} | {
|
|
22
|
-
type: 'vim_change_line';
|
|
23
|
-
} | {
|
|
24
|
-
type: 'vim_delete_to_end_of_line';
|
|
25
|
-
} | {
|
|
26
|
-
type: 'vim_change_to_end_of_line';
|
|
27
|
-
} | {
|
|
28
|
-
type: 'vim_change_movement';
|
|
29
|
-
} | {
|
|
30
|
-
type: 'vim_move_left';
|
|
31
|
-
} | {
|
|
32
|
-
type: 'vim_move_right';
|
|
33
|
-
} | {
|
|
34
|
-
type: 'vim_move_up';
|
|
35
|
-
} | {
|
|
36
|
-
type: 'vim_move_down';
|
|
37
|
-
} | {
|
|
38
|
-
type: 'vim_move_word_forward';
|
|
39
|
-
} | {
|
|
40
|
-
type: 'vim_move_word_backward';
|
|
41
|
-
} | {
|
|
42
|
-
type: 'vim_move_word_end';
|
|
43
|
-
} | {
|
|
44
|
-
type: 'vim_delete_char';
|
|
45
|
-
} | {
|
|
46
|
-
type: 'vim_insert_at_cursor';
|
|
47
|
-
} | {
|
|
48
|
-
type: 'vim_append_at_cursor';
|
|
49
|
-
} | {
|
|
50
|
-
type: 'vim_open_line_below';
|
|
51
|
-
} | {
|
|
52
|
-
type: 'vim_open_line_above';
|
|
53
|
-
} | {
|
|
54
|
-
type: 'vim_append_at_line_end';
|
|
55
|
-
} | {
|
|
56
|
-
type: 'vim_insert_at_line_start';
|
|
57
|
-
} | {
|
|
58
|
-
type: 'vim_move_to_line_start';
|
|
59
|
-
} | {
|
|
60
|
-
type: 'vim_move_to_line_end';
|
|
61
|
-
} | {
|
|
62
|
-
type: 'vim_move_to_first_nonwhitespace';
|
|
63
|
-
} | {
|
|
64
|
-
type: 'vim_move_to_first_line';
|
|
65
|
-
} | {
|
|
66
|
-
type: 'vim_move_to_last_line';
|
|
67
|
-
} | {
|
|
68
|
-
type: 'vim_move_to_line';
|
|
69
|
-
} | {
|
|
70
|
-
type: 'vim_escape_insert_mode';
|
|
71
|
-
}>;
|
|
72
|
-
export declare function handleVimAction(state: TextBufferState, action: VimAction): TextBufferState;
|