summaryrefslogtreecommitdiff
path: root/redo/table_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'redo/table_windows.c')
-rw-r--r--redo/table_windows.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/redo/table_windows.c b/redo/table_windows.c
index a34e47a..6f0faae 100644
--- a/redo/table_windows.c
+++ b/redo/table_windows.c
@@ -145,6 +145,8 @@ void tableSelectItem(HWND hwnd, intptr_t index)
if (SendMessageW(hwnd, LVM_SETITEMSTATE, (WPARAM) current, (LPARAM) (&item)) == FALSE)
xpanic("error deselecting current Table item", GetLastError());
}
+ if (index == -1) // select nothing
+ return;
ZeroMemory(&item, sizeof (LVITEMW));
item.mask = LVIF_STATE;
item.state = LVIS_FOCUSED | LVIS_SELECTED;