From 5ab5405b6f50ad0eae0cab32772cb32c5b4a4781 Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Thu, 7 Mar 2024 21:30:05 -0500 Subject: [PATCH] Simpler comparison Co-authored-by: missionfloyd --- javascript/edit-attention.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js index 01069449f..b07ba97cb 100644 --- a/javascript/edit-attention.js +++ b/javascript/edit-attention.js @@ -65,10 +65,10 @@ function keyupEditAttention(event) { } // deselect surrounding whitespace - while (target.value.slice(selectionStart, selectionStart + 1) == " " && selectionStart < selectionEnd) { + while (text[selectionStart] == " " && selectionStart < selectionEnd) { selectionStart++; } - while (target.value.slice(selectionEnd - 1, selectionEnd) == " " && selectionEnd > selectionStart) { + while (text[selectionEnd - 1] == " " && selectionEnd > selectionStart) { selectionEnd--; }