Skip to content
Snippets Groups Projects
Commit 48a00d4d authored by Sag0Sag0's avatar Sag0Sag0 Committed by Michael Aaron Murphy
Browse files

Make pushd change director. Fix issue #697. (#698)

* Make pushd change directory

* Use zen3gr's fix for doctests
parent 18b6f5eb
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ impl Index {
/// Construct an index using the following convetions:
/// - A positive value `n` represents `Forward(n)`
/// - A negative value `-n` reprents `Backwards(n - 1)` such that:
/// ```
/// ```ignore,rust
/// assert_eq!(Index::new(-1), Index::Backward(0))
/// ```
pub(crate) fn new(input: isize) -> Index {
......
......@@ -48,7 +48,7 @@ impl Range {
/// Returns the bounds of this range as a tuple containing:
/// - The starting point of the range
/// - The length of the range
/// ```
/// ```ignore,rust
/// let vec = vec![0, 1, 2, 3, 4, 5, 6, 7, 8];
/// let range = Range::exclusive(Index::new(1), Index::new(5));
/// let (start, size) = range.bounds(vec.len()).unwrap();
......
......@@ -163,6 +163,7 @@ impl DirectoryStack {
Action::Push(dir) => {
let index = if keep_front { 1 } else { 0 };
self.insert_dir(index, dir, variables);
self.set_current_dir_by_index(index, "pushd")?;
}
};
......
......@@ -21,7 +21,7 @@ pub type HashMapVariableContext = FnvHashMap<Identifier, HashMap>;
/// Additionally it will call `Into::into` on each of its members so that one
/// can pass in any type with some `To<SmallString>` implementation; they will
/// automatically be converted to owned SmallStrings.
/// ```
/// ```ignore,rust
/// let verbose = Array::from_vec(vec!["foo".into(), "bar".into(),
/// "baz".into(), "zar".into(),
/// "doz".into()]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment