diff --git a/Cargo.lock b/Cargo.lock index ee32946..1befc2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,7 +565,7 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calcifer" -version = "1.3.1" +version = "1.3.2" dependencies = [ "arboard", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 30df35c..0078c20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "calcifer" -version = "1.3.1" +version = "1.3.2" edition = "2021" # 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" arboard = "3.3.0" egui_dnd = "0.6.0" + +[build] +rustflags = ["--cfg=web_sys_unstable_apis"] diff --git a/calcifer.project b/calcifer.project index 023a695..459cb9b 100644 --- a/calcifer.project +++ b/calcifer.project @@ -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":[]}]} \ No newline at end of file +{"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":[]}]} \ No newline at end of file diff --git a/src/core/ui.rs b/src/core/ui.rs index c6d2174..8532f82 100644 --- a/src/core/ui.rs +++ b/src/core/ui.rs @@ -313,9 +313,11 @@ impl Calcifer { self.search_menu.result_selected = true; } + let tab_id = current_tab.path.clone().to_string_lossy().to_string(); + if self.got_focus { CodeEditor::default() - .id_source("code editor") + .id_source(&tab_id) .with_rows(max(45, lines)) .with_fontsize(self.font_size) .with_theme(self.theme) @@ -333,7 +335,7 @@ impl Calcifer { } CodeEditor::default() - .id_source("code editor") + .id_source(&tab_id) .with_rows(max(45, lines)) .with_fontsize(self.font_size) .with_theme(self.theme)