micro-editor / micro-editor/micro

MoveLinesUp doesn't scroll the view to follow the selection when it moves above the viewport

Open
#4,134 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description

When moving a multi-line selection up with MoveLinesUp (Alt+), the selected lines move correctly but the view does not scroll to follow them once the block moves above the top of the viewport - the moved text disappears off the top of the screen.

MoveLinesDown (Alt+) does not have this problem: the view scrolls to keep the block visible as it moves past the bottom edge.

Steps to reproduce
  1. Open a file longer than the terminal height.
  2. Scroll so the cursor/selection is near the top of the viewport.
  3. Select several lines (e.g. Shift+).
  4. Hold Alt+ to move the block upward past the top of the view.
Environment
  • Version: 2.0.15
  • OS: ArchLinux 7.0.14
  • Terminal: native linux terminal (no GUI)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the MoveLinesUp and MoveLinesDown command implementations and compare how each handles viewport scrolling after moving a selection. Reproduce the issue with a multi-line selection near the top of a terminal-sized view, then verify that MoveLinesUp keeps the moved block visible as it crosses the top edge, matching MoveLinesDown.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.