             currentValue.substring(cursorPos);
                textarea.value = newValue;
                textarea.focus();
                textarea.selectionStart = textarea.selectionEnd = startIndex + 1 + newWord.length;
            };

            textarea.addEventListener('input', () => {
                const currentValue = textarea.value;
                const cursorPos = textarea.selectionStart;
                const startIndex = findIndexOfCurrentWord();

                // Extract just the current