* check for file changes on save
* check for file changes when window regains focus
-* Right click in tags region should search edit region
* 100% coverage with unit and unit-integration tests
* Add a SaveAs tag that takes an argument for the filename to save as
* Add a GoTo tag for ctags lookup and line number jump (or right click magic?)
* Add keyboard shortcut to highlight the thing under the cursor
* right click to fetch file or line
-* selecting text should set PRIMARY x11 selection
Straight-up Bugs:
void view_byword(View* view, int move, bool extsel);
void view_byline(View* view, int move, bool extsel);
char* view_fetchcmd(View* view, size_t row, size_t col);
-void view_find(View* view, int dir, size_t row, size_t col);
void view_findstr(View* view, int dir, char* str);
void view_insert(View* view, bool indent, Rune rune);
void view_delete(View* view, int dir, bool byword);
view_setcursor(view, row, col);
Sel sel = view->selection;
selcontext(view, &sel);
- if (sel.end+1 < buf_end(&(view->buffer)))
- sel.end++;
+ sel.end = buf_byrune(&(view->buffer), sel.end, RIGHT);
view->selection = sel;
}
return str;
}
-void view_find(View* view, int dir, size_t row, size_t col) {
- size_t off = getoffset(view, row, col);
- if (off != SIZE_MAX) {
- Sel sel = view->selection;
- if (!num_selected(sel) || !in_selection(sel, off)) {
- view_setcursor(view, row, col);
- sel = view->selection;
- selcontext(view, &sel);
- buf_find(&(view->buffer), dir, &sel.beg, &sel.end);
- sel.end++;
- } else {
- buf_find(&(view->buffer), dir, &sel.beg, &sel.end);
- }
- view->selection = sel;
- view->sync_needed = true;
- view->sync_center = true;
- }
-}
-
void view_findstr(View* view, int dir, char* str) {
Sel sel = view->selection;
buf_findstr(&(view->buffer), dir, str, &sel.beg, &sel.end);
} else {
SearchDir *= (x11_keymodsset(ModShift) ? -1 : +1);
free(SearchTerm);
- view_find(win_view(id), SearchDir, row, col);
SearchTerm = view_getstr(win_view(id), NULL);
- win_warpptr(id);
+ Sel before = win_view(EDIT)->selection;
+ view_findstr(win_view(EDIT), SearchDir, SearchTerm);
+ Sel after = win_view(EDIT)->selection;
+ if (memcmp(&before, &after, sizeof(Sel))) {
+ win_setregion(EDIT);
+ win_warpptr(EDIT);
+ }
}
}
return 0;
}
#endif
-