Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Viewport glitching while writing/coding in NEST+ #32

@cachebag

Description

@cachebag

Describe the bug
When typing in a file in NEST+, if you attempt to press U or Ctrl+R in NORMAL mode, (where U is undo and Ctrl+R is redo), and then you click any of the up, down left or right arrow keys, the viewport will position itself to the top of the file.

NOTE: To swap betweenNORMAL and INSERT mode, simply press Esc. Please reference the docs in the README.md if you are not familiar with vim motions.

To Reproduce
Steps to reproduce the behavior:

  1. Go to NEST+
  2. Open any file
  3. Scroll down to any line and begin typing
  4. TypeU in NORMAL mode to Undo and consequently type Ctrl+R to redo an undone state
  5. Notice how the cursor position resets to the top of the file no matter waht
    NOTE: You can also simply press U when typing and press the arrow keys to see this bug, though it should be noted that this should not be the case for either redo or undo keybinds.

It seems that our view port can't find where our cursor is when we delete a line and then try to undo or redo that movement.

Expected behavior
The viewport should keep us at whatever line was edited . So if I delete a line at position 85 in our file, and then I undo that deletion, it should put me back at line 85 or the cursor_pos before doing U or Ctrl+R

Terminal(s):

  • Kitty
  • iTerm2
  • Alacritty
  • macOS terminal

Additional context
Note how cursor_pos and relevant variables are stored and tracked for commands like dd or de. We can probably implement something similar to this where our cursor position is stored and retained when all commands are called, including U and Ctrl+R

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions