Commit b79b2577 authored by Sag0Sag0's avatar Sag0Sag0

May this be the last commit

parent f3c1b862
......@@ -15,10 +15,6 @@ exclude = [
[lib]
name = "liner"
[[bin]]
name = "liner_test"
path = "src/examples/main.rs"
[dependencies]
bytecount = "0.3.1"
termion = "1.4.0"
......
......@@ -811,7 +811,7 @@ mod tests {
fn delete_all_after_cursor_undo() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("delete all of this").unwrap();
ed.move_cursor_to_start_of_line().unwrap();
ed.delete_all_after_cursor().unwrap();
......@@ -824,7 +824,7 @@ mod tests {
let mut context = Context::new();
let closure = |s: &str| {String::from(s)};
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("let").unwrap();
assert_eq!(ed.cursor, 3);
......@@ -840,7 +840,7 @@ mod tests {
fn cursor_movement() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("right").unwrap();
assert_eq!(ed.cursor, 5);
......@@ -853,7 +853,7 @@ mod tests {
fn delete_until_backwards() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("right").unwrap();
assert_eq!(ed.cursor, 5);
......@@ -866,7 +866,7 @@ mod tests {
fn delete_until_forwards() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("right").unwrap();
ed.cursor = 0;
......@@ -879,7 +879,7 @@ mod tests {
fn delete_until() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("right").unwrap();
ed.cursor = 4;
......@@ -892,7 +892,7 @@ mod tests {
fn delete_until_inclusive() {
let mut context = Context::new();
let out = Vec::new();
let mut ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let mut ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
ed.insert_str_after_cursor("right").unwrap();
ed.cursor = 4;
......
......@@ -211,7 +211,7 @@ mod tests {
fn enter_is_done() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Emacs::new(ed);
map.ed.insert_str_after_cursor("done").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -226,7 +226,7 @@ mod tests {
fn move_cursor_left() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Emacs::new(ed);
map.editor_mut().insert_str_after_cursor("let").unwrap();
assert_eq!(map.ed.cursor(), 3);
......@@ -241,7 +241,7 @@ mod tests {
fn move_word() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Emacs::new(ed);
map.editor_mut().insert_str_after_cursor("abc def ghi").unwrap();
assert_eq!(map.ed.cursor(), 11);
......@@ -261,7 +261,7 @@ mod tests {
fn cursor_movement() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Emacs::new(ed);
map.ed.insert_str_after_cursor("right").unwrap();
assert_eq!(map.ed.cursor(), 5);
......@@ -276,7 +276,7 @@ mod tests {
fn ctrl_h() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Emacs::new(ed);
map.ed.insert_str_after_cursor("not empty").unwrap();
......
......@@ -99,7 +99,7 @@ mod tests {
fn ctrl_d_empty() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = TestKeyMap::new(ed);
let res = map.handle_key(Ctrl('d'), &mut |_| {});
......@@ -112,7 +112,7 @@ mod tests {
fn ctrl_d_non_empty() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = TestKeyMap::new(ed);
map.ed.insert_str_after_cursor("not empty").unwrap();
......@@ -125,7 +125,7 @@ mod tests {
fn ctrl_c() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = TestKeyMap::new(ed);
let res = map.handle_key(Ctrl('c'), &mut |_| {});
......
......@@ -1062,7 +1062,7 @@ mod tests {
fn enter_is_done() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("done").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1079,7 +1079,7 @@ mod tests {
fn move_cursor_left() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.editor_mut().insert_str_after_cursor("let").unwrap();
assert_eq!(map.ed.cursor(), 3);
......@@ -1097,7 +1097,7 @@ mod tests {
fn cursor_movement() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("right").unwrap();
assert_eq!(map.ed.cursor(), 5);
......@@ -1115,7 +1115,7 @@ mod tests {
fn vi_initial_insert() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1135,7 +1135,7 @@ mod tests {
fn vi_left_right_movement() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1162,7 +1162,7 @@ mod tests {
fn vi_no_eol() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1183,7 +1183,7 @@ mod tests {
fn vi_switch_from_insert() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1210,7 +1210,7 @@ mod tests {
context.history.push("history".into()).unwrap();
context.history.push("history".into()).unwrap();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1229,7 +1229,7 @@ mod tests {
context.history.push("history".into()).unwrap();
context.history.push("history".into()).unwrap();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1247,7 +1247,7 @@ mod tests {
fn vi_substitute_command() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1266,7 +1266,7 @@ mod tests {
fn substitute_with_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data").unwrap();
assert_eq!(map.ed.cursor(), 4);
......@@ -1286,7 +1286,7 @@ mod tests {
fn substitute_with_count_repeat() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("data data").unwrap();
......@@ -1311,7 +1311,7 @@ mod tests {
fn vi_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1344,7 +1344,7 @@ mod tests {
fn vi_count_overflow() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
// make sure large counts don't overflow our u32
......@@ -1372,7 +1372,7 @@ mod tests {
fn vi_count_overflow_zero() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
// make sure large counts don't overflow our u32
......@@ -1399,7 +1399,7 @@ mod tests {
fn vi_count_cancel() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1417,7 +1417,7 @@ mod tests {
fn vi_count_simple() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1439,7 +1439,7 @@ mod tests {
fn vi_dot_command() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1457,7 +1457,7 @@ mod tests {
fn vi_dot_command_repeat() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1475,7 +1475,7 @@ mod tests {
fn vi_dot_command_repeat_multiple() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1494,7 +1494,7 @@ mod tests {
fn vi_dot_command_append() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1514,7 +1514,7 @@ mod tests {
fn vi_dot_command_append_repeat() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1534,7 +1534,7 @@ mod tests {
fn vi_dot_command_movement() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1559,7 +1559,7 @@ mod tests {
fn move_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
assert_eq!(map.move_count(), 1);
......@@ -1574,7 +1574,7 @@ mod tests {
fn vi_count_movement_reset() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
simulate_keys!(map, [
......@@ -1596,7 +1596,7 @@ mod tests {
fn movement_with_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("right").unwrap();
assert_eq!(map.ed.cursor(), 5);
......@@ -1615,7 +1615,7 @@ mod tests {
fn movement_with_count_then_insert() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("right").unwrap();
assert_eq!(map.ed.cursor(), 5);
......@@ -1636,7 +1636,7 @@ mod tests {
fn count_at_buffer_edge() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1657,7 +1657,7 @@ mod tests {
fn basic_replace() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1675,7 +1675,7 @@ mod tests {
fn replace_with_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1697,7 +1697,7 @@ mod tests {
fn replace_with_count_eol() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1718,7 +1718,7 @@ mod tests {
fn replace_then_normal() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1738,7 +1738,7 @@ mod tests {
fn dot_replace() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1761,7 +1761,7 @@ mod tests {
fn dot_replace_count() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1786,7 +1786,7 @@ mod tests {
fn dot_replace_eol() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("test").unwrap();
......@@ -1807,7 +1807,7 @@ mod tests {
fn dot_replace_eol_multiple() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("this is a test").unwrap();
......@@ -1831,7 +1831,7 @@ mod tests {
fn move_count_right() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1852,7 +1852,7 @@ mod tests {
fn move_count_left() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1873,7 +1873,7 @@ mod tests {
fn dot_x_delete() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("replace").unwrap();
assert_eq!(map.ed.cursor(), 7);
......@@ -1893,7 +1893,7 @@ mod tests {
fn delete_line() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -1911,7 +1911,7 @@ mod tests {
fn delete_line_normal() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -1934,7 +1934,7 @@ mod tests {
fn delete_abort() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("don't delete").unwrap();
......@@ -1956,7 +1956,7 @@ mod tests {
fn delete_char_left() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -1974,7 +1974,7 @@ mod tests {
fn delete_chars_left() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -1993,7 +1993,7 @@ mod tests {
fn delete_char_right() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -2012,7 +2012,7 @@ mod tests {
fn delete_chars_right() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -2032,7 +2032,7 @@ mod tests {
fn delete_and_repeat() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -2052,7 +2052,7 @@ mod tests {
fn delete_until_end() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -2071,7 +2071,7 @@ mod tests {
fn delete_until_end_shift_d() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();
let mut map = Vi::new(ed);
map.ed.insert_str_after_cursor("delete").unwrap();
......@@ -2089,7 +2089,7 @@ mod tests {
fn delete_until_start() {
let mut context = Context::new();
let out = Vec::new();
let ed = Editor::new(out, "prompt".to_owned(), Some(Box::new(|s| String::from(s))), &mut context).unwrap();
let ed = Editor::new(out, "prompt".to_owned(), None, &mut context).unwrap();