Skip to content

Jumping into a file that isn't open yet lands the line two rows below the sticky lines #588

Closed

Description

@jamescrosswell

Context

When a jump opens a file that isn't open yet, its line lands right under the sticky lines, with no context above it. Once a file is open, jumps land two rows below the pins (#349). The pins come from a scan that runs a little at a time between frames, so a freshly opened file has none yet when the jump scrolls. When the file's pins first become known, scroll the jump again so the line lands where Go to line puts it, unless the user has moved since. Pitch: #504.

Acceptance criteria

Try each in a C# file with sticky lines on, picking a line deep inside a method so a class and a method are pinned above it:

  • tuicode <file>:<line> from a terminal opens the file with the line two rows below the sticky lines, with the two lines before it in view, the same as Go to line gives once the file is open.
  • Enter on a Find in files result in a file that isn't open lands the same way.
  • Go to definition, Usages, Go to symbol, the History panel, and Back/Forward into a closed file land the same way.
  • With word wrap on, the line still lands two rows below the sticky lines.
  • If I scroll, type, click or move the cursor before the sticky lines appear, the view stays where I put it and doesn't jump.
  • Opening a file without a line (Explorer, Ctrl+O) or reopening one at its remembered position (Reopening a file puts me back where I was in it #514) doesn't scroll any differently from today.

Tests

  • Host tests for at least the command line and Find in files: open a file whose symbol scan takes several frames, and check that the target line ends Reveal.Margin rows below the pinned lines once the scan finishes.
  • A user move (scroll, cursor move, edit) between the jump and the scan finishing cancels the second scroll.
  • Word wrap on.
  • An open that isn't a jump doesn't scroll when the pins arrive.
  • A file small enough to scan in one frame doesn't shift at all.

Out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions