twinejs icon indicating copy to clipboard operation
twinejs copied to clipboard

Passage Editor: Undo/Redo moves the cursor out of the visible region

Open sternfuchs opened this issue 3 years ago • 3 comments

Describe the bug.

When using CTRL-Z or CTRL-Y the cursor position becomes invisible. Often (I am not sure, if always) the editor window just scrolls to the top of the text.

Subjective severity: middle to lower.

Steps to reproduce:

Given:

  • A longer text file,
  • the cursor is somewhere in the middle,
  • top of file not in the visible region.

When:

  1. Type a few charakters
  2. Press CTRL Z

Then:

  • Window scrolls to top of file
  • Cursor is still at the previous location, which means: out of the visible region.
  • (Several, not one, characters are removed, which I consider as a defect as well, but not the one I am talking about here.)

Expected behavior:

After using CTRL-Z/Y, the cursor is always visible. No unnecessary scrolling happens -> exactly that scrolling happens that is necessary to undo the last change.

Just like any editor: Notepad++, Eclipse, Word, OpenOffice Writer ... .

Additional context on this problem.

No response

Twine version number

2.5.1

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

Windows

If this problem is occurring with the web version of Twine, what browser does it occur on?

None

Presubmission checklist

  • [ ] I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
  • [X] I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
  • [X] I have read and agree to abide by this project's Code of Conduct.

sternfuchs avatar Dec 03 '22 14:12 sternfuchs

Clarifying "A longer text file"--could you give a character count in a single passage where you see this problem?

klembot avatar Dec 03 '22 22:12 klembot

Clarifying "A longer text file"--could you give a character count in a single passage where you see this problem?

1497, 4255 or 1053 characters. It seems to happen in just every file, as soon as the scroll position is not yet already on the very top.

sternfuchs avatar Dec 04 '22 14:12 sternfuchs

This sounds related to the passage-jumping bug that has been previously identified here, e.g. https://github.com/klembot/twinejs/issues/1202.

hituro avatar Dec 22 '22 22:12 hituro