ScrapVim-lite-3/VimCommand
ScrapVim-lite-3/ParseStateFunctionで解析したcommandを保持するobject
このobjectにある情報だけでcommandを実行できるようになっている
interface
code:ts
type VimCommand = {
command: (params: Params) => void;
params: Params;
};
どんなcommandもcommand(params)で実行できる
関数に渡す引数
code:ts
type Params = {
register?: Register;
count?: number;
char?: string;
range?: {
command: (props: RangeParams) => Selections;
params: RangeParams;
}
};
type RangeParams = {count?: number};
from normal modeをJavascript Objectで表現してみる#5fd3d0db1280f00000b9e82c
propertiesの解説
Selectionsは選択範囲を表すobject
scrapbox-selectionの返り値
registerに使用したいレジスタを入れる
rangeでoperatorの処理範囲を決める
#2020-12-18 01:28:08