linted ace2_inner

This commit is contained in:
John McLear 2021-01-07 21:07:29 +00:00
parent 34c7fb0c46
commit 01fe885adc

View file

@ -3054,11 +3054,7 @@ function Ace2Inner() {
const isPageDown = evt.which === 34; const isPageDown = evt.which === 34;
const isPageUp = evt.which === 33; const isPageUp = evt.which === 33;
const linesLength = rep.lines.length();
let previousCharacterOffset; let previousCharacterOffset;
// boolean - reflects if the user is attempting to highlight content
const highlighting = shiftKey && (rep.selStart[0] !== rep.selEnd[0] || rep.selStart[1] !== rep.selEnd[1]);
const isShiftKey = shiftKey; const isShiftKey = shiftKey;
if (isPageUp) { if (isPageUp) {
// Approach #99991248928175 to solve this problem.... // Approach #99991248928175 to solve this problem....
@ -3128,9 +3124,6 @@ function Ace2Inner() {
if (isPageDown) { if (isPageDown) {
// Bottom of document - do nothing if we are at the very end // Bottom of document - do nothing if we are at the very end
// JM TODO: Check if Linemarker modifies width.. // JM TODO: Check if Linemarker modifies width..
const lengthOfLastLine = rep.lines.atIndex(rep.selEnd[0]).width - 1;
const endOfLine = lengthOfLastLine === rep.selEnd[1];
const atBottom = (rep.lines.length() - 1) === rep.selEnd[0];
const originalPosition = scroll._getViewPortTopBottom(); const originalPosition = scroll._getViewPortTopBottom();
scroll.movePage('down'); scroll.movePage('down');
@ -3175,7 +3168,7 @@ function Ace2Inner() {
if (!hasMoved && isShiftKey && rep.selFocusAtStart) { if (!hasMoved && isShiftKey && rep.selFocusAtStart) {
// we're at the bottom so select the last bit of content. // we're at the bottom so select the last bit of content.
rep.selStart[0] = rep.selEnd[0]; rep.selStart[0] = rep.selEnd[0];
rep.selStart[1] = rep.selEnd[1] rep.selStart[1] = rep.selEnd[1];
rep.selEnd[0] = rep.lines.length() - 1; rep.selEnd[0] = rep.lines.length() - 1;
rep.selEnd[1] = rep.lines.atIndex(rep.selStart[0]).length; rep.selEnd[1] = rep.lines.atIndex(rep.selStart[0]).length;
retainPosition = false; retainPosition = false;