Skip to content

Commit

Permalink
Merge pull request #59 from webbertakken/allow-using-tab
Browse files Browse the repository at this point in the history
feat(collider): allow tab completion for files
  • Loading branch information
CleanCut authored Nov 15, 2022
2 parents 87f3943 + 1807813 commit 8567aa7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.cargo/config.toml
.vscode
.idea
**/*.rs.bk
**/target
Cargo.lock
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### Improved

- The `collider` (example) editor now snaps to half-pixels.
- The `collider` (example) editor now handles relative paths that begin with `./` or `.\`, which was especially vexing to powershell users. Contributed by [@webbertakken](https://github.com/webbertakken) in [#59].

[#59]: https://github.com/CleanCut/rusty_engine/pull/59

## [5.2.0] - 2022-09-13

Expand Down
8 changes: 7 additions & 1 deletion examples/collider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ fn main() {
std::process::exit(1);
}

// Remove "./" or ".\" from the start of the argument if necessary.
let mut path: PathBuf = args[0]
.as_str()
.trim_start_matches("./")
.trim_start_matches(r".\")
.into();

// If the user passed in `assets/something...` then we need to strip `assets/` (the asset loader will prepend `assets/`)
let mut path = PathBuf::from(args[0].clone());
if path.starts_with("assets") {
path = path.strip_prefix("assets").unwrap().to_path_buf();
}
Expand Down

0 comments on commit 8567aa7

Please sign in to comment.