Thomas Heartman and Conrad Irwin
d5e297147f
Support relative line number on wrapped lines ( #39268 )
...
**Problem:** Current relative line numbering creates a mismatch with
vim-style navigation when soft wrap is enabled. Users must mentally
calculate whether target lines are wrapped segments or logical lines,
making `<n>j/k` navigation unreliable and cognitively demanding.
**How things work today:**
- Real line navigation (`j/k` moves by logical lines): Requires
determining if visible lines are wrapped segments before jumping. Can't
jump to wrapped lines directly.
- Display line navigation (`j/k` moves by display rows): Line numbers
don't correspond to actual row distances for multi-line jumps.
**Proposed solution:** Count and number each display line (including
wrapped segments) for relative numbering. This creates direct
visual-to-navigational correspondence where the relative number shown
always matches the `<n>j/k` distance needed.
**Benefits:**
- Eliminates mental overhead of distinguishing wrapped vs. logical lines
- Makes relative line numbers consistently actionable regardless of wrap
state
- Preserves intuitive "what you see is what you navigate" principle
- Maintains vim workflow efficiency in narrow window scenarios
Also explained an discussed in
https://github.com/zed-industries/zed/discussions/25733 .
Release Notes:
Release Notes:
- Added support for counting wrapped lines as relative lines and for
displaying line numbers for wrapped segments. Changes
`relative_line_numbers` from a boolean to an enum: `enabled`,
`disabled`, or `wrapped`.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com >
2025-10-27 20:20:45 -06:00
..
2025-10-27 10:05:50 +00:00
2025-10-20 13:52:05 +00:00
2025-10-17 18:58:14 +00:00
2025-10-23 03:57:33 +00:00
2025-10-24 07:48:14 +00:00
2025-10-27 10:05:50 +00:00
2025-10-19 15:52:28 +00:00
2025-10-27 10:05:50 +00:00
2025-10-20 08:35:28 -03:00
2025-10-17 18:58:14 +00:00
2025-10-24 18:19:53 +02:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 21:56:57 +02:00
2025-10-23 17:17:41 +00:00
2025-10-21 10:43:22 +00:00
2025-10-17 18:58:14 +00:00
2025-10-25 02:02:06 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-23 22:38:40 -06:00
2025-10-17 18:58:14 +00:00
2025-10-20 13:26:20 +02:00
2025-10-26 12:44:34 +00:00
2025-10-21 10:43:22 +00:00
2025-10-21 10:43:22 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 22:54:42 +00:00
2025-10-27 22:54:42 +00:00
2025-10-27 16:00:27 +00:00
2025-10-27 13:27:59 -04:00
2025-10-27 17:00:36 +00:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-24 13:25:58 -06:00
2025-10-23 21:04:22 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-24 18:19:53 +02:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-25 22:51:59 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-23 14:13:35 -04:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-21 10:43:22 +00:00
2025-10-27 20:20:45 -06:00
2025-10-22 17:55:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-28 01:37:41 +00:00
2025-09-11 13:56:06 -07:00
2025-10-24 07:52:51 -04:00
2025-10-28 01:37:41 +00:00
2025-10-27 12:38:56 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-10-23 22:38:40 -06:00
2025-10-20 10:30:06 +00:00
2025-10-17 18:58:14 +00:00
2025-10-20 23:54:56 +03:00
2025-10-23 22:38:40 -06:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-27 08:26:39 +00:00
2025-10-17 18:58:14 +00:00
2025-10-28 01:37:41 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 17:49:13 +01:00
2025-10-27 22:54:42 +00:00
2025-10-17 18:58:14 +00:00
2025-10-21 10:43:22 +00:00
2025-10-24 13:25:58 -06:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-26 13:24:26 +00:00
2025-10-27 22:54:42 +00:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-25 20:15:17 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 20:20:45 -06:00
2025-10-17 18:58:14 +00:00
2025-10-27 20:20:45 -06:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-20 17:20:09 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 21:56:57 +02:00
2025-10-27 22:54:42 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:24:44 +00:00
2025-10-23 07:37:37 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:24:44 +00:00
2025-10-23 16:46:27 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-23 22:38:40 -06:00
2025-10-25 01:44:32 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:01:13 +01:00
2025-10-26 12:44:34 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 16:16:16 +01:00
2025-10-24 07:52:51 -04:00
2025-10-23 21:45:48 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 13:24:26 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 20:20:45 -06:00
2025-10-27 10:13:26 -04:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 20:20:45 -06:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 08:26:39 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-24 18:19:53 +02:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-26 10:01:40 +00:00
2025-10-26 13:24:26 +00:00
2025-10-26 12:44:34 +00:00
2025-10-23 04:23:25 +05:30
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-23 16:46:27 +00:00
2025-10-22 19:52:38 +00:00
2025-10-24 07:52:51 -04:00
2025-10-24 14:03:01 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 20:04:36 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 09:53:37 -04:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:58:41 +00:00
2025-10-21 11:29:43 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-27 15:58:41 +00:00
2025-10-25 01:44:32 +00:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-10-27 22:54:42 +00:00
2025-10-27 22:54:42 +00:00
2025-10-27 22:54:42 +00:00
2025-10-28 01:37:41 +00:00
2025-10-17 18:58:14 +00:00