diff --git a/.gitignore b/.gitignore
index 61dd8fe..b5440cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
**/dist/*
.vscode/
**/*.wb
+.cargo/config.toml
\ No newline at end of file
diff --git a/assets/save_file.js b/assets/save_file.js
deleted file mode 100644
index a3400a2..0000000
--- a/assets/save_file.js
+++ /dev/null
@@ -1,9 +0,0 @@
-export function saveFile(filename, content) {
- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
- const url = URL.createObjectURL(blob);
- const link = document.createElement("a");
- link.href = url;
- link.download = filename;
- link.click();
- URL.revokeObjectURL(url);
-}
\ No newline at end of file
diff --git a/index.html b/index.html
index f5f0496..eed2bbf 100644
--- a/index.html
+++ b/index.html
@@ -20,7 +20,6 @@
-
diff --git a/src/window.rs b/src/window.rs
index d185549..a3bfa5a 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -910,16 +910,29 @@ impl MyApp {
.show(ui, |my_ui: &mut Ui| {
let editor = TextEdit::multiline(&mut self.code)
.code_editor()
- .desired_width(0.0);
+ .desired_width(0.0).show(my_ui);
- let res = my_ui.add(editor);
+ let res = editor.response;
if self.autosave && res.lost_focus() {
debug!("Saving file");
self.saved_feedback = self.auto_save_file();
}
-
- *editor_focused = res.has_focus().clone();
+
+ *editor_focused = (&res).has_focus().clone();
+
+ // FIXME: Does not work because TextEdit is lacking the Sense(click)
+ // res.context_menu(|ui| {
+ // if ui.button("Copy").clicked() {
+ // if let Some(cursor_range) = editor.cursor_range {
+ // let start = cursor_range.primary.ccursor.index;
+ // let end = cursor_range.secondary.ccursor.index;
+
+ // let text = &self.code[start..end];
+ // ui.output_mut(|o| o.copied_text = String::from(text));
+ // }
+ // }
+ // });
});
if ui.button(t!("btn.libraries", lang)).clicked() {