From f3059ec8ea6e89a635c46109ecc52a5fe5698252 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Fri, 2 Aug 2024 21:38:12 +0200 Subject: [PATCH] Shift Mouse Press works now --- src/text_editor/commands_window.cpp | 5 ++++- src/text_editor/todo.txt | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/text_editor/commands_window.cpp b/src/text_editor/commands_window.cpp index f089917..f8e6e58 100644 --- a/src/text_editor/commands_window.cpp +++ b/src/text_editor/commands_window.cpp @@ -567,7 +567,10 @@ void WindowCommand(Event event, Window *window, View *view) { XY xy = {(Int)(pos.x), (Int)(pos.y)}; Int p = XYToPosWithoutNL(*buffer, xy); - if (mouse_in_document && Mouse(LEFT) && event.mouse_double_click) { + if (mouse_in_document && Mouse(LEFT) && event.shift) { + Caret *c = &view->carets[0]; + *c = ChangeFront(*c, p); + } else if (mouse_in_document && Mouse(LEFT) && event.mouse_double_click) { Caret *c = &view->carets[0]; if (InBounds({c->range.min - 1, c->range.max + 1}, p)) { c->range = EncloseWord(*buffer, p); diff --git a/src/text_editor/todo.txt b/src/text_editor/todo.txt index 1464ebf..68d133d 100644 --- a/src/text_editor/todo.txt +++ b/src/text_editor/todo.txt @@ -9,7 +9,6 @@ - I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection) - commands: - - indent selected lines - trim whitespace - Ctrl + G should select the line number in bar - How to make search into bar?