Skip to content

Commit

Permalink
Fixed: margin hover tips + clicks are not working
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Jul 16, 2024
1 parent e31f52a commit 4f78929
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LiteEditor/cl_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ constexpr int NUMBER_MARGIN_ID = 1;
constexpr int EDIT_TRACKER_MARGIN_ID = 2;
constexpr int SYMBOLS_MARGIN_ID = 3;
constexpr int SYMBOLS_MARGIN_SEP_ID = 4;
constexpr int LAST_MARGIN_ID = 4;

/// A helper class that sets the cursor of the current control to
/// left pointing arrow and restores it once its destroyed
Expand Down Expand Up @@ -840,6 +841,7 @@ void clEditor::SetProperties()
//---------------------------------------------------
// Fold settings
//---------------------------------------------------
SetMarginCursor(FOLD_MARGIN_ID, 8);
StyleSetBackground(wxSTC_STYLE_FOLDDISPLAYTEXT, StyleGetBackground(wxSTC_STYLE_DEFAULT));
StyleSetForeground(wxSTC_STYLE_FOLDDISPLAYTEXT, DrawingUtils::IsDark(bg_colour) ? "GOLD" : "ORANGE");

Expand Down Expand Up @@ -1958,7 +1960,7 @@ void clEditor::OnDwellStart(wxStyledTextEvent& event)
// Always cancel the previous tooltip...
DoCancelCodeCompletionBox();

for (int n = 0; n < FOLD_MARGIN_ID; ++n) {
for (int n = 0; n < LAST_MARGIN_ID; ++n) {
margin += GetMarginWidth(n);
}

Expand Down Expand Up @@ -3501,10 +3503,11 @@ void clEditor::OnContextMenu(wxContextMenuEvent& event)

// If the right-click is in the margin, provide a different context menu: bookmarks/breakpts
int margin = 0;
for (int n = 0; n < FOLD_MARGIN_ID;
for (int n = 0; n < LAST_MARGIN_ID;
++n) { // Assume a click anywhere to the left of the fold margin is for markers
margin += GetMarginWidth(n);
}

if (clientPt.x < margin) {
GotoPos(PositionFromPoint(clientPt));
DoBreakptContextMenu(clientPt);
Expand Down

0 comments on commit 4f78929

Please sign in to comment.