Skip to content

Commit 0c3af7c

Browse files
committed
Some compatibility changes in plugins; disabled messy Ctrl+F fix for now
1 parent dd1fc54 commit 0c3af7c

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

code-input.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ code-input {
99
top: 0;
1010
left: 0;
1111
display: block;
12-
overflow: auto;
12+
overflow-y: auto;
13+
overflow-x: auto;
1314

1415
/* Normal inline styles */
1516
margin: 8px;
@@ -42,14 +43,12 @@ code-input textarea, code-input:not(.code-input_pre-element-styled) pre code, co
4243
margin: 0px!important;
4344
padding: var(--padding, 16px)!important;
4445
border: 0;
45-
width: calc(100% - var(--padding, 16px) * 2);
46+
min-width: calc(100% - var(--padding, 16px) * 2);
4647
min-height: calc(100% - var(--padding, 16px) * 2);
47-
4848
overflow: hidden;
4949
resize: none;
50-
51-
grid-row: 1 2;
52-
grid-column: 1 2;
50+
grid-row: 1;
51+
grid-column: 1;
5352
}
5453

5554
code-input:not(.code-input_pre-element-styled) pre, code-input.code-input_pre-element-styled pre code {

code-input.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ var codeInput = {
514514
* to syntax-highlight it. */
515515

516516
needsHighlight = false; // Just inputted
517-
needsDisableDuplicateSearching = false; // Just highlighted
517+
// needsDisableDuplicateSearching = false; // Just highlighted
518518

519519
/**
520520
* Highlight the code ASAP
@@ -536,13 +536,13 @@ var codeInput = {
536536
console.log("Update");
537537
this.update();
538538
this.needsHighlight = false;
539-
this.needsDisableDuplicateSearching = true;
540-
}
541-
if(this.needsDisableDuplicateSearching && this.codeElement.querySelector("*") != null) {
542-
// Has been highlighted
543-
this.resultElementDisableSearching();
544-
this.needsDisableDuplicateSearching = false;
539+
// this.needsDisableDuplicateSearching = true;
545540
}
541+
// if(this.needsDisableDuplicateSearching && this.codeElement.querySelector("*") != null) {
542+
// // Has been highlighted
543+
// this.resultElementDisableSearching();
544+
// this.needsDisableDuplicateSearching = false;
545+
// }
546546

547547
window.requestAnimationFrame(this.animateFrame.bind(this));
548548
}

plugins/indent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ codeInput.plugins.Indent = class extends codeInput.Plugin {
194194
// Scroll down to cursor if necessary
195195
let paddingTop = Number(getComputedStyle(inputElement).paddingTop.replace("px", ""));
196196
let lineHeight = Number(getComputedStyle(inputElement).lineHeight.replace("px", ""));
197-
let inputHeight = Number(getComputedStyle(inputElement).height.replace("px", ""));
197+
let inputHeight = Number(getComputedStyle(codeInput).height.replace("px", ""));
198198
if(currentLineI*lineHeight + lineHeight*2 + paddingTop >= inputElement.scrollTop + inputHeight) { // Cursor too far down
199199
codeInput.scrollBy(0, Number(getComputedStyle(inputElement).lineHeight.replace("px", "")));
200200
}

0 commit comments

Comments
 (0)