Overhauled Highlighting to work with new editor and support multiple selections

This commit is contained in:
n1474335 2022-07-10 22:01:22 +01:00
parent 2785459257
commit 890f645eeb
8 changed files with 104 additions and 393 deletions

View file

@ -186,7 +186,7 @@ async function getDishTitle(data) {
*
* @param {Object[]} recipeConfig
* @param {string} direction
* @param {Object} pos - The position object for the highlight.
* @param {Object[]} pos - The position object for the highlight.
* @param {number} pos.start - The start offset.
* @param {number} pos.end - The end offset.
*/

View file

@ -76,7 +76,7 @@ class ToHex extends Operation {
}
const lineSize = args[1],
len = (delim === "\r\n" ? 1 : delim.length) + commaLen;
len = delim.length + commaLen;
const countLF = function(p) {
// Count the number of LFs from 0 upto p
@ -105,7 +105,7 @@ class ToHex extends Operation {
* @returns {Object[]} pos
*/
highlightReverse(pos, args) {
let delim, commaLen;
let delim, commaLen = 0;
if (args[0] === "0x with comma") {
delim = "0x";
commaLen = 1;
@ -114,7 +114,7 @@ class ToHex extends Operation {
}
const lineSize = args[1],
len = (delim === "\r\n" ? 1 : delim.length) + commaLen,
len = delim.length + commaLen,
width = len + 2;
const countLF = function(p) {