mirror of
https://github.com/nushell/nushell.git
synced 2025-03-11 05:58:15 +01:00
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:
parent
a2e335dcd7
commit
781c4bd1d7
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user