Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Header view: new view to inspect ELF and PE executables.
- Added a command to change the view (same as pressing `Tab`). Example: `:set view hex` (possible values are `text`, `hex`, and `header`). It can be used in `~/.dz6init` to set the default view when dz6 is loaded.
- Added support for comments / lines starting with `#` in `~/.dz6init`.

## Breaking changes:
- `Tab` cycles through available views now (`Enter` no longer does that).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Once you load a file in **dz6**, you can use the commands below.
| `wq` or `x` | Write changes to file and quit | | |
| `q` | Quit without saving changes | | In replace mode, `T` (truncate) is an exception because it modifies the file immediately. |

If you need permanent settings, create a `$HOME/.dz6init` file containing any of the commands above, one per line. dz6 will load that at startup.
> If you need permanent settings, create a `$HOME/.dz6init` file containing any of the commands above, one per line. dz6 will load that at startup. Lines starting with `#` are ignored.

### Hex view

Expand Down
6 changes: 5 additions & 1 deletion src/initfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ impl App {
let path = home.join(".dz6init");
let data = fs::read_to_string(path)?;

for cmdline in data.lines() {
for cmdline in data
.lines()
.map(str::trim)
.filter(|line| !line.starts_with('#'))
{
parse_command(self, cmdline);
}
}
Expand Down
Loading