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

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js

Issue 2332013002: DevTools: Allow PageUp to fall through text editor (Closed)
Patch Set: Style Created 4 years, 3 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 | third_party/WebKit/Source/devtools/front_end/text_editor/cmdevtools.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
index 2734f7844e7dffa77ee8322a1176be611da526fd..4f27a0a3805a1d69bb03aaf5dbc67c65481c5507 100644
--- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
@@ -64,8 +64,8 @@ WebInspector.CodeMirrorTextEditor = function(options)
"Down": "goLineDown",
"End": "goLineEnd",
"Home": "goLineStartSmart",
- "PageUp": "goPageUp",
- "PageDown": "goPageDown",
+ "PageUp": "smartPageUp",
+ "PageDown": "smartPageDown",
"Delete": "delCharAfter",
"Backspace": "delCharBefore",
"Tab": "defaultTab",
@@ -289,6 +289,26 @@ CodeMirror.commands.dismiss = function(codemirror)
}
/**
+ * @return {!Object|undefined}
+ */
+CodeMirror.commands.smartPageUp = function(codemirror)
+{
+ if (codemirror._codeMirrorTextEditor.selection().equal(WebInspector.TextRange.createFromLocation(0, 0)))
+ return CodeMirror.Pass;
+ codemirror.execCommand("goPageUp");
+}
+
+/**
+ * @return {!Object|undefined}
+ */
+CodeMirror.commands.smartPageDown = function(codemirror)
+{
+ if (codemirror._codeMirrorTextEditor.selection().equal(codemirror._codeMirrorTextEditor.fullRange().collapseToEnd()))
+ return CodeMirror.Pass;
+ codemirror.execCommand("goPageDown");
+}
+
+/**
* @param {string} quoteCharacter
* @param {!CodeMirror} codeMirror
* @return {*}
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/text_editor/cmdevtools.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698