summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-16 15:38:59 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-16 15:38:59 -0500
commit4b8db533619ee8eef64ded0793f413faaa7609c2 (patch)
tree8b3f158897ae2ff2f3e8f78ad0712bc4b40b328f /main.c
parent824c4ff4be5a0bf55b6644fed06fcfe2248c4301 (diff)
detecting errors in build output
Diffstat (limited to 'main.c')
-rw-r--r--main.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/main.c b/main.c
index f2f5ec7..09009f5 100644
--- a/main.c
+++ b/main.c
@@ -412,9 +412,6 @@ int main(int argc, char **argv) {
Sint32 dx = event.wheel.x, dy = -event.wheel.y;
ted->scroll_total_x += dx;
ted->scroll_total_y += dy;
- double scroll_speed = 2.5;
- if (ted->active_buffer)
- buffer_scroll(ted->active_buffer, dx * scroll_speed, dy * scroll_speed);
} break;
case SDL_MOUSEBUTTONDOWN: {
Uint32 button = event.button.button;
@@ -435,33 +432,11 @@ int main(int argc, char **argv) {
add = false;
}
}
- if (add)
- ted->mouse_clicks[button][ted->nmouse_clicks[button]++] = pos;
- }
- switch (button) {
- case SDL_BUTTON_LEFT: {
- if (buffer) {
- BufferPos pos = {0};
- if (buffer_pixels_to_pos(buffer, V2(x, y), &pos)) {
- if (key_modifier == KEY_MODIFIER_SHIFT) {
- buffer_select_to_pos(buffer, pos);
- } else if (key_modifier == 0) {
- buffer_cursor_move_to_pos(buffer, pos);
- switch ((event.button.clicks - 1) % 3) {
- case 0: break; // single-click
- case 1: // double-click: select word
- buffer_select_word(buffer);
- break;
- case 2: // triple-click: select line
- buffer_select_line(buffer);
- break;
- }
- }
- ted->drag_buffer = buffer;
-
- }
+ if (add) {
+ ted->mouse_clicks[button][ted->nmouse_clicks[button]] = pos;
+ ted->mouse_click_times[button][ted->nmouse_clicks[button]] = event.button.clicks;
+ ++ted->nmouse_clicks[button];
}
- } break;
}
} break;
case SDL_MOUSEMOTION: {