mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fix #85151
This commit is contained in:
parent
ca42425503
commit
398696040b
|
@ -150,6 +150,36 @@ function isCharBeforeAndAfterPositionsRoughtlyEqual(document: TextDocument, firs
|
|||
const charBeforeSecondarySelection = getCharBefore(document, secondPos);
|
||||
const charAfterSecondarySelection = getCharAfter(document, secondPos);
|
||||
|
||||
/**
|
||||
* Special case for exiting
|
||||
* |<div>
|
||||
* |</div>
|
||||
*/
|
||||
if (
|
||||
charBeforePrimarySelection === ' ' &&
|
||||
charBeforeSecondarySelection === ' ' &&
|
||||
charAfterPrimarySelection === '<' &&
|
||||
charAfterSecondarySelection === '<'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Special case for exiting
|
||||
* | <div>
|
||||
* | </div>
|
||||
*/
|
||||
if (charBeforePrimarySelection === '\n' && charBeforeSecondarySelection === '\n') {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Special case for exiting
|
||||
* <div>|
|
||||
* </div>|
|
||||
*/
|
||||
if (charAfterPrimarySelection === '\n' && charAfterSecondarySelection === '\n') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Exit mirror mode when cursor position no longer mirror
|
||||
// Unless it's in the case of `<|></|>`
|
||||
const charBeforeBothPositionRoughlyEqual =
|
||||
|
|
Loading…
Reference in a new issue