Skip to content

Helix mode, problems near empty line at the end of the file #35616

@romaninsh

Description

@romaninsh

Summary

Second-to-last line behaves weirdly if inlay-hints are enabled and last line is empty.

  1. Use this minimal config:
{
  "ui_font_size": 16,
  "buffer_font_size": 15,
  "vim_mode": true,
  "inlay_hints": {
    "enabled": true // <-- IMPORTANT FOR THIS BUG
  },
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  }
}
  1. create test.rs file:
mod test {

    #[test]
    fn test_new() {
        // repeat enough times to cover entire screen vertically
        assert!(true);
        assert!(true);
        assert!(true);
        assert!(true);
        assert!(true);
        assert!(true);
        assert!(true);
        assert!(true);
    }
}

IMPORTANT: label mod test should be visible on the last line

Image
  1. Position cursor like so:
        });
    ˇ}
}
  1. press j

Expected: cursor should appear on next line , just before the inlay text.
Actual: cursor jumps over next line, goes to the last empty line instead

Probably related problem. This one requires Helix mode on:

  1. position cursor here:
        });
    }ˇ mod test <-- NON-SELECTABLE INLAY
}
  1. press V or x

Expected: line with } should be highlighted
Actual: line with } and next empty line is highlighted

Weirdly, if you disable inlay_hints, problem is not occurring.

Zed Version and System Specs

Zed: v0.198.1 (Zed Preview)
OS: macOS 15.5.0
Memory: 32 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions