Skip to content

Commit

Permalink
docs: detail *all actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lioness100 committed Feb 12, 2023
1 parent 05019d3 commit 4c89994
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ import { fileURLToPath } from 'node:url';
import type { Issue, ProgressItem } from 'cspell';
import { prompt, registerPrompt } from 'inquirer';
import { default as inquirerSuggestionPlugin } from 'inquirer-prompt-suggest';
import { bold, cyan, dim, gray, green, greenBright, red, underline, whiteBright, yellow } from 'colorette';
import {
bold,
cyan,
dim,
gray,
green,
greenBright,
red,
underline,
whiteBright,
yellow,
yellowBright
} from 'colorette';
import { type Spinner, createSpinner } from 'nanospinner';
import { Action, previousState } from './shared';

Expand Down Expand Up @@ -77,16 +89,22 @@ export const determineAction = async (
{ name: 'Replace', value: Action.Replace },
...(otherTypoInstancesCount
? [
{ name: `Ignore All (${cyan(otherTypoInstancesCount + 1)})`, value: Action.IgnoreAll },
{ name: `Replace All (${cyan(otherTypoInstancesCount + 1)})`, value: Action.ReplaceAll }
{
name: `Ignore All Occurrences (${cyan(otherTypoInstancesCount + 1)})`,
value: Action.IgnoreAll
},
{
name: `Replace All Occurrences (${cyan(otherTypoInstancesCount + 1)})`,
value: Action.ReplaceAll
}
]
: []),
{ name: `Skip File (${cyan(otherTyposInFileCount + 1)})`, value: Action.SkipFile },
// The explicit undefined check is needed because Action.Ignore is 0, which is falsy.
...(previousState.action !== undefined && previousState.action !== Action.UndoLastAction
? [
{
name: yellow('Undo Last Action'),
name: yellowBright('Undo Last Action'),
value: Action.UndoLastAction
}
]
Expand Down

0 comments on commit 4c89994

Please sign in to comment.