fix: try to fix parent error issues

上级 714efc00
......@@ -9,6 +9,7 @@ Todo:
- [ ] rewrite VSCode-textmate with Rust
- [ ] makefile
- [ ] json
- [ ] external
- [ ] languages main support
- [ ] html
- [ ] lua
......
......@@ -112,24 +112,22 @@ impl StackElement {
}
pub fn reset(&mut self) {
let mut has_parent = true;
if let None = self.parent {
has_parent = false;
self.enter_pos = -1;
self.anchor_pos = -1;
}
while has_parent {
self.enter_pos = -1;
self.anchor_pos = -1;
if let None = self.parent {
has_parent = false;
} else {
// todo: check parent not null
// self = self.parent.unwrap().borrow_mut();
self.parent = None;
}
}
// while has_parent {
// self.enter_pos = -1;
// self.anchor_pos = -1;
//
// if let None = self.parent {
// has_parent = false;
// } else {
// // todo: check parent not null
// // self = self.parent.unwrap().borrow_mut();
// self.parent = None;
// }
// }
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册