mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
getCountOfVisibleCharsInViewport functionality
This commit is contained in:
parent
01fe885adc
commit
996f0e8a1d
3 changed files with 166 additions and 71 deletions
|
@ -1441,6 +1441,13 @@ function Ace2Inner() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the node and index into this node that corresponds to a given line number and character
|
||||
* position.
|
||||
*
|
||||
* @params {[number, number]} lineAndChar an array of the form [row, col]
|
||||
* @returns {{node: HTMLElement, index: number, maxIndex: number}}
|
||||
*/
|
||||
function getPointForLineAndChar(lineAndChar) {
|
||||
const line = lineAndChar[0];
|
||||
let charsLeft = lineAndChar[1];
|
||||
|
@ -1455,6 +1462,7 @@ function Ace2Inner() {
|
|||
const lineNode = lineEntry.lineNode;
|
||||
let n = lineNode;
|
||||
let after = false;
|
||||
// at [x, 0] of a line with line attributes
|
||||
if (charsLeft === 0) {
|
||||
const index = 0;
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue