Skip to content

Commit

Permalink
general fixes pointed out by plugin reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
qaptoR committed Mar 31, 2023
1 parent 67cae75 commit 942792a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This plugin is designed to enrich the command use experience by enabling repeated command iterations.

eg. When using 'Advanced Tables' community plguin and you need to move a row up 20 times, rather than click the button in the sidebar GUI or
eg. When using 'Advanced Tables' community plugin and you need to move a row up 20 times, rather than click the button in the sidebar GUI or
repeatedly call the command exhaustively, use Commando to call the command once and have it repeat 20 times per your instruction!

Commando is so named to be reminiscent of the community plugin 'Commander' which enables creating command macros. (see also 'QuickAdd').
Expand All @@ -28,13 +28,13 @@ a production or day to day vault.

In order to use the Vim Buffer feature you cannot use the plugin 'Sequence HotKeys' to open the Commando Palette.
The way that plugin operates consumes the buffer before any command can be chosen from the palette.
Instead, it's recommended to set the hoteky to something like \<alt + shift + p\> using the obsidian hotkey settings.
Instead, it's recommended to set the hotkey to something like \<alt + shift + p\> using the obsidian hotkey settings.

## Features

- equip dedicated 'Commando Palette'. One command to rule them all!
- use vim numeric prefix buffer as iteration count
- set default iteration delay and optional perinvocation delay override
- set default iteration delay and optional per-invocation delay override
- optional continue iteration prompts
- instant breakout from iteration with \<Ctrl + c\>
- SEE the vim keyBuffer (and optionally limit numeric prefix buffer) in the status bar!
Expand Down Expand Up @@ -68,7 +68,7 @@ From this modal, type any of the following:

If opted for, this per-iteration prompt offers an opportunity to assess any changes before continuing.

Don't worry though, every milisecond waiting is already counting down the delay timer, so wait times will
Don't worry though, every millisecond waiting is already counting down the delay timer, so wait times will
always be the greater of: the delay timer OR how long you waited to continue. They will never combine.

From this modal, continue by doing any of the following:
Expand Down Expand Up @@ -107,7 +107,7 @@ typed?
Well fret no more! In order to save users the frustration of accidentally calling a command 1000s of times, the vim
keyBuffer is now visible in the status bar.

Commando goes a little further though. Plugin ettings allow you to set a max vim buffer for the numeric prefix, so
Commando goes a little further though. Plugin settings allow you to set a max vim buffer for the numeric prefix, so
that you might never again run a vim motion, or command more than 9, 99, 999 ... times again!

### Command Delay
Expand Down
17 changes: 10 additions & 7 deletions src/vim-modal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


import CommandoPlugin from "main";
import { CommandoPlugin } from "main";
import { Setting, FuzzySuggestModal, App, Command, Notice, Instruction, Modal } from "obsidian";


Expand Down Expand Up @@ -79,13 +79,16 @@ export default class CommandoVimModal extends FuzzySuggestModal<Command> {

getItems(): Command[] {

const commands :Command[] = [];
// const commands :Command[] = [];
// // @ts-ignore
// for (const command in this.app.commands.commands) {
// // @ts-ignore
// commands.push(this.app.commands.commands[command]);
// }
// return commands;

// @ts-ignore
for (const command in this.app.commands.commands) {
// @ts-ignore
commands.push(this.app.commands.commands[command]);
}
return commands;
return this.app.commands.listCommands();
}


Expand Down

0 comments on commit 942792a

Please sign in to comment.