fixed undo move through tab issue

This commit is contained in:
WanderingPenwing 2024-07-22 13:28:07 +02:00
parent 59bc07fe56
commit 7c29b40688
4 changed files with 10 additions and 5 deletions

2
Cargo.lock generated
View file

@ -565,7 +565,7 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
[[package]] [[package]]
name = "calcifer" name = "calcifer"
version = "1.3.1" version = "1.3.2"
dependencies = [ dependencies = [
"arboard", "arboard",
"eframe", "eframe",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "calcifer" name = "calcifer"
version = "1.3.1" version = "1.3.2"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -16,3 +16,6 @@ nix = { version = "0.27.1", features = ["fs"] }
homedir = "0.2.1" homedir = "0.2.1"
arboard = "3.3.0" arboard = "3.3.0"
egui_dnd = "0.6.0" egui_dnd = "0.6.0"
[build]
rustflags = ["--cfg=web_sys_unstable_apis"]

View file

@ -1 +1 @@
{"categories":[{"name":"to do","content":[{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"bug project","description":"when switching tabs between two project file, if item window is open it crashes","id":1},{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5},{"name":"export copy paste fix","description":"// Hello there","id":1},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"file tree id ?","description":"// Hello there","id":1}]},{"name":"in progress","content":[]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1}]},{"name":"+","content":[]}]} {"categories":[{"name":"to do","content":[{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"bug project","description":"when switching tabs between two project file, if item window is open it crashes","id":1},{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"file tree id ?","description":"// Hello there","id":1}]},{"name":"in progress","content":[{"name":"export copy paste fix","description":"// Hello there","id":1}]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1}]},{"name":"+","content":[]}]}

View file

@ -313,9 +313,11 @@ impl Calcifer {
self.search_menu.result_selected = true; self.search_menu.result_selected = true;
} }
let tab_id = current_tab.path.clone().to_string_lossy().to_string();
if self.got_focus { if self.got_focus {
CodeEditor::default() CodeEditor::default()
.id_source("code editor") .id_source(&tab_id)
.with_rows(max(45, lines)) .with_rows(max(45, lines))
.with_fontsize(self.font_size) .with_fontsize(self.font_size)
.with_theme(self.theme) .with_theme(self.theme)
@ -333,7 +335,7 @@ impl Calcifer {
} }
CodeEditor::default() CodeEditor::default()
.id_source("code editor") .id_source(&tab_id)
.with_rows(max(45, lines)) .with_rows(max(45, lines))
.with_fontsize(self.font_size) .with_fontsize(self.font_size)
.with_theme(self.theme) .with_theme(self.theme)