diff --git a/.travis.yml b/.travis.yml index f7d67458..30cb7568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ install: script: - git ls-tree -r master --name-only | grep ".*.[t|j]s$" | xargs ./node_modules/prettier/bin/prettier.js --write --print-width 100 --single-quote --trailing-comma es5 -- git diff-index --quiet HEAD -- || { echo "Compile with gulp first before pushing!"; exit 1; } +- git diff-index --quiet HEAD -- || { echo "Compile with gulp first (to format things properly with prettier) before pushing!"; exit 1; } - gulp - npm test --silent; diff --git a/src/actions/commands/actions.ts b/src/actions/commands/actions.ts index 6180fa34..7f29130e 100644 --- a/src/actions/commands/actions.ts +++ b/src/actions/commands/actions.ts @@ -207,7 +207,7 @@ export abstract class BaseCommand extends BaseAction { .sort( (a, b) => a.start.line > b.start.line || - (a.start.line === b.start.line && a.start.character > b.start.character) + (a.start.line === b.start.line && a.start.character > b.start.character) ? 1 : -1 ); @@ -961,9 +961,10 @@ function searchCurrentWord( // If the search is going left then use `getWordLeft()` on position to start // at the beginning of the word. This ensures that any matches happen // outside of the currently selected word. - const searchStartCursorPosition = direction === SearchDirection.Backward - ? vimState.cursorPosition.getWordLeft(true) - : vimState.cursorPosition; + const searchStartCursorPosition = + direction === SearchDirection.Backward + ? vimState.cursorPosition.getWordLeft(true) + : vimState.cursorPosition; return createSearchStateAndMoveToMatch({ needle: currentWord, @@ -985,9 +986,10 @@ function searchCurrentSelection(vimState: VimState, direction: SearchDirection) // If the search is going left then use `getLeft()` on the selection start. // If going right then use `getRight()` on the selection end. This ensures // that any matches happen outside of the currently selected word. - const searchStartCursorPosition = direction === SearchDirection.Backward - ? vimState.lastVisualSelectionStart.getLeft() - : vimState.lastVisualSelectionEnd.getRight(); + const searchStartCursorPosition = + direction === SearchDirection.Backward + ? vimState.lastVisualSelectionStart.getLeft() + : vimState.lastVisualSelectionEnd.getRight(); return createSearchStateAndMoveToMatch({ needle: currentSelection, @@ -2667,7 +2669,7 @@ class ActionJoin extends BaseCommand { .sort( (a, b) => a.start.line > b.start.line || - (a.start.line === b.start.line && a.start.character > b.start.character) + (a.start.line === b.start.line && a.start.character > b.start.character) ? 1 : -1 ); diff --git a/src/actions/motion.ts b/src/actions/motion.ts index 67384c22..29b687e3 100644 --- a/src/actions/motion.ts +++ b/src/actions/motion.ts @@ -110,9 +110,10 @@ export abstract class BaseMovement extends BaseAction { for (let i = 0; i < count; i++) { const firstIteration = i === 0; const lastIteration = i === count - 1; - const temporaryResult = recordedState.operator && lastIteration - ? await this.execActionForOperator(position, vimState) - : await this.execAction(position, vimState); + const temporaryResult = + recordedState.operator && lastIteration + ? await this.execActionForOperator(position, vimState) + : await this.execAction(position, vimState); if (temporaryResult instanceof Position) { result = temporaryResult; diff --git a/src/actions/plugins/easymotion/easymotion.ts b/src/actions/plugins/easymotion/easymotion.ts index 9910f528..bf2629d0 100644 --- a/src/actions/plugins/easymotion/easymotion.ts +++ b/src/actions/plugins/easymotion/easymotion.ts @@ -398,9 +398,10 @@ export class EasyMotion { this.decorations[keystroke.length] = []; } - const fontColor = keystroke.length > 1 - ? Configuration.easymotionMarkerForegroundColorTwoChar - : Configuration.easymotionMarkerForegroundColorOneChar; + const fontColor = + keystroke.length > 1 + ? Configuration.easymotionMarkerForegroundColorTwoChar + : Configuration.easymotionMarkerForegroundColorOneChar; const backgroundColor = Configuration.easymotionMarkerBackgroundColor; // Position should be offsetted by the length of the keystroke to prevent hiding behind the gutter diff --git a/src/common/matching/matcher.ts b/src/common/matching/matcher.ts index b17f9051..2d465505 100644 --- a/src/common/matching/matcher.ts +++ b/src/common/matching/matcher.ts @@ -90,9 +90,8 @@ export class PairMatcher { if (!toFind.nextMatchIsForward) { for (let lineNumber = position.line; lineNumber >= 0; lineNumber--) { let lineText = TextEditor.getLineAt(new Position(lineNumber, 0)).text; - let startOffset = lineNumber === position.line - ? lineText.length - position.character - 1 - : 0; + let startOffset = + lineNumber === position.line ? lineText.length - position.character - 1 : 0; while (true) { let queryText = toReversedString(lineText).substr(startOffset); diff --git a/src/state/searchState.ts b/src/state/searchState.ts index e9b9a978..3041ff31 100644 --- a/src/state/searchState.ts +++ b/src/state/searchState.ts @@ -171,7 +171,7 @@ export class SearchState { this._matchRanges.sort( (x, y) => x.start.line < y.start.line || - (x.start.line === y.start.line && x.start.character < y.start.character) + (x.start.line === y.start.line && x.start.character < y.start.character) ? -1 : 1 ); diff --git a/typings/custom/promised-neovim-client.d.ts b/typings/custom/promised-neovim-client.d.ts index 9f724d68..4f88d870 100644 --- a/typings/custom/promised-neovim-client.d.ts +++ b/typings/custom/promised-neovim-client.d.ts @@ -209,7 +209,12 @@ declare module 'promised-neovim-client' { reader: NodeJS.ReadableStream ): Promise; - export interface NvimVersion { major: number; minor: number; patch: number; rest: string } + export interface NvimVersion { + major: number; + minor: number; + patch: number; + rest: string; + } export type RPCValue = | Buffer | Window