Skip to content

Commit

Permalink
Merge branch 'master' into renovate/node-8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon authored Nov 27, 2018
2 parents 3f8ea5d + f06b7e0 commit 2d6ff89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mode/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Position } from './../common/motion/position';
import { Mode, ModeName } from './mode';
import { VSCodeVimCursorType } from './mode';
import { VimState } from '../state/vimState';
import { SearchDirection } from '../state/searchState';
import { logger } from '../util/logger';

export enum VisualBlockInsertionType {
/**
Expand Down Expand Up @@ -63,7 +65,13 @@ export class SearchInProgressMode extends Mode {
}

getStatusBarText(vimState: VimState): string {
return `/${vimState.globalState.searchState!.searchString}`;
if (vimState.globalState.searchState === undefined) {
logger.error(`SearchInProgressMode.getStatusBarText: vimState.globalState.searchState is undefined.`);
return '';
}
const leadingChar =
vimState.globalState.searchState.searchDirection === SearchDirection.Forward ? '/' : '?';
return `${leadingChar}${vimState.globalState.searchState!.searchString}`;
}

getStatusBarCommandText(vimState: VimState): string {
Expand Down
4 changes: 4 additions & 0 deletions src/state/searchState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export class SearchState {
private _cachedDocumentVersion: number;
private _cachedDocumentName: String;
private _searchDirection: SearchDirection = SearchDirection.Forward;
public get searchDirection(): SearchDirection {
return this._searchDirection;
}

private isRegex: boolean;

private _searchString = '';
Expand Down

0 comments on commit 2d6ff89

Please sign in to comment.