Repository: cantino/mcfly (language: rust)

Issue:
MCFLY_DISABLE_MENU is not used in any way since v0.8.0
After upgrade to v0.8.0 `MCFLY_DISABLE_MENU` is not used in any way. Merge commit e899f4f70f90dff1a94c3a4390c63fbb33e5fa88 removed  `if !self.settings.disable_menu` condition in `menubar` function (`interface.rs`).


Discussion / hints:

Fix patch:
diff --git a/src/interface.rs b/src/interface.rs
index b6e84f77..d40421e9 100644
--- a/src/interface.rs
+++ b/src/interface.rs
@@ -162,24 +162,26 @@ impl<'a> Interface<'a> {
     }
 
     fn menubar<W: Write>(&self, screen: &mut W) {
-        let (width, _height): (u16, u16) = terminal::size().unwrap();
+        if !self.settings.disable_menu {
+            let (width, _height): (u16, u16) = terminal::size().unwrap();
 
-        queue!(
-            screen,
-            cursor::Hide,
-            cursor::MoveTo(0, self.info_line_index()),
-            Clear(ClearType::CurrentLine),
-            SetBackgroundColor(self.menu_mode.bg()),
-            SetForegroundColor(Color::White),
-            cursor::MoveTo(1, self.info_line_index()),
-            Print(format!(
-                "{text:width$}",
-                text = self.menu_mode.text(self),
-                width = width as usize - 1
-            )),
-            SetBackgroundColor(Color::Reset)
-        )
-        .unwrap();
+            queue!(
+                screen,
+                cursor::Hide,
+                cursor::MoveTo(0, self.info_line_index()),
+                Clear(ClearType::CurrentLine),
+                SetBackgroundColor(self.menu_mode.bg()),
+                SetForegroundColor(Color::White),
+                cursor::MoveTo(1, self.info_line_index()),
+                Print(format!(
+                    "{text:width$}",
+                    text = self.menu_mode.text(self),
+                    width = width as usize - 1
+                )),
+                SetBackgroundColor(Color::Reset)
+            )
+            .unwrap();
+        }
     }
 
     fn prompt<W: Write>(&self, screen: &mut W) {


Test patch: