summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06478d7)
raw | patch | inline | side by side (parent: 06478d7)
author | Max Kellermann <max@duempel.org> | |
Sat, 10 Oct 2009 15:45:13 +0000 (17:45 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 10 Oct 2009 15:45:13 +0000 (17:45 +0200) |
Don't repeat the range selection code.
src/list_window.c | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index c3ecc72751e7fe65da4934b06f17eda7e433a4dd..d7da155fdb6e50788af3e52052b4ec9b7f93ffce 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
assert(label != NULL);
if (str && label && match_line(label, str)) {
- lw->selected = i;
- if(!lw->range_selection || i > lw->selected_end)
- lw->selected_end = i;
- if(!lw->range_selection || i < lw->selected_start)
- lw->selected_start = i;
+ list_window_move_cursor(lw, i);
return true;
}
if (wrap && i == lw->selected)
assert(label != NULL);
if( str && label && match_line(label, str) ) {
- lw->selected = i;
- if(!lw->range_selection || i > (int)lw->selected_end)
- lw->selected_end = i;
- if(!lw->range_selection || i < (int)lw->selected_start)
- lw->selected_start = i;
+ list_window_move_cursor(lw, i);
return true;
}
if (wrap && i == (int)lw->selected)
if (str && label && g_ascii_strncasecmp(label, str, strlen(str)) == 0)
#endif
{
- lw->selected = i;
- if(!lw->range_selection || i > lw->selected_end)
- lw->selected_end = i;
- if(!lw->range_selection || i < lw->selected_start)
- lw->selected_start = i;
+ list_window_move_cursor(lw, i);
return true;
}
}