mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-30 04:11:15 -08:00
Allow editing whitespace delimiters
This commit is contained in:
parent
5ef669de08
commit
1cc7c4bfb3
2 changed files with 3 additions and 2 deletions
|
|
@ -46,7 +46,8 @@ function keyupEditAttention(event) {
|
|||
|
||||
function selectCurrentWord() {
|
||||
if (selectionStart !== selectionEnd) return false;
|
||||
const delimiters = opts.keyedit_delimiters + " \r\n\t";
|
||||
let delimiters = opts.keyedit_delimiters.replace(/(^|[^\\])(\\\\)*\\$/, "$&\\").replace(/(^|[^\\])((\\\\)*")/g, "$1\\$2");
|
||||
delimiters = JSON.parse(`"${delimiters}"`);
|
||||
|
||||
// seek backward until to find beggining
|
||||
while (!delimiters.includes(text[selectionStart - 1]) && selectionStart > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue