Lhc_fl
(Linca)
Agosto 12, 2025, 3:15am
2
Verifiquei e descobri que o erro deve estar nesta linha
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) {
Ele não detecta as marcas em ambos os lados, mas apenas detecta a marca à direita (cauda). Se uma marca aparecer no lado direito do texto selecionado, ele entra no bloco de exclusão
Isso significa que something** se tornará mething ao pressionar ctrl + b
Fiz um PR para corrigir isso
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 curtidas