mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Fix #86151
This commit is contained in:
parent
29474d526e
commit
7fada39392
|
@ -161,6 +161,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