Commit dee51171 authored by Ticki's avatar Ticki

Fix bug

parent aab98fda
......@@ -36,5 +36,7 @@ The bug causing these two bugs, is localised to be in position.rs. It resolves b
Solutions:
- Make a struct KeyState storing info on the modifiers active. Add a method `feed` which feeds the keystate with a key, updating it. This should Option<Key>, where a key should be returned iff the key entered was not a modifier
- [ ] Crashes when ~ command is used on an empty line
Refactoring:
- Organize into modules
......@@ -2,9 +2,12 @@ use super::*;
impl Editor {
pub fn invert_chars(&mut self, n: usize) {
let (x, y) = self.pos();
for _ in 0..n {
self.text[y][x] = invert::invert(self.current());
let (x, y) = self.pos();
let cur = self.current();
if let Some(c) = self.text[y].get_mut(x) {
*c = invert::invert(cur);
}
if let Some(m) = self.next(1) {
self.goto(m);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment