@@ -446,8 +446,6 @@ fn extend_next_word_end(cx: &mut Context) {
447fn find_char_impl<F>(cx: &mut Context, search_fn: F, inclusive: bool, extend: bool)
447fn find_char_impl<F>(cx: &mut Context, search_fn: F, inclusive: bool, extend: bool)
449− // TODO: make an options struct for and abstract this Fn into a searcher type
450− // use the definition for w/b/e too
451 F: Fn(RopeSlice, char, usize, usize, bool) -> Option<usize> + 'static,
449 F: Fn(RopeSlice, char, usize, usize, bool) -> Option<usize> + 'static,
453 // TODO: count is reset to 1 before next key so we move it into the closure here.
451 // TODO: count is reset to 1 before next key so we move it into the closure here.
@@ -652,10 +650,6 @@ fn scroll(cx: &mut Context, offset: usize, direction: Direction) {
653 let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
651 let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
655− // cursor visual offset
656− // TODO: only if dragging via mouse?
657− // let cursor_off = cursor.row - view.first_line;
659 view.first_line = match direction {
653 view.first_line = match direction {
660 Forward => view.first_line + offset,
654 Forward => view.first_line + offset,
661 Backward => view.first_line.saturating_sub(offset),
655 Backward => view.first_line.saturating_sub(offset),
@@ -812,13 +806,6 @@ fn split_selection_on_newline(cx: &mut Context) {
812 doc.set_selection(view.id, selection);
806 doc.set_selection(view.id, selection);
815−// search: searches for the first occurence in file, provides a prompt
816−// search_next: reuses the last search regex and searches for the next match. The next match becomes the main selection.
817−// -> we always search from after the cursor.head
818−// TODO: be able to use selection as search query (*/alt *)
819−// I'd probably collect all the matches right now and store the current index. The cache needs
820−// wiping if input happens.
822fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Regex, extend: bool) {
809fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Regex, extend: bool) {
823 let text = doc.text();
810 let text = doc.text();
824 let selection = doc.selection(view.id);
811 let selection = doc.selection(view.id);
@@ -847,7 +834,6 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
847 Selection::single(start, head)
834 Selection::single(start, head)
850− // TODO: (first_match, regex) stuff in register?
851 doc.set_selection(view.id, selection);
837 doc.set_selection(view.id, selection);
852 align_view(doc, view, Align::Center);
838 align_view(doc, view, Align::Center);
@@ -905,12 +891,6 @@ fn search_selection(cx: &mut Context) {
905 search_next(cx);
891 search_next(cx);
908−// TODO: N -> search_prev
909−// need to loop around buffer also and show a message
910−// same for no matches
914fn extend_line(cx: &mut Context) {
894fn extend_line(cx: &mut Context) {
915 let count = cx.count();
895 let count = cx.count();
916 let (view, doc) = current!(cx.editor);
896 let (view, doc) = current!(cx.editor);
@@ -931,8 +911,6 @@ fn extend_line(cx: &mut Context) {
931 doc.set_selection(view.id, Selection::single(start, end));
911 doc.set_selection(view.id, Selection::single(start, end));
934−// heuristic: append changes to history after each command, unless we're in insert mode
936fn delete_selection_impl(reg: &mut Register, doc: &mut Document, view_id: ViewId) {
914fn delete_selection_impl(reg: &mut Register, doc: &mut Document, view_id: ViewId) {
937 // first yank the selection
915 // first yank the selection
938 let values: Vec<String> = doc
916 let values: Vec<String> = doc
@@ -1568,9 +1546,6 @@ mod cmd {
1570fn command_mode(cx: &mut Context) {
1548fn command_mode(cx: &mut Context) {
1571− // TODO: completion items should have a info section that would get displayed in
1572− // a popup above the prompt when items are tabbed over
1574 let mut prompt = Prompt::new(
1549 let mut prompt = Prompt::new(
1575 ":".to_owned(),
1550 ":".to_owned(),
1576 |input: &str| {
1551 |input: &str| {
@@ -2522,7 +2497,6 @@ fn redo(cx: &mut Context) {
2522// Yank / Paste
2497// Yank / Paste
2524fn yank(cx: &mut Context) {
2499fn yank(cx: &mut Context) {
2525− // TODO: should selections be made end inclusive?
2526 let (view, doc) = current!(cx.editor);
2500 let (view, doc) = current!(cx.editor);
2527 let values: Vec<String> = doc
2501 let values: Vec<String> = doc
2528 .selection(view.id)
2502 .selection(view.id)
@@ -2703,16 +2677,6 @@ fn replace_selections_with_clipboard(cx: &mut Context) {
2703 replace_selections_with_clipboard_impl(&mut cx.editor);
2677 replace_selections_with_clipboard_impl(&mut cx.editor);
2706−// alt-p => paste every yanked selection after selected text
2707−// alt-P => paste every yanked selection before selected text
2708−// R => replace selected text with yanked text
2709−// alt-R => replace selected text with every yanked text
2711−// append => insert at next line
2712−// insert => insert at start of line
2713−// replace => replace
2716fn paste_after(cx: &mut Context) {
2680fn paste_after(cx: &mut Context) {
2717 let reg_name = cx.selected_register.name();
2681 let reg_name = cx.selected_register.name();
2718 let (view, doc) = current!(cx.editor);
2682 let (view, doc) = current!(cx.editor);
@@ -3019,12 +2983,6 @@ fn completion(cx: &mut Context) {
3022− // TODO: Server error: content modified
3024− // // TODO!: when iterating over items, show the docs in popup
3026− // // language server client needs to be accessible via a registry of some sort
3030fn hover(cx: &mut Context) {
2988fn hover(cx: &mut Context) {