Skip to content

Commit

Permalink
A more correct fix to commit: db09c57
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Apr 8, 2024
1 parent d2ade46 commit c96ed55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LiteEditor/cl_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5345,7 +5345,7 @@ void clEditor::ShowCalltip(clCallTipPtr tip)
// In an ideal world, we would like our tooltip to be placed
// on top of the caret.
wxPoint pt = PointFromPosition(GetCurrentPosition());
GetFunctionTip()->Activate(pt, GetCurrLineHeight(), StyleGetBackground(wxSTC_C_DEFAULT));
GetFunctionTip()->Activate(pt, GetCurrLineHeight(), StyleGetBackground(wxSTC_C_DEFAULT), GetLexerId());
}

int clEditor::PositionAfterPos(int pos) { return wxStyledTextCtrl::PositionAfter(pos); }
Expand Down
6 changes: 3 additions & 3 deletions Plugin/cl_editor_tip_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "ColoursAndFontsManager.h"
#include "drawingutils.h"
#include "editor_config.h"
#include "event_notifier.h"
#include "globals.h"
#include "ieditor.h"
Expand Down Expand Up @@ -56,7 +55,7 @@ bool ShouldSkipFirstArgument(wxString arg, int lexerId)
{
if (lexerId == wxSTC_LEX_RUST || lexerId == wxSTC_LEX_PYTHON) {
arg.Trim().Trim(false);
return arg == "self" || arg == "&self" || arg == "&mut self" || arg == "&self";
return arg == "self" || arg == "&self" || arg == "&mut self" || arg == "mut self";
} else {
return false;
}
Expand Down Expand Up @@ -308,14 +307,15 @@ wxString clEditorTipWindow::GetText()
return wxT("");
}

void clEditorTipWindow::Activate(wxPoint pt, int lineHeight, wxColour parentBgColour)
void clEditorTipWindow::Activate(wxPoint pt, int lineHeight, wxColour parentBgColour, int lexerId)
{
if (m_tips.empty())
return;

m_point = pt;
m_lineHeight = lineHeight;
m_parentBgColour = parentBgColour;
m_lexerId = lexerId;

// update the font to the current editor
m_font = ColoursAndFontsManager::Get().GetFixedFont(true);
Expand Down
2 changes: 1 addition & 1 deletion Plugin/cl_editor_tip_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class WXDLLIMPEXP_SDK clEditorTipWindow : public wxPanel
bool IsEmpty();
void Clear();
bool IsActive();
void Activate(wxPoint pt, int lineHeight, wxColour parentBgColour);
void Activate(wxPoint pt, int lineHeight, wxColour parentBgColour, int lexerId);
void Deactivate();
void SelectNext(int argIdxToHilight);
void SelectPrev(int argIdxToHilight);
Expand Down

0 comments on commit c96ed55

Please sign in to comment.