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

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

Issue 211273002: Rename "inputPre" to "mainEditorPane". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also update test. Created 6 years, 9 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/editor.dart ('k') | dart/site/try/src/ui.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 05260bfbc90999ac5b92fb6181cdb76942fe4b88..431dbe870008e1b58207872d569c92fc99d773a0 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -28,7 +28,7 @@ import 'compilation.dart' show
import 'ui.dart' show
currentTheme,
hackDiv,
- inputPre,
+ mainEditorPane,
observer,
outputDiv;
@@ -170,7 +170,7 @@ class InitialState extends InteractionState {
for (String query in const ['a.diagnostic>span',
'.dart-code-completion',
'.hazed-suggestion']) {
- for (Element element in inputPre.querySelectorAll(query)) {
+ for (Element element in mainEditorPane.querySelectorAll(query)) {
element.remove();
}
}
@@ -191,8 +191,8 @@ class InitialState extends InteractionState {
}
}
- if (!inputPre.nodes.isEmpty && inputPre.nodes.last is Text) {
- Text text = inputPre.nodes.last;
+ if (!mainEditorPane.nodes.isEmpty && mainEditorPane.nodes.last is Text) {
+ Text text = mainEditorPane.nodes.last;
if (!text.text.endsWith('\n')) {
text.appendData('\n');
}
@@ -230,18 +230,18 @@ class InitialState extends InteractionState {
}
}
if (selection.isCollapsed) {
- walk4(inputPre);
+ walk4(mainEditorPane);
}
- editor.currentSource = inputPre.text;
- inputPre.nodes.clear();
- inputPre.appendText(editor.currentSource);
+ editor.currentSource = mainEditorPane.text;
+ mainEditorPane.nodes.clear();
+ mainEditorPane.appendText(editor.currentSource);
if (hasSelection) {
- selection.collapse(inputPre.firstChild, anchorOffset);
+ selection.collapse(mainEditorPane.firstChild, anchorOffset);
}
editor.isMalformedInput = false;
- for (var n in new List.from(inputPre.nodes)) {
+ for (var n in new List.from(mainEditorPane.nodes)) {
if (n is! Text) continue;
Text node = n;
String text = node.text;
@@ -263,8 +263,8 @@ class InitialState extends InteractionState {
Text str = node.splitText(splitPoint);
Text after = str.splitText(token.charCount);
offset += splitPoint + token.charCount;
- inputPre.insertBefore(after, node.nextNode);
- inputPre.insertBefore(decoration.applyTo(str), after);
+ mainEditorPane.insertBefore(after, node.nextNode);
+ mainEditorPane.insertBefore(decoration.applyTo(str), after);
if (hasSelection && selectionOffset > node.length) {
selectionOffset -= node.length;
@@ -387,7 +387,8 @@ class CodeCompletionState extends InitialState {
suggestionAccepted();
}
activeCompletion.classes.remove('active');
- inputPre.querySelectorAll('.hazed-suggestion').forEach((e) => e.remove());
+ mainEditorPane.querySelectorAll('.hazed-suggestion')
+ .forEach((e) => e.remove());
// The above changes create mutation records. This implicitly fire mutation
// events that result in saving the source code in local storage.
// TODO(ahe): Consider making this more explicit.
« no previous file with comments | « dart/site/try/src/editor.dart ('k') | dart/site/try/src/ui.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698