Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vs-editor-api.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Osenkov <github@osenkov.com>2018-12-11 04:09:47 +0300
committerKirill Osenkov <github@osenkov.com>2018-12-11 04:09:47 +0300
commit6f37e7f7eb79a9df8ebed2223fa7bf286c8cc866 (patch)
tree3d5512426015776360982f2ce57df8c7c7800d42
parent8e7455fc88a1d7904ebd399c17c56a07e4cc796c (diff)
Undo some changes that break MonoDevelop.
-rw-r--r--src/Microsoft.VisualStudio.Text.Implementation.csproj2
-rw-r--r--src/Text/Impl/XPlat/MultiCaretImpl/MultiSelectionBroker.cs62
-rw-r--r--src/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs7
3 files changed, 38 insertions, 33 deletions
diff --git a/src/Microsoft.VisualStudio.Text.Implementation.csproj b/src/Microsoft.VisualStudio.Text.Implementation.csproj
index b35940f..789c98d 100644
--- a/src/Microsoft.VisualStudio.Text.Implementation.csproj
+++ b/src/Microsoft.VisualStudio.Text.Implementation.csproj
@@ -5,7 +5,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
- <Version>15.2.4-pre</Version>
+ <Version>15.2.5-pre</Version>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
<NuGetVersionEditor>16.0.142-g25b7188c54</NuGetVersionEditor>
<NuGetVersionLanguage>16.0.142-g25b7188c54</NuGetVersionLanguage>
diff --git a/src/Text/Impl/XPlat/MultiCaretImpl/MultiSelectionBroker.cs b/src/Text/Impl/XPlat/MultiCaretImpl/MultiSelectionBroker.cs
index 8fa180f..5beff03 100644
--- a/src/Text/Impl/XPlat/MultiCaretImpl/MultiSelectionBroker.cs
+++ b/src/Text/Impl/XPlat/MultiCaretImpl/MultiSelectionBroker.cs
@@ -60,33 +60,37 @@ namespace Microsoft.VisualStudio.Text.MultiSelection.Implementation
private void OnTextViewLayoutChanged(object sender, TextViewLayoutChangedEventArgs e)
{
- using (var batchOp = BeginBatchOperation())
- {
- // If we get a text change, we need to go through all the selections and update them to be in the
- // new snapshot. If there is just a visual change, we could still need to update selections because
- // word wrap or collapsed regions might have moved around.
- if (CurrentSnapshot != e.NewSnapshot)
- {
- CurrentSnapshot = e.NewSnapshot;
- }
- else if (e.NewViewState.VisualSnapshot != e.OldViewState.VisualSnapshot)
- {
- // Box selection is special. Moving _boxSelection is easy, but InnerSetBoxSelection will totally
- // reset all the selections. It's easier to go a different path here than it is to special case
- // NormalizeSelections, which is also called when adding an individual selection.
- if (IsBoxSelection)
- {
- // MapToSnapshot does take the visual buffer into account as well. Calling it here should do the right thing
- // for collapsed regions and word wrap.
- _boxSelection.Selection = _boxSelection.Selection.MapToSnapshot(_currentSnapshot, _textView);
- InnerSetBoxSelection();
- }
- else
- {
- NormalizeSelections(true);
- }
- }
- }
+ if (CurrentSnapshot != e.NewSnapshot)
+ {
+ CurrentSnapshot = e.NewSnapshot;
+ }
+ //using (var batchOp = BeginBatchOperation())
+ //{
+ // // If we get a text change, we need to go through all the selections and update them to be in the
+ // // new snapshot. If there is just a visual change, we could still need to update selections because
+ // // word wrap or collapsed regions might have moved around.
+ // if (CurrentSnapshot != e.NewSnapshot)
+ // {
+ // CurrentSnapshot = e.NewSnapshot;
+ // }
+ // else if (e.NewViewState.VisualSnapshot != e.OldViewState.VisualSnapshot)
+ // {
+ // // Box selection is special. Moving _boxSelection is easy, but InnerSetBoxSelection will totally
+ // // reset all the selections. It's easier to go a different path here than it is to special case
+ // // NormalizeSelections, which is also called when adding an individual selection.
+ // if (IsBoxSelection)
+ // {
+ // // MapToSnapshot does take the visual buffer into account as well. Calling it here should do the right thing
+ // // for collapsed regions and word wrap.
+ // _boxSelection.Selection = _boxSelection.Selection.MapToSnapshot(_currentSnapshot, _textView);
+ // InnerSetBoxSelection();
+ // }
+ // else
+ // {
+ // NormalizeSelections(true);
+ // }
+ // }
+ //}
}
private void OnTextViewClosed(object sender, EventArgs e)
@@ -409,8 +413,8 @@ namespace Microsoft.VisualStudio.Text.MultiSelection.Implementation
private void FireSessionUpdated()
{
- var changesFromNormalization = NormalizeSelections();
- _fireEvents = _fireEvents || changesFromNormalization;
+ //var changesFromNormalization = NormalizeSelections();
+ //_fireEvents = _fireEvents || changesFromNormalization;
// Perform merges as late as possible so that each region can act independently for operations.
MergeSelections();
diff --git a/src/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs b/src/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs
index e80770c..489fa18 100644
--- a/src/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs
+++ b/src/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs
@@ -438,9 +438,10 @@ namespace Microsoft.VisualStudio.Text.MultiSelection.Implementation
// Using the ternary here to shortcut out if the snapshots are the same. There's a similar check in the
// MapSelectionToCurrentSnapshot method to avoid doing unneeded work, but even spinning up the method call can be expensive.
- _selection = (newSelection.InsertionPoint.Position.Snapshot == this.CurrentSnapshot)
- ? newSelection
- : MapSelectionToCurrentSnapshot(newSelection);
+ //_selection = (newSelection.InsertionPoint.Position.Snapshot == this.CurrentSnapshot)
+ // ? newSelection
+ // : MapSelectionToCurrentSnapshot(newSelection);
+ _selection = newSelection;
_broker.QueueCaretUpdatedEvent(this);
}