URI: 
       Fixed line/column indicator. - icy_draw - icy_draw is the successor to mystic draw. fork / mirror
  HTML git clone https://git.drkhsh.at/icy_draw.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 9dc66483dbb83d099ba660e17d3f654574d2b9ae
   DIR parent 3144650a95f02d0087ce1eca107da2e524a863d8
  HTML Author: Mike Krüger <mkrueger@posteo.de>
       Date:   Mon, 11 Sep 2023 20:13:59 +0200
       
       Fixed line/column indicator.
       
       Needed to filter the strange unicode chars.
       
       Diffstat:
         M i18n/de/icy_draw.ftl                |       4 ++--
         M src/ui/document_docking.rs          |      12 ++++++++++--
         M src/ui/top_bar.rs                   |       5 +++--
       
       3 files changed, 15 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/i18n/de/icy_draw.ftl b/i18n/de/icy_draw.ftl
       @@ -129,9 +129,9 @@ edit-canvas-size-height-label=Höhe:
        edit-canvas-size-resize=Größe ändern
        edit-canvas-size-resize_layers-label=Ebenen anpassen
        
       -toolbar-size = { $colums ->
       +toolbar-size = {$colums ->
             [1] 1 Zeile
       -*[other] { $colums } Zeilen
       +*[other] {$colums} Zeilen
        } x { $rows ->
             [1] 1 Spalte
        *[other] { $rows } Spalten
   DIR diff --git a/src/ui/document_docking.rs b/src/ui/document_docking.rs
       @@ -337,13 +337,21 @@ impl egui_tiles::Behavior<DocumentTab> for DocumentBehavior {
                                            column = (pos.x + 1)
                                        )
                                    };
       +                            let mut txt2 = String::new();
       +                            let mut char_count = 0;
       +                            for c in txt.chars() {
       +                                if (c as u32) < 255 {
       +                                    txt2.push(c);
       +                                    char_count += 1;
       +                                }
       +                            }
        
       -                            let mut buffer = Buffer::new((txt.chars().count(), 1));
       +                            let mut buffer = Buffer::new((char_count, 1));
                                    buffer.is_terminal_buffer = true;
                                    let mut attr: TextAttribute = TextAttribute::default();
                                    attr.set_foreground(15);
        
       -                            for (i, mut c) in txt.chars().enumerate() {
       +                            for (i, mut c) in txt2.chars().enumerate() {
                                        if c as u32 > 255 {
                                            c = ' ';
                                        }
   DIR diff --git a/src/ui/top_bar.rs b/src/ui/top_bar.rs
       @@ -45,9 +45,10 @@ impl MainWindow {
                menu::bar(ui, |ui| {
                    let mut has_buffer = false;
                    let mut is_dirty = false;
       +            let mut has_pane = false;
                    if let Some(pane) = self.get_active_pane() {
                        is_dirty = pane.is_dirty();
       -
       +                has_pane = true;
                        if let Ok(doc) = pane.doc.lock() {
                            has_buffer = doc.get_ansi_editor().is_some();
                        }
       @@ -78,7 +79,7 @@ impl MainWindow {
                        );
                        ui.separator();
                        self.commands.save.ui_enabled(ui, is_dirty, &mut result);
       -                self.commands.save_as.ui_enabled(ui, is_dirty, &mut result);
       +                self.commands.save_as.ui_enabled(ui, has_pane, &mut result);
                        self.commands.export.ui_enabled(ui, has_buffer, &mut result);
                        ui.separator();
                        self.commands.edit_font_outline.ui(ui, &mut result);