You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/go-to-line.js
+4-9Lines changed: 4 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,7 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
22
22
}
23
23
}
24
24
25
-
blockSearch(dialog,event){
26
-
if(event.ctrlKey&&event.key=='g'){
27
-
returnevent.preventDefault();
28
-
}
29
-
}
30
-
25
+
/* Called with a dialog box keyup event to check the validity of the line number entered and submit the dialog if Enter is pressed */
31
26
checkPrompt(dialog,event){
32
27
// Line number(:column number)
33
28
constlines=dialog.textarea.value.split('\n');
@@ -64,6 +59,7 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
64
59
}
65
60
}
66
61
62
+
/* Called with a dialog box keyup event to close and clear the dialog box */
67
63
cancelPrompt(dialog,event){
68
64
letdelay;
69
65
event.preventDefault();
@@ -115,7 +111,7 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
115
111
}
116
112
}
117
113
118
-
/* Set the cursor on the first non-space char of textarea's nth line; and scroll it into view */
114
+
/* Set the cursor on the first non-space char of textarea's nth line, or to the columnNo-numbered character in the line if it's not 0; and scroll it into view */
119
115
goTo(textarea,lineNo,columnNo=0){
120
116
letfontSize;
121
117
letlineHeight;
@@ -155,12 +151,11 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
155
151
}
156
152
}
157
153
158
-
/* Event handlers */
154
+
/* Event handler for keydown event that makes Ctrl+G open go to line dialog */
Copy file name to clipboardExpand all lines: tests/hljs.html
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,18 @@
32
32
<scriptsrc="tester.js"></script>
33
33
</head>
34
34
<body>
35
-
<!--TODO: Fix for hljs popup &
35
+
<!--TODO:
36
+
Test with real Prism &
37
+
Fix for hljs popup &
36
38
(optional) In new branch, make Ctrl+F/H functionality like gotoline (finds in value, "string combinatorics" in pre code, Regex/case-insensitive accepted); Add tests for Ctrl+F/H
37
39
(optional) In new branch, add one-line (input) option
38
-
Make tester async function using await?-->
40
+
Make tester async function using await?
41
+
Stop enter in go-to dialog from submitting form-->
39
42
<h1>code-input Tester (highlight.js)</h1>
40
43
<h4><ahref="prism.html">Test for Prism.js</a></h4>
41
44
<p>This page carries out automated tests for the code-input library to check that both the core components and the plugins work in some ways. It doesn't fully cover every scenario so you should test any code you change by hand, but it's good for quickly checking a wide range of functionality works.</p>
<h4><ahref="hljs.html">Test for highlight.js</a></h4>
32
32
<p>This page carries out automated tests for the code-input library to check that both the core components and the plugins work in some ways. It doesn't fully cover every scenario so you should test any code you change by hand, but it's good for quickly checking a wide range of functionality works.</p>
0 commit comments