Browse Source

map: fixed errors

lunar-mining 4 năm trước cách đây
mục cha
commit
16925f0f5e
2 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 5 3
      bin/map/src/list.rs
  2. 1 1
      bin/map/src/main.rs

+ 5 - 3
bin/map/src/list.rs

@@ -16,7 +16,7 @@ impl NodeExtra {
     }
     }
 
 
     pub fn make_noise() -> String {
     pub fn make_noise() -> String {
-        String::new("USEFUL NODE INFO")
+        String::new()
     }
     }
 }
 }
 #[derive(Clone)]
 #[derive(Clone)]
@@ -41,7 +41,7 @@ impl StatefulList {
                 } else {
                 } else {
                     i + 1
                     i + 1
                 }
                 }
-                index == i;
+                //index == i;
             }
             }
             None => 0,
             None => 0,
         };
         };
@@ -49,6 +49,8 @@ impl StatefulList {
     }
     }
 
 
     pub fn previous(&mut self) {
     pub fn previous(&mut self) {
+        let index = self.nodex.index;
+
         let i = match self.state.selected() {
         let i = match self.state.selected() {
             Some(i) => {
             Some(i) => {
                 if i == 0 {
                 if i == 0 {
@@ -56,7 +58,7 @@ impl StatefulList {
                 } else {
                 } else {
                     i - 1
                     i - 1
                 }
                 }
-                index == i;
+                //index == i;
             }
             }
             None => 0,
             None => 0,
         };
         };

+ 1 - 1
bin/map/src/main.rs

@@ -58,7 +58,7 @@ fn run_app<B: Backend>(
                 }
                 }
                 Key::Char('j') => app.node_list.next(),
                 Key::Char('j') => app.node_list.next(),
                 Key::Char('k') => app.node_list.previous(),
                 Key::Char('k') => app.node_list.previous(),
-                Key::Char('\n') => app.show_popup = !app.show_popup,
+                //Key::Char('\n') => app.show_popup = !app.show_popup,
                 _ => (),
                 _ => (),
             }
             }
         }
         }