Skip to content

Commit

Permalink
add version ex command
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Jun 27, 2024
1 parent 160a7fd commit d9a9ac0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "cm-runtests",
"static": "tsc --noEmit",
"testAll": "yarn run static && yarn run test && cd dev/cm5 && yarn run buildAndTest",
"build": "cm-buildhelper src/index.ts",
"build": "cm-buildhelper src/index.ts && node scripts/addVersion.cjs",
"publish": "yarn run build && npm publish",
"prepare": "yarn run build"
},
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export type vimOption = {
}


export type ExFn = ()=> void;
export type ExFn = (cm: CodeMirrorV, params: ExParams)=> void;

type allCommands = {
keys: string,
Expand Down
4 changes: 4 additions & 0 deletions src/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -6216,6 +6216,10 @@ export function initVim(CodeMirror) {

var exCommandDispatcher = new ExCommandDispatcher();

vimApi.defineEx("version", "ve", (cm) => {
showConfirm(cm, "Codemirror-vim version: <DEV>");
});

/**
* @arg {CodeMirrorV} cm CodeMirror instance we are in.
* @arg {boolean} confirm Whether to confirm each replace.
Expand Down

0 comments on commit d9a9ac0

Please sign in to comment.