mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
up down better ux
This commit is contained in:
parent
0fdc13a6ad
commit
af6a699db4
1 changed files with 11 additions and 9 deletions
|
@ -3082,26 +3082,28 @@ function Ace2Inner() {
|
|||
rep.selEnd[0] = rep.selEnd[0] + (visibleLineRange[1] - visibleLineRange[0]);
|
||||
}
|
||||
top.console.log(rep.selStart[0]);
|
||||
if (rep.selStart[0] === -1) rep.selStart[0] = 0;
|
||||
if (rep.selEnd[0] === -1) rep.selEnd[0] = 0;
|
||||
if (rep.selStart[0] === -1) {
|
||||
return rep.selStart[0] = 0;
|
||||
}
|
||||
if (rep.selEnd[0] === -1) {
|
||||
return rep.selEnd[0] = 0;
|
||||
}
|
||||
// if the new rep is beyond the viewport
|
||||
// put the caret on the last line at the end of the line
|
||||
top.console.log(rep.selStart[0]);
|
||||
if (rep.selStart[0] >= (linesLength - 1)) {
|
||||
top.console.log('wait wut?');
|
||||
top.console.log('wait wut?', rep.selStart[0], linesLength - 1);
|
||||
let line;
|
||||
// need current character length of line
|
||||
try {
|
||||
line = rep.lines.atIndex(rep.selEnd[0]);
|
||||
} catch (e) {
|
||||
// silently fail, no big deal..
|
||||
line = rep.lines.atIndex(visibleLineRange[1]);
|
||||
}
|
||||
|
||||
let lineLength;
|
||||
if (line) { // need to test if this is needed or not.
|
||||
lineLength = line.width;
|
||||
} else {
|
||||
lineLength = 0;
|
||||
}
|
||||
const lineLength = line.width;
|
||||
|
||||
rep.selStart = [linesLength - 1, lineLength];
|
||||
rep.selEnd = [linesLength - 1, lineLength];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue