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

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: 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') | dart/tests/try/cursor_position_test.dart » ('J')
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 9b8d485c7ad25ec172eb7e80a1bf5f3b9ec4cb2f..e3fe750fea0b498bc47452762b00c1160800e000 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;
@@ -919,11 +919,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') | dart/tests/try/cursor_position_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698