Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: dart/site/try/src/interaction_manager.dart

Issue 285043003: Two related changes that both affect how cursor positions might change on single line edits. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r36207. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/site/try/src/selection.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/interaction_manager.dart
diff --git a/dart/site/try/src/interaction_manager.dart b/dart/site/try/src/interaction_manager.dart
index 09b26764ee8baa767fd8becbc392b859ab917326..4e1d45432a2bff9553bc3f91eb31b09e07496680 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -320,7 +320,7 @@ class InitialState extends InteractionState {
String currentText = node.text;
- trySelection = new TrySelection(node, selection);
+ trySelection = trySelection.copyWithRoot(node);
trySelection.updateText(currentText);
editor.isMalformedInput = false;
@@ -920,11 +920,12 @@ void normalizeMutationRecord(MutationRecord record,
Set<Node> normalizedNodes) {
for (Node node in record.addedNodes) {
if (node.parent == null) continue;
+ normalizedNodes.add(findLine(node));
+ if (node is Text) continue;
StringBuffer buffer = new StringBuffer();
int selectionOffset = htmlToText(node, buffer, selection);
Text newNode = new Text('$buffer');
node.replaceWith(newNode);
- normalizedNodes.add(findLine(newNode));
if (selectionOffset != -1) {
selection.anchorNode = newNode;
selection.anchorOffset = selectionOffset;
« no previous file with comments | « no previous file | dart/site/try/src/selection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698