nushell/crates/nu-std/std
Bob Hyman ec3e4ce120
dirs goto: update current ring slot before leaving it. (#10706)
Fixes #10696

# Description

As reported, you could mess up the ring of remembered directories in
`std dirs` (a.k.a the `shells` commands) with a sequence like this:
```
~/test> mkdir b c

~/test> pushd b
~/test/b> cd ../c
~/test/c> goto 0
~/test> goto 1
## expect to end up in ~/test/c
## observe you're in ~/test/b
~/test/b>
```
Problem was `dirs goto` was not updating the remembered directories
before leaving the current slot for some other. This matters if the user
did a manual `cd` (which cannot update the remembered directories ring)

# User-Facing Changes
None! it just works ™️

# Tests + Formatting

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

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-10-13 06:46:51 -05:00
..
assert.nu improve assertion error messages in std assert (#10551) 2023-10-01 16:40:24 +02:00
dirs.nu dirs goto: update current ring slot before leaving it. (#10706) 2023-10-13 06:46:51 -05:00
dt.nu std dt datetime-diff: fix uninitialized field ref when borrowing (#10466) 2023-09-24 10:53:56 +02:00
formats.nu add to ndjson and to jsonl to the standard library (#10519) 2023-10-02 11:50:07 +02:00
help.nu differentiating between --x and --x: bool (#10456) 2023-09-23 10:20:48 +02:00
input.nu Command to get individual keys (#9453) 2023-07-03 10:23:44 -05:00
iter.nu Add long options for filters (#10641) 2023-10-08 13:12:46 +02:00
log.nu remove underline from std NU_LOG_FORMAT (#10604) 2023-10-04 13:30:49 -05:00
math.nu move math constants to standard library (#9678) 2023-09-05 19:32:31 +02:00
mod.nu add Ellie to the standard library (#10686) 2023-10-11 11:36:16 -05:00
testing.nu Add long options for filters (#10641) 2023-10-08 13:12:46 +02:00
xml.nu Improve type hovers (#9515) 2023-06-29 05:19:48 +12:00