* disable autoindent when pasting text
* update getstr to select context when selection is null
+* center find results and jumped to line on screen
* Use select to check for error strings in exec.c
* Should not be able to undo initial tag line text insertion
* Disallow scrolling past end of buffer
# Internals and Miscellaneous
* Calculate line numbers and keep up to date while editing
-* Implement ctags lookup and regeneration
-* Implement cscope lookup and regeneration
# Auxillary Programs
void view_putstr(View* view, char* str);
void view_append(View* view, char* str);
char* view_getstr(View* view, Sel* sel);
+char* view_getctx(View* view);
void view_scroll(View* view, int move);
void view_scrollpage(View* view, int move);
void view_setln(View* view, size_t line);
if (file) {
view->selection.end = buf_load(&(view->buffer), file);
view->selection.beg = view->selection.end;
+ view->sync_needed = true;
}
}
return str;
}
+char* view_getctx(View* view) {
+ if (0 == num_selected(view->selection)) {
+ selcontext(view, &(view->selection));
+ view->selection.end++;
+ }
+ return view_getstr(view, NULL);
+}
+
void view_scroll(View* view, int move) {
int dir = (move < 0 ? -1 : 1);
move *= dir;
}
static void goto_ctag(void) {
- char* str = view_getstr(currview(), NULL);
+ char* str = view_getctx(currview());
if (str) {
PickTagCmd[2] = str;
char* pick = cmdread(PickTagCmd, NULL);