From 6c5b26af80f515126793eb31543a6f3d6a610eef Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Thu, 18 Feb 2016 18:45:20 +0200
Subject: [PATCH] fixup! WEdit: use the new mouse API.
---
src/editor/editwidget.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
index 1ce8ed5..37471d6 100644
a
|
b
|
edit_total_update (WEdit * edit) |
758 | 758 | /* --------------------------------------------------------------------------------------------- */ |
759 | 759 | |
760 | 760 | static gboolean |
761 | | edit_update_cursor (WEdit * edit, mouse_event_t * event) |
| 761 | edit_update_cursor (WEdit * edit, const mouse_event_t * event) |
762 | 762 | { |
| 763 | int x, y; |
763 | 764 | gboolean done; |
764 | 765 | |
| 766 | x = event->x - (edit->fullscreen ? 0 : 1); |
| 767 | y = event->y - (edit->fullscreen ? 0 : 1); |
| 768 | |
765 | 769 | if (edit->mark2 != -1 && event->msg == MSG_MOUSE_UP) |
766 | 770 | return TRUE; /* don't do anything */ |
767 | 771 | |
768 | 772 | if (event->msg == MSG_MOUSE_DOWN || event->msg == MSG_MOUSE_UP) |
769 | 773 | edit_push_key_press (edit); |
770 | 774 | |
771 | | if (!edit->fullscreen) |
772 | | event->x--; |
773 | 775 | if (!option_cursor_beyond_eol) |
774 | | edit->prev_col = event->x - edit->start_col - option_line_state_width; |
| 776 | edit->prev_col = x - edit->start_col - option_line_state_width; |
775 | 777 | else |
776 | 778 | { |
777 | 779 | long line_len; |
… |
… |
edit_update_cursor (WEdit * edit, mouse_event_t * event) |
780 | 782 | edit_move_forward3 (edit, edit_buffer_get_current_bol (&edit->buffer), 0, |
781 | 783 | edit_buffer_get_current_eol (&edit->buffer)); |
782 | 784 | |
783 | | if (event->x + 1 > line_len) |
| 785 | if (x + 1 > line_len) |
784 | 786 | { |
785 | | edit->over_col = event->x - line_len - edit->start_col - option_line_state_width; |
| 787 | edit->over_col = x - line_len - edit->start_col - option_line_state_width; |
786 | 788 | edit->prev_col = line_len; |
787 | 789 | } |
788 | 790 | else |
789 | 791 | { |
790 | 792 | edit->over_col = 0; |
791 | | edit->prev_col = event->x - option_line_state_width - edit->start_col; |
| 793 | edit->prev_col = x - option_line_state_width - edit->start_col; |
792 | 794 | } |
793 | 795 | } |
794 | 796 | |
795 | | if (!edit->fullscreen) |
796 | | event->y--; |
797 | | if (event->y > edit->curs_row) |
798 | | edit_move_down (edit, event->y - edit->curs_row, 0); |
799 | | else if (event->y < edit->curs_row) |
800 | | edit_move_up (edit, edit->curs_row - event->y, 0); |
| 797 | if (y > edit->curs_row) |
| 798 | edit_move_down (edit, y - edit->curs_row, 0); |
| 799 | else if (y < edit->curs_row) |
| 800 | edit_move_up (edit, edit->curs_row - y, 0); |
801 | 801 | else |
802 | 802 | edit_move_to_prev_col (edit, edit_buffer_get_current_bol (&edit->buffer)); |
803 | 803 | |