Lhc_fl
(Linca)
12 Agosto 2025, 3:15am
2
L’ho controllato e ho scoperto che l’errore dovrebbe essere in questa riga
let operation = OP.NONE;
const applyEmptyLines = opts && opts.applyEmptyLines;
return lines
.map((l) => {
if (!applyEmptyLines && l.length === 0) {
return l;
}
if (
operation !== OP.ADDED &&
l.slice(0, hlen) === hval &&
(tlen === 0 || l.slice(-tlen) === tail)
) {
operation = OP.REMOVED;
if (tlen === 0) {
const result = l.slice(hlen);
[hval, hlen] = getHead(head, hval);
return result;
} else if (l.slice(-tlen) === tail) {
Non rileva i segni su entrambi i lati, ma rileva solo il segno a destra (coda). Se un segno appare sul lato destro del testo selezionato, entra nel blocco di eliminazione
Ciò significa che something** diventerà mething premendo ctrl + b
Ho creato una PR per risolvere il problema
main ← Lhcfl:fix-applysurround
opened 03:11AM - 12 Aug 25 UTC
…d text
In the current Textarea Editor `applySurround`, only the right side i… s checked. That means if you write `something**`, pressing `Ctrl + B` will unexpectedly turn it into `mething`, since the `TextareaTextManipulation` detected the double asterisk `**` on the right and thought `something**` was the bold syntax, so it removed it.
This commit fixes the bug here.
Related meta topic: https://meta.discourse.org/t/-/358800
7 Mi Piace