Skip to content

Commit

Permalink
Fixed an unintentionally capitalized i
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 committed Sep 10, 2018
1 parent fed5792 commit 16de86f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/addons/search/SearchHelper.ts
Expand Up @@ -114,8 +114,8 @@ export class SearchHelper implements ISearchHelper {
return;
}

const stringLIne = this.translateBufferLineToStringWithWrap(y, true);
const searchStringLine = searchOptions.caseSensitive ? stringLIne : stringLIne.toLowerCase();
const stringLine = this.translateBufferLineToStringWithWrap(y, true);
const searchStringLine = searchOptions.caseSensitive ? stringLine : stringLine.toLowerCase();
const searchTerm = searchOptions.caseSensitive ? term : term.toLowerCase();
let searchIndex = searchStringLine.indexOf(searchTerm);

Expand Down
11 changes: 8 additions & 3 deletions src/addons/search/search.test.ts
Expand Up @@ -122,9 +122,14 @@ describe('search addon', () => {
const term = new MockTerminal({cols: 20, rows: 4});
term.core.write('Hello World\r\n123....hello\r\nmoreTestHello');
term.pushWriteData();
const hello0 = (term.searchHelper as any)._findInLine('Hello', 0, true);
const hello1 = (term.searchHelper as any)._findInLine('Hello', 1, true);
const hello2 = (term.searchHelper as any)._findInLine('Hello', 2, true);
const searchOptions = {
regex: false,
wholeWord: false,
caseSensitive: true
};
const hello0 = (term.searchHelper as any)._findInLine('Hello', 0, searchOptions);
const hello1 = (term.searchHelper as any)._findInLine('Hello', 1, searchOptions);
const hello2 = (term.searchHelper as any)._findInLine('Hello', 2, searchOptions);
expect(hello0).eql({col: 0, row: 0, term: 'Hello'});
expect(hello1).eql(undefined);
expect(hello2).eql({col: 8, row: 2, term: 'Hello'});
Expand Down

0 comments on commit 16de86f

Please sign in to comment.