zed icon indicating copy to clipboard operation
zed copied to clipboard

Status bar line number shows wrong value when in a multibuffer

Open Daste745 opened this issue 9 months ago • 1 comments

Summary

The line number displayed in the status bar doesn't correspond to any actual line number when using a multibuffer.

Description

When showing files in a multibuffer (e.g. project search), the line number displayed in the status bar is relative to the multibuffer, not in individual files.

This is confusing, because jumping to the shown line doesn't match up with the multibuffer's lines while also not matching with individual file line numbers.

Steps to reproduce:

  1. Deploy a project-wide search
  2. Search for a commonly appearing term in order to display a multibuffer
  3. Observe the line number in the status bar showing a number relative to the multibuffer's start
  4. Jump to the shown line number (ctrl-g)
  5. Observe the focused line not matching with the status bar's line number (see screenshot)

Expected Behavior: Line number in the status bar is relative to individual files.

Actual Behavior: Line number in the status bar is relative to the whole multibuffer.

Image

Zed Version and System Specs

Zed: v0.187.8 (Zed) OS: Linux Wayland endeavouros unknown Memory: 22.3 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 25.1.1-arch1.1

Daste745 avatar May 27 '25 14:05 Daste745

That seems reasonable, especially because our vim command mode line jumping :{line_num} tries to jump to line relative to the current excerpt, not relative to the multibuffer as it is in the status bar

probably-neb avatar May 27 '25 14:05 probably-neb