use 0-indexing in explore (#15079)

# Description
The index in `explore --index` starting with 1 is inconsistent with rest
of nushell. Also it tripped me up a few times when I wanted to select a
row with `:nu get n`

# User-Facing Changes
Index in `explore --index` now starts with 0.

# Tests + Formatting

- 🟢 toolkit fmt
- 🟢 toolkit clippy
- 🟢 toolkit test
- 🟢 toolkit test stdlib

# After Submitting
N/A
This commit is contained in:
Bahex 2025-02-11 00:26:42 +03:00 committed by GitHub
parent a2e335dcd7
commit 781c4bd1d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -502,7 +502,7 @@ impl<'a> IndexColumn<'a> {
impl Widget for IndexColumn<'_> {
fn render(self, area: Rect, buf: &mut Buffer) {
for row in 0..area.height {
let i = 1 + row as usize + self.start;
let i = row as usize + self.start;
let text = i.to_string();
let style = nu_style_to_tui(self.style_computer.compute(
"row_index",