Skip to content

Commit

Permalink
Merge pull request #159 from s4my/fix/UICodeMenu
Browse files Browse the repository at this point in the history
fix: making sure to not show the copy context menu on the left margin.
  • Loading branch information
nakst authored Oct 30, 2023
2 parents b587481 + 83954cd commit 2afa0d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion luigi2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3021,7 +3021,9 @@ int _UICodeMessage(UIElement *element, UIMessage message, int di, void *dp) {

return 1;
} else if (message == UI_MSG_RIGHT_DOWN) {
if (element->flags & UI_CODE_SELECTABLE) {
int hitTest = UICodeHitTest(code, element->window->cursorX, element->window->cursorY);

if (hitTest > 0 && (element->flags & UI_CODE_SELECTABLE)) {
UIElementFocus(element);
UIMenu *menu = UIMenuCreate(&element->window->e, UI_MENU_NO_SCROLL);
UIMenuAddItem(menu, (code->selection[0].line == code->selection[1].line
Expand Down

0 comments on commit 2afa0d4

Please sign in to comment.