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

Unified Diff: dart/site/try/src/selection.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 | « dart/site/try/src/interaction_manager.dart ('k') | dart/tests/try/cursor_position_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/selection.dart
diff --git a/dart/site/try/src/selection.dart b/dart/site/try/src/selection.dart
index a8005e6150174708cc97ccba93a545dcfc793f9c..641eb7434d4528d1ecd695f9696c5807d42656d1 100644
--- a/dart/site/try/src/selection.dart
+++ b/dart/site/try/src/selection.dart
@@ -59,6 +59,12 @@ class TrySelection {
globalOffset = computeGlobalOffset(root, anchorNode, anchorOffset);
}
+ TrySelection copyWithRoot(Node root) {
+ return new TrySelection.empty(root)
+ ..anchorNode = anchorNode
+ ..anchorOffset = anchorOffset;
+ }
+
/// Computes the global offset, that is, the offset from [root].
static int computeGlobalOffset(Node root, Node anchorNode, int anchorOffset) {
if (anchorOffset == -1) return -1;
« no previous file with comments | « dart/site/try/src/interaction_manager.dart ('k') | dart/tests/try/cursor_position_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698