summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2024-01-26 21:28:44 +0100
committerqkzk <qu3nt1n@gmail.com>2024-01-26 21:28:44 +0100
commit0d4b7f718b2c91f50a5306acb3fe42e27d055c5d (patch)
tree254d97e3cd5d0783cb5b1d18809dddee84bb44f8
parent17b50abcfe766a50cc071c118d954cf3c37032c7 (diff)
erase old binds while building
-rw-r--r--build.rs19
-rw-r--r--development.md5
2 files changed, 22 insertions, 2 deletions
diff --git a/build.rs b/build.rs
index 3157f934..b5ae01c1 100644
--- a/build.rs
+++ b/build.rs
@@ -20,4 +20,23 @@ fn main() {
Ok(_) => (),
Err(e) => eprintln!("{e:?}"),
}
+
+ update_breaking_config()
+}
+
+/// Remove old binds from user config file.
+///
+/// Remove all binds to `Jump` and `Mocp...` variants since they were removed from fm.
+fn update_breaking_config() {
+ let config = shellexpand::tilde("~/.config/fm/config.yaml");
+ let config: &str = config.borrow();
+ let content = std::fs::read_to_string(config)
+ .expect("config file should be readable")
+ .lines()
+ .map(String::from)
+ .filter(|line| !line.contains("Jump"))
+ .filter(|line| !line.contains("Mocp"))
+ .collect::<Vec<String>>()
+ .join("\n");
+ std::fs::write(config, &content).expect("config should be writabe");
}
diff --git a/development.md b/development.md
index 64f69597..bce47866 100644
--- a/development.md
+++ b/development.md
@@ -858,10 +858,10 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
#### Summary
-- BREAKING: removed jump mode completeley. If you bound a key to this mode in your config, you have to remove it.
+- BREAKING: removed jump mode completeley.
You can see your flagged files in the display::flagged mode, default bind: <F>.
- BREAKING: removed all MOCP controls from fm. What was it doing there anyway ?.
- You will have to remove all your custom binds to MOCP control from your config file to make it work.
+ Those change won't break your config file. While building the application, line with reference to removed binds will be erased.
- search with regex. You can search (Char('/')) a regex pattern. Search next (Char('f')) will use that regex.
- left or right aligned and clickable elements in header
- shift+up, shift+down while typing something cycle trough previous entries.
@@ -920,6 +920,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] gradient over listing, using an iter instead of a vector
- [x] FIX win second use 1 more line
- [x] FIX: entering sort doesn't set focus
+- [x] update config from build file by removing references to removed binds.
- [ ] ???
## TODO