mirror of
https://github.com/jasonwilliams/vscode-helix.git
synced 2024-09-11 16:56:32 +03:00
Add .prettierignore
and yarn prettier
command
This commit is contained in:
parent
210ad6b96d
commit
1d09e2a8b7
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@ -0,0 +1,2 @@
|
||||
.vscode-test
|
||||
out
|
@ -1,6 +1,6 @@
|
||||
# Change Log
|
||||
|
||||
## ***NOTE: For versions 1.23.0 and newer, include the lastest changes; please see [CHANGELOG.md](CHANGELOG.md).***
|
||||
## **_NOTE: For versions 1.23.0 and newer, include the lastest changes; please see [CHANGELOG.md](CHANGELOG.md)._**
|
||||
|
||||
## [v1.22.2](https://github.com/vscodevim/vim/tree/v1.22.2) (2022-02-18)
|
||||
|
||||
|
110
README.md
110
README.md
@ -123,30 +123,30 @@ Below is an example of a [settings.json](https://code.visualstudio.com/Docs/cust
|
||||
|
||||
These settings are specific to VSCodeVim.
|
||||
|
||||
| Setting | Description | Type | Default Value |
|
||||
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------- |
|
||||
| vim.changeWordIncludesWhitespace | Include trailing whitespace when changing word. This configures the <kbd>cw</kbd> action to act consistently as its siblings (<kbd>yw</kbd> and <kbd>dw</kbd>) instead of acting as <kbd>ce</kbd>. | Boolean | false |
|
||||
| vim.cursorStylePerMode._{Mode}_ | Configure a specific cursor style for _{Mode}_. Omitted modes will use [default cursor type](https://github.com/VSCodeVim/Vim/blob/4a6fde6dbd4d1fac1f204c0dc27c32883651ef1a/src/mode/mode.ts#L34) Supported cursors: line, block, underline, line-thin, block-outline, and underline-thin. | String | None |
|
||||
| vim.digraphs._{shorthand}_ | Set custom digraph shorthands that can override the default ones. Entries should map a two-character shorthand to a descriptive string and one or more UTF16 code points. Example: `"R!": ["🚀", [55357, 56960]]` | Object | `{"R!": ["🚀", [0xD83D, 0xDE80]]` |
|
||||
| vim.debug.silent | Boolean indicating whether log messages will be suppressed. | Boolean | false |
|
||||
| vim.debug.loggingLevelForConsole | Maximum level of messages to log to console. Logs are visible in the [developer tools](https://code.visualstudio.com/docs/extensions/developing-extensions#_developer-tools-console). Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
|
||||
| vim.debug.loggingLevelForAlert | Maximum level of messages to present as VS Code information window. Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
|
||||
| vim.disableExtension | Disable VSCodeVim extension. This setting can also be toggled using `toggleVim` command in the Command Palette | Boolean | false |
|
||||
| vim.handleKeys | Delegate configured keys to be handled by VS Code instead of by the VSCodeVim extension. Any key in `keybindings` section of the [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json) that has a `vim.use<C-...>` in the `when` argument can be delegated back to VS Code by setting `"<C-...>": false`. Example: to use `ctrl+f` for find (native VS Code behavior): `"vim.handleKeys": { "<C-f>": false }`. | String | `"<C-d>": true`<br /> `"<C-s>": false`<br /> `"<C-z>": false` |
|
||||
| vim.overrideCopy | Override VS Code's copy command with our own, which works correctly with VSCodeVim. If cmd-c/ctrl-c is giving you issues, set this to false and complain [here](https://github.com/Microsoft/vscode/issues/217). | Boolean | false |
|
||||
| vim.useSystemClipboard | Use the system clipboard register (`*`) as the default register | Boolean | false |
|
||||
| vim.searchHighlightColor | Background color of non-current search matches | String | `findMatchHighlightBackground` ThemeColor |
|
||||
| vim.searchHighlightTextColor | Foreground color of non-current search matches | String | None |
|
||||
| vim.searchMatchColor | Background color of current search match | String | `findMatchBackground` ThemeColor |
|
||||
| vim.searchMatchTextColor | Foreground color of current search match | String | None |
|
||||
| vim.substitutionColor | Background color of substitution text when `vim.inccommand` is enabled | String | "#50f01080" |
|
||||
| vim.substitutionTextColor | Foreground color of substitution text when `vim.inccommand` is enabled | String | None |
|
||||
| vim.startInInsertMode | Start in Insert mode instead of Normal Mode | Boolean | false |
|
||||
| vim.useCtrlKeys | Enable Vim ctrl keys overriding common VS Code operations such as copy, paste, find, etc. | Boolean | true |
|
||||
| vim.visualstar | In visual mode, start a search with `*` or `#` using the current selection | Boolean | false |
|
||||
| vim.highlightedyank.enable | Enable highlighting when yanking | Boolean | false |
|
||||
| vim.highlightedyank.color | Set the color of yank highlights | String | rgba(250, 240, 170, 0.5) |
|
||||
| vim.highlightedyank.duration | Set the duration of yank highlights | Number | 200 |
|
||||
| Setting | Description | Type | Default Value |
|
||||
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------- |
|
||||
| vim.changeWordIncludesWhitespace | Include trailing whitespace when changing word. This configures the <kbd>cw</kbd> action to act consistently as its siblings (<kbd>yw</kbd> and <kbd>dw</kbd>) instead of acting as <kbd>ce</kbd>. | Boolean | false |
|
||||
| vim.cursorStylePerMode._{Mode}_ | Configure a specific cursor style for _{Mode}_. Omitted modes will use [default cursor type](https://github.com/VSCodeVim/Vim/blob/4a6fde6dbd4d1fac1f204c0dc27c32883651ef1a/src/mode/mode.ts#L34) Supported cursors: line, block, underline, line-thin, block-outline, and underline-thin. | String | None |
|
||||
| vim.digraphs._{shorthand}_ | Set custom digraph shorthands that can override the default ones. Entries should map a two-character shorthand to a descriptive string and one or more UTF16 code points. Example: `"R!": ["🚀", [55357, 56960]]` | Object | `{"R!": ["🚀", [0xD83D, 0xDE80]]` |
|
||||
| vim.debug.silent | Boolean indicating whether log messages will be suppressed. | Boolean | false |
|
||||
| vim.debug.loggingLevelForConsole | Maximum level of messages to log to console. Logs are visible in the [developer tools](https://code.visualstudio.com/docs/extensions/developing-extensions#_developer-tools-console). Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
|
||||
| vim.debug.loggingLevelForAlert | Maximum level of messages to present as VS Code information window. Supported values: 'error', 'warn', 'info', 'verbose', 'debug'). | String | error |
|
||||
| vim.disableExtension | Disable VSCodeVim extension. This setting can also be toggled using `toggleVim` command in the Command Palette | Boolean | false |
|
||||
| vim.handleKeys | Delegate configured keys to be handled by VS Code instead of by the VSCodeVim extension. Any key in `keybindings` section of the [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json) that has a `vim.use<C-...>` in the `when` argument can be delegated back to VS Code by setting `"<C-...>": false`. Example: to use `ctrl+f` for find (native VS Code behavior): `"vim.handleKeys": { "<C-f>": false }`. | String | `"<C-d>": true`<br /> `"<C-s>": false`<br /> `"<C-z>": false` |
|
||||
| vim.overrideCopy | Override VS Code's copy command with our own, which works correctly with VSCodeVim. If cmd-c/ctrl-c is giving you issues, set this to false and complain [here](https://github.com/Microsoft/vscode/issues/217). | Boolean | false |
|
||||
| vim.useSystemClipboard | Use the system clipboard register (`*`) as the default register | Boolean | false |
|
||||
| vim.searchHighlightColor | Background color of non-current search matches | String | `findMatchHighlightBackground` ThemeColor |
|
||||
| vim.searchHighlightTextColor | Foreground color of non-current search matches | String | None |
|
||||
| vim.searchMatchColor | Background color of current search match | String | `findMatchBackground` ThemeColor |
|
||||
| vim.searchMatchTextColor | Foreground color of current search match | String | None |
|
||||
| vim.substitutionColor | Background color of substitution text when `vim.inccommand` is enabled | String | "#50f01080" |
|
||||
| vim.substitutionTextColor | Foreground color of substitution text when `vim.inccommand` is enabled | String | None |
|
||||
| vim.startInInsertMode | Start in Insert mode instead of Normal Mode | Boolean | false |
|
||||
| vim.useCtrlKeys | Enable Vim ctrl keys overriding common VS Code operations such as copy, paste, find, etc. | Boolean | true |
|
||||
| vim.visualstar | In visual mode, start a search with `*` or `#` using the current selection | Boolean | false |
|
||||
| vim.highlightedyank.enable | Enable highlighting when yanking | Boolean | false |
|
||||
| vim.highlightedyank.color | Set the color of yank highlights | String | rgba(250, 240, 170, 0.5) |
|
||||
| vim.highlightedyank.duration | Set the duration of yank highlights | Number | 200 |
|
||||
|
||||
### Neovim Integration
|
||||
|
||||
@ -399,29 +399,29 @@ It is highly recommended to remap keys using vim commands like `"vim.normalModeK
|
||||
|
||||
You can then add a new entry to the keybindings like so:
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "YOUR_KEY_COMBINATION",
|
||||
"command": "vim.remap",
|
||||
"when": "inputFocus && vim.mode == 'VIM_MODE_YOU_WANT_TO_REBIND'",
|
||||
"args": {
|
||||
"after": ["YOUR_VIM_ACTION"]
|
||||
}
|
||||
```json
|
||||
{
|
||||
"key": "YOUR_KEY_COMBINATION",
|
||||
"command": "vim.remap",
|
||||
"when": "inputFocus && vim.mode == 'VIM_MODE_YOU_WANT_TO_REBIND'",
|
||||
"args": {
|
||||
"after": ["YOUR_VIM_ACTION"]
|
||||
}
|
||||
```
|
||||
}
|
||||
```
|
||||
|
||||
For example, to rebind `ctrl+shift+y` to VSCodeVim's `yy` (yank line) in normal mode, add this to your keybindings.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "ctrl+shift+y",
|
||||
"command": "vim.remap",
|
||||
"when": "inputFocus && vim.mode == 'Normal'",
|
||||
"args": {
|
||||
"after": ["y", "y"],
|
||||
}
|
||||
```json
|
||||
{
|
||||
"key": "ctrl+shift+y",
|
||||
"command": "vim.remap",
|
||||
"when": "inputFocus && vim.mode == 'Normal'",
|
||||
"args": {
|
||||
"after": ["y", "y"]
|
||||
}
|
||||
```
|
||||
}
|
||||
```
|
||||
|
||||
If keybindings.json is empty the first time you open it, make sure to add opening `[` and closing `]` square brackets to the file as the keybindings should be inside a JSON Array.
|
||||
|
||||
@ -528,19 +528,19 @@ Change the color of the status bar based on the current mode. Once enabled, conf
|
||||
|
||||
Based on [vim-easymotion](https://github.com/easymotion/vim-easymotion) and configured through the following settings:
|
||||
|
||||
| Setting | Description | Type | Default Value |
|
||||
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | ------------------------------ |
|
||||
| vim.easymotion | Enable/disable easymotion plugin | Boolean | false |
|
||||
| vim.easymotionMarkerBackgroundColor | The background color of the marker box. | String | '#0000' |
|
||||
| vim.easymotionMarkerForegroundColorOneChar | The font color for one-character markers. | String | '#ff0000' |
|
||||
| vim.easymotionMarkerForegroundColorTwoCharFirst | The font color for the first of two-character markers, used to differentiate from one-character markers. | String | '#ffb400' |
|
||||
| vim.easymotionMarkerForegroundColorTwoCharSecond | The font color for the second of two-character markers, used to differentiate consecutive markers. | String | '#b98300' |
|
||||
| vim.easymotionIncSearchForegroundColor | The font color for the search n-character command, used to highlight the matches. | String | '#7fbf00' |
|
||||
| vim.easymotionDimColor | The font color for the dimmed characters, used when `#vim.easymotionDimBackground#` is set to true. | String | '#777777' |
|
||||
| vim.easymotionDimBackground | Whether to dim other text while markers are visible. | Boolean | true |
|
||||
| vim.easymotionMarkerFontWeight | The font weight used for the marker text. | String | 'bold' |
|
||||
| vim.easymotionKeys | The characters used for jump marker name | String | 'hklyuiopnm,qwertzxcvbasdgjf;' |
|
||||
| vim.easymotionJumpToAnywhereRegex | Custom regex to match for JumpToAnywhere motion (analogous to `Easymotion_re_anywhere`) | String | `\b[A-Za-z0-9]\|[A-Za-z0-9]\b\|_.\|#.\|[a-z][A-Z]` |
|
||||
| Setting | Description | Type | Default Value |
|
||||
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------------- |
|
||||
| vim.easymotion | Enable/disable easymotion plugin | Boolean | false |
|
||||
| vim.easymotionMarkerBackgroundColor | The background color of the marker box. | String | '#0000' |
|
||||
| vim.easymotionMarkerForegroundColorOneChar | The font color for one-character markers. | String | '#ff0000' |
|
||||
| vim.easymotionMarkerForegroundColorTwoCharFirst | The font color for the first of two-character markers, used to differentiate from one-character markers. | String | '#ffb400' |
|
||||
| vim.easymotionMarkerForegroundColorTwoCharSecond | The font color for the second of two-character markers, used to differentiate consecutive markers. | String | '#b98300' |
|
||||
| vim.easymotionIncSearchForegroundColor | The font color for the search n-character command, used to highlight the matches. | String | '#7fbf00' |
|
||||
| vim.easymotionDimColor | The font color for the dimmed characters, used when `#vim.easymotionDimBackground#` is set to true. | String | '#777777' |
|
||||
| vim.easymotionDimBackground | Whether to dim other text while markers are visible. | Boolean | true |
|
||||
| vim.easymotionMarkerFontWeight | The font weight used for the marker text. | String | 'bold' |
|
||||
| vim.easymotionKeys | The characters used for jump marker name | String | 'hklyuiopnm,qwertzxcvbasdgjf;' |
|
||||
| vim.easymotionJumpToAnywhereRegex | Custom regex to match for JumpToAnywhere motion (analogous to `Easymotion_re_anywhere`) | String | `\b[A-Za-z0-9]\|[A-Za-z0-9]\b\|_.\|#.\|[a-z][A-Z]` |
|
||||
|
||||
Once easymotion is active, initiate motions using the following commands. After you initiate the motion, text decorators/markers will be displayed and you can press the keys displayed to jump to that position. `leader` is configurable and is `\` by default.
|
||||
|
||||
|
@ -1140,7 +1140,7 @@
|
||||
"build-dev": "gulp build-dev",
|
||||
"build-test": "gulp prepare-test",
|
||||
"test": "node ./out/test/runTest.js",
|
||||
"forceprettier": "gulp forceprettier",
|
||||
"prettier": "npx prettier -w .",
|
||||
"watch": "npx webpack -c webpack.dev.js --watch",
|
||||
"package": "yarn run vsce package --yarn --allow-star-activation"
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Position } from 'vscode';
|
||||
import { Cursor } from '../common/motion/cursor';
|
||||
import { Notation } from '../configuration/notation';
|
||||
import { ActionType, IBaseAction } from "./types";
|
||||
import { ActionType, IBaseAction } from './types';
|
||||
import { isTextTransformation } from '../transformations/transformations';
|
||||
import { configuration } from './../configuration/configuration';
|
||||
import { Mode } from './../mode/mode';
|
||||
@ -57,7 +57,8 @@ export abstract class BaseAction implements IBaseAction {
|
||||
*/
|
||||
public doesActionApply(vimState: VimState, keysPressed: string[]): boolean {
|
||||
if (
|
||||
vimState.currentModeIncludingPseudoModes === Mode.OperatorPendingMode && this.actionType === 'command'
|
||||
vimState.currentModeIncludingPseudoModes === Mode.OperatorPendingMode &&
|
||||
this.actionType === 'command'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@ -73,7 +74,8 @@ export abstract class BaseAction implements IBaseAction {
|
||||
*/
|
||||
public couldActionApply(vimState: VimState, keysPressed: string[]): boolean {
|
||||
if (
|
||||
vimState.currentModeIncludingPseudoModes === Mode.OperatorPendingMode && this.actionType === 'command'
|
||||
vimState.currentModeIncludingPseudoModes === Mode.OperatorPendingMode &&
|
||||
this.actionType === 'command'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -84,12 +84,12 @@ class AddFold extends BaseOperator {
|
||||
readonly commandName = 'editor.createFoldingRangeFromSelection';
|
||||
|
||||
public async run(vimState: VimState, start: Position, end: Position): Promise<void> {
|
||||
const previousSelections = vimState.lastVisualSelection; // keep in case of Normal mode
|
||||
const previousSelections = vimState.lastVisualSelection; // keep in case of Normal mode
|
||||
vimState.editor.selection = new vscode.Selection(start, end);
|
||||
await vscode.commands.executeCommand(this.commandName);
|
||||
vimState.lastVisualSelection = previousSelections;
|
||||
vimState.cursors = [new Cursor(start, start)];
|
||||
await vimState.setCurrentMode(Mode.Normal); // Vim behavior
|
||||
await vimState.setCurrentMode(Mode.Normal); // Vim behavior
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,13 +100,11 @@ class RemoveFold extends BaseCommand {
|
||||
readonly commandName = 'editor.removeManualFoldingRanges';
|
||||
|
||||
override async exec(position: Position, vimState: VimState): Promise<void> {
|
||||
|
||||
await vscode.commands.executeCommand(this.commandName);
|
||||
|
||||
const newCursorPosition = vimState.currentMode === Mode.Visual
|
||||
? vimState.editor.selection.start
|
||||
: position;
|
||||
const newCursorPosition =
|
||||
vimState.currentMode === Mode.Visual ? vimState.editor.selection.start : position;
|
||||
vimState.cursors = [new Cursor(newCursorPosition, newCursorPosition)];
|
||||
await vimState.setCurrentMode(Mode.Normal); // Vim behavior
|
||||
await vimState.setCurrentMode(Mode.Normal); // Vim behavior
|
||||
}
|
||||
}
|
||||
|
@ -1935,7 +1935,7 @@ export class MoveAroundParentheses extends MoveInsideCharacter {
|
||||
// special treatment for curly braces
|
||||
export abstract class MoveCurlyBrace extends MoveInsideCharacter {
|
||||
override modes = [Mode.Normal, Mode.Visual, Mode.VisualLine, Mode.VisualBlock];
|
||||
protected charToMatch: string = '{'
|
||||
protected charToMatch: string = '{';
|
||||
|
||||
public override async execAction(
|
||||
position: Position,
|
||||
@ -1943,7 +1943,6 @@ export abstract class MoveCurlyBrace extends MoveInsideCharacter {
|
||||
firstIteration: boolean,
|
||||
lastIteration: boolean
|
||||
): Promise<IMovement> {
|
||||
|
||||
// curly braces has a special treatment. In case the cursor is before an opening curly brace,
|
||||
// and there are no characters before the opening curly brace in the same line, it should jump
|
||||
// to the next opening curly brace, even if it already inside a pair of curly braces.
|
||||
@ -1955,7 +1954,10 @@ export abstract class MoveCurlyBrace extends MoveInsideCharacter {
|
||||
text.substring(0, position.character + openCurlyBraceIndexFromCursor).trim().length === 0 &&
|
||||
startSameAsEnd
|
||||
) {
|
||||
const curlyPos = position.with(position.line, position.character + openCurlyBraceIndexFromCursor);
|
||||
const curlyPos = position.with(
|
||||
position.line,
|
||||
position.character + openCurlyBraceIndexFromCursor
|
||||
);
|
||||
vimState.cursorStartPosition = vimState.cursorStopPosition = curlyPos;
|
||||
const movement = await super.execAction(curlyPos, vimState, firstIteration, lastIteration);
|
||||
if (movement.failed) {
|
||||
@ -1975,8 +1977,7 @@ export abstract class MoveCurlyBrace extends MoveInsideCharacter {
|
||||
vimState.cursorStartPosition = start;
|
||||
vimState.cursorStopPosition = stop;
|
||||
return movement;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return super.execAction(position, vimState, firstIteration, lastIteration);
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,10 @@ export class ReadCommand extends ExCommand {
|
||||
async execute(vimState: VimState): Promise<void> {
|
||||
const textToInsert = await this.getTextToInsert(vimState);
|
||||
if (textToInsert) {
|
||||
vimState.recordedState.transformer.insert(vimState.cursorStopPosition.getLineEnd(), '\n' + textToInsert);
|
||||
vimState.recordedState.transformer.insert(
|
||||
vimState.cursorStopPosition.getLineEnd(),
|
||||
'\n' + textToInsert
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +58,7 @@ export class ReadCommand extends ExCommand {
|
||||
|
||||
async getTextToInsert(vimState: VimState): Promise<string> {
|
||||
if ('file' in this.arguments) {
|
||||
return readFileAsync(this.arguments.file, 'utf8');
|
||||
return readFileAsync(this.arguments.file, 'utf8');
|
||||
} else if ('cmd' in this.arguments) {
|
||||
if (this.arguments.cmd.length > 0) {
|
||||
if (SUPPORT_READ_COMMAND) {
|
||||
|
@ -27,35 +27,35 @@ export enum TabCommandType {
|
||||
// TODO: many of these arguments aren't used
|
||||
export type ITabCommandArguments =
|
||||
| {
|
||||
type: TabCommandType.Absolute;
|
||||
count: number;
|
||||
}
|
||||
type: TabCommandType.Absolute;
|
||||
count: number;
|
||||
}
|
||||
| {
|
||||
type: TabCommandType.First | TabCommandType.Last;
|
||||
cmd?: FileCmd;
|
||||
}
|
||||
type: TabCommandType.First | TabCommandType.Last;
|
||||
cmd?: FileCmd;
|
||||
}
|
||||
| {
|
||||
type: TabCommandType.Next | TabCommandType.Previous;
|
||||
bang: boolean;
|
||||
cmd?: FileCmd;
|
||||
count?: number;
|
||||
}
|
||||
type: TabCommandType.Next | TabCommandType.Previous;
|
||||
bang: boolean;
|
||||
cmd?: FileCmd;
|
||||
count?: number;
|
||||
}
|
||||
| {
|
||||
type: TabCommandType.Close | TabCommandType.Only;
|
||||
bang: boolean;
|
||||
count?: number;
|
||||
}
|
||||
type: TabCommandType.Close | TabCommandType.Only;
|
||||
bang: boolean;
|
||||
count?: number;
|
||||
}
|
||||
| {
|
||||
type: TabCommandType.New;
|
||||
opt: FileOpt;
|
||||
cmd?: FileCmd;
|
||||
file?: string;
|
||||
}
|
||||
type: TabCommandType.New;
|
||||
opt: FileOpt;
|
||||
cmd?: FileCmd;
|
||||
file?: string;
|
||||
}
|
||||
| {
|
||||
type: TabCommandType.Move;
|
||||
direction?: 'left' | 'right';
|
||||
count?: number;
|
||||
};
|
||||
type: TabCommandType.Move;
|
||||
direction?: 'left' | 'right';
|
||||
count?: number;
|
||||
};
|
||||
|
||||
//
|
||||
// Implements most buffer and tab ex commands
|
||||
@ -152,7 +152,6 @@ export class TabCommand extends ExCommand {
|
||||
}
|
||||
|
||||
if (this.arguments.count) {
|
||||
|
||||
const tabGroup = vscode.window.tabGroups.activeTabGroup;
|
||||
if (0 < this.arguments.count && this.arguments.count <= tabGroup.tabs.length) {
|
||||
const tab = tabGroup.tabs[this.arguments.count - 1];
|
||||
|
@ -67,7 +67,7 @@ export class NumericString {
|
||||
): { num: NumericString; suffixOffset: number } | undefined {
|
||||
const filteredMatchings =
|
||||
targetRadix !== undefined
|
||||
? NumericString.matchings.filter(matching => matching.radix === targetRadix)
|
||||
? NumericString.matchings.filter((matching) => matching.radix === targetRadix)
|
||||
: NumericString.matchings;
|
||||
|
||||
// Find core numeric part of input
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { alt, any, Parser, regexp, string, noneOf } from "parsimmon";
|
||||
import { configuration } from "../configuration/configuration";
|
||||
import { alt, any, Parser, regexp, string, noneOf } from 'parsimmon';
|
||||
import { configuration } from '../configuration/configuration';
|
||||
|
||||
const leaderParser = regexp(/<leader>/).map(() => configuration.leader); // lazy evaluation of configuration.leader
|
||||
const specialCharacters = regexp(/<(?:Esc|C-\w|A-\w|C-A-\w)>/)
|
||||
const leaderParser = regexp(/<leader>/).map(() => configuration.leader); // lazy evaluation of configuration.leader
|
||||
const specialCharacters = regexp(/<(?:Esc|C-\w|A-\w|C-A-\w)>/);
|
||||
|
||||
const specialCharacterParser = alt(specialCharacters, leaderParser);
|
||||
|
||||
@ -17,10 +17,10 @@ const escapedParser = string('\\')
|
||||
return '\n';
|
||||
}
|
||||
return '\\' + escaped;
|
||||
})
|
||||
});
|
||||
|
||||
export const keystrokesExpressionParser: Parser<string[]> = alt(
|
||||
escapedParser,
|
||||
specialCharacterParser,
|
||||
noneOf('"'),
|
||||
noneOf('"')
|
||||
).many();
|
||||
|
@ -1,6 +1,9 @@
|
||||
import * as assert from 'assert';
|
||||
import { Position, window } from 'vscode';
|
||||
import { getCurrentParagraphBeginning, getCurrentParagraphEnd } from '../../src/textobject/paragraph';
|
||||
import {
|
||||
getCurrentParagraphBeginning,
|
||||
getCurrentParagraphEnd,
|
||||
} from '../../src/textobject/paragraph';
|
||||
import { WordType } from '../../src/textobject/word';
|
||||
import { TextEditor } from '../../src/textEditor';
|
||||
import { assertEqualLines, cleanUpWorkspace, setupWorkspace } from '../testUtils';
|
||||
|
@ -5,10 +5,7 @@ import { getAndUpdateModeHandler } from '../../extension';
|
||||
import { ExCommandLine } from '../../src/cmd_line/commandLine';
|
||||
import { ModeHandler } from '../../src/mode/modeHandler';
|
||||
import { exCommandParser } from '../../src/vimscript/exCommandParser';
|
||||
import {
|
||||
cleanUpWorkspace,
|
||||
setupWorkspace,
|
||||
} from '../testUtils';
|
||||
import { cleanUpWorkspace, setupWorkspace } from '../testUtils';
|
||||
|
||||
function clearBreakpoints() {
|
||||
vscode.debug.removeBreakpoints(vscode.debug.breakpoints);
|
||||
@ -30,8 +27,14 @@ suite('Breakpoints command', () => {
|
||||
await new ExCommandLine('breaka', modeHandler.vimState.currentMode).run(modeHandler.vimState);
|
||||
assert.strictEqual(vscode.debug.breakpoints.length, 1);
|
||||
const breakpoint = vscode.debug.breakpoints[0] as vscode.SourceBreakpoint;
|
||||
assert.strictEqual(breakpoint.location.uri.fsPath, modeHandler.vimState.editor.document.uri.fsPath);
|
||||
assert.strictEqual(breakpoint.location.range.start.line, modeHandler.vimState.cursorStartPosition.line);
|
||||
assert.strictEqual(
|
||||
breakpoint.location.uri.fsPath,
|
||||
modeHandler.vimState.editor.document.uri.fsPath
|
||||
);
|
||||
assert.strictEqual(
|
||||
breakpoint.location.range.start.line,
|
||||
modeHandler.vimState.cursorStartPosition.line
|
||||
);
|
||||
});
|
||||
|
||||
test('`:breakd` delete breakpoint', async () => {
|
||||
@ -45,11 +48,11 @@ suite('Breakpoints command', () => {
|
||||
test('test "here" is redundant', async () => {
|
||||
assert.deepStrictEqual(
|
||||
exCommandParser.tryParse(':breaka here'),
|
||||
exCommandParser.tryParse(':breaka'),
|
||||
exCommandParser.tryParse(':breaka')
|
||||
);
|
||||
assert.deepStrictEqual(
|
||||
exCommandParser.tryParse(':breakd here'),
|
||||
exCommandParser.tryParse(':breakd'),
|
||||
exCommandParser.tryParse(':breakd')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -297,16 +297,18 @@ suite('cmd_line tabComplete', () => {
|
||||
`:e ${filePath}|`.toLowerCase(),
|
||||
'Cannot complete path case-insensitive on windows'
|
||||
);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
await modeHandler.handleMultipleKeyEvents(cmd);
|
||||
const statusBarBeforeTab = StatusBar.getText();
|
||||
await modeHandler.handleKeyEvent('<tab>');
|
||||
const statusBarAfterTab = StatusBar.getText().trim();
|
||||
await modeHandler.handleKeyEvent('<Esc>');
|
||||
assert.strictEqual(statusBarBeforeTab, statusBarAfterTab, 'Is case-insensitive on non-windows');
|
||||
assert.strictEqual(
|
||||
statusBarBeforeTab,
|
||||
statusBarAfterTab,
|
||||
'Is case-insensitive on non-windows'
|
||||
);
|
||||
}
|
||||
|
||||
} finally {
|
||||
await t.removeFile(filePath);
|
||||
await t.removeDir(dirPath);
|
||||
|
@ -92,12 +92,16 @@ suite('LineRange parsing', () => {
|
||||
parseTest(
|
||||
'Separator but no first address',
|
||||
`${sep}5`,
|
||||
new LineRange(new Address({type: 'current_line'}), sep, new Address({type: 'number', num: 5}))
|
||||
new LineRange(
|
||||
new Address({ type: 'current_line' }),
|
||||
sep,
|
||||
new Address({ type: 'number', num: 5 })
|
||||
)
|
||||
);
|
||||
parseTest(
|
||||
'Separator but no address at all',
|
||||
`${sep}`,
|
||||
new LineRange(new Address({type: 'current_line'}), sep)
|
||||
new LineRange(new Address({ type: 'current_line' }), sep)
|
||||
);
|
||||
parseTest(
|
||||
'Two numbers',
|
||||
|
@ -19,7 +19,7 @@
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true,
|
||||
"esModuleInterop": true
|
||||
// "isolatedModules": true,
|
||||
},
|
||||
"exclude": ["node_modules", "!node_modules/@types"]
|
||||
|
Loading…
Reference in New Issue
Block a user