mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -116,7 +116,7 @@ export class SearchData {
|
||||
}
|
||||
}
|
||||
|
||||
function createFindMatch(range: Range, rawMatches: RegExpExecArray, captureMatches: boolean): FindMatch {
|
||||
export function createFindMatch(range: Range, rawMatches: RegExpExecArray, captureMatches: boolean): FindMatch {
|
||||
if (!captureMatches) {
|
||||
return new FindMatch(range, null);
|
||||
}
|
||||
@@ -434,6 +434,11 @@ function leftIsWordBounday(wordSeparators: WordCharacterClassifier, text: string
|
||||
return true;
|
||||
}
|
||||
|
||||
if (charBefore === CharCode.CarriageReturn || charBefore === CharCode.LineFeed) {
|
||||
// The character before the match is line break or carriage return.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (matchLength > 0) {
|
||||
const firstCharInMatch = text.charCodeAt(matchStartIndex);
|
||||
if (wordSeparators.get(firstCharInMatch) !== WordCharacterClass.Regular) {
|
||||
@@ -457,6 +462,11 @@ function rightIsWordBounday(wordSeparators: WordCharacterClassifier, text: strin
|
||||
return true;
|
||||
}
|
||||
|
||||
if (charAfter === CharCode.CarriageReturn || charAfter === CharCode.LineFeed) {
|
||||
// The character after the match is line break or carriage return.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (matchLength > 0) {
|
||||
const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);
|
||||
if (wordSeparators.get(lastCharInMatch) !== WordCharacterClass.Regular) {
|
||||
@@ -468,14 +478,14 @@ function rightIsWordBounday(wordSeparators: WordCharacterClassifier, text: strin
|
||||
return false;
|
||||
}
|
||||
|
||||
function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean {
|
||||
export function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean {
|
||||
return (
|
||||
leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)
|
||||
&& rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)
|
||||
);
|
||||
}
|
||||
|
||||
class Searcher {
|
||||
export class Searcher {
|
||||
private _wordSeparators: WordCharacterClassifier;
|
||||
private _searchRegex: RegExp;
|
||||
private _prevMatchStartIndex: number;
|
||||
|
||||
Reference in New Issue
Block a user