summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-28 14:01:10 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-28 14:01:10 -0500
commit5662c988fa199d071fdfd9e9defd8e09a3486b0c (patch)
tree95cd9999fcd5e9a300093a6c11c9d6905e3a45a9 /main.c
parent7089b92ff5606f1e9b934e2236b0295dcab922ae (diff)
tab moving working?
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.c b/main.c
index 863c574..1d4e528 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,4 @@
// @TODO:
-// - move tabs between nodes
// - :split-swap
// - fix: ctrl+f something, then switch to another tab (hl rects still showing up)
@@ -391,6 +390,7 @@ int main(int argc, char **argv) {
bool alt_down = keyboard_state[SDL_SCANCODE_LALT] || keyboard_state[SDL_SCANCODE_RALT];
memset(ted->nmouse_clicks, 0, sizeof ted->nmouse_clicks);
+ memset(ted->nmouse_releases, 0, sizeof ted->nmouse_releases);
ted->scroll_total_x = ted->scroll_total_y = 0;
ted_update_window_dimensions(ted);
@@ -494,6 +494,13 @@ int main(int argc, char **argv) {
}
}
} break;
+ case SDL_MOUSEBUTTONUP: {
+ Uint8 button = event.button.button;
+ v2 pos = V2((float)event.button.x, (float)event.button.y);
+ if (ted->nmouse_releases[button] < arr_count(ted->mouse_releases[button])) {
+ ted->mouse_releases[button][ted->nmouse_releases[button]++] = pos;
+ }
+ } break;
case SDL_MOUSEMOTION: {
float x = (float)event.motion.x, y = (float)event.motion.y;
if (ted->drag_buffer != ted->active_buffer)