Skip to content

Commit

Permalink
Merge pull request #313 from lonemadmax/tooltips
Browse files Browse the repository at this point in the history
Small editor tooltips tweaks
  • Loading branch information
Freaxed authored Feb 11, 2024
2 parents 8d5ece8 + 6a79593 commit 8a99dbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/helpers/tabview/TabManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ class TabManagerController : public TabContainerView::Controller {
return;
fCurrentToolTip = toolTipText;
fManager->GetTabContainerView()->HideToolTip();
fManager->GetTabContainerView()->SetToolTip(
reinterpret_cast<BToolTip*>(NULL));
fManager->GetTabContainerView()->SetToolTip(fCurrentToolTip.String());
}

Expand Down
4 changes: 2 additions & 2 deletions src/lsp-client/LSPEditorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ LSPEditorWrapper::DiagnosticFromPosition(Sci_Position sci_position, LSPDiagnosti
if (fEditor->SendMessage(SCI_INDICATORVALUEAT, IND_DIAG, sci_position) == 1) {
for (auto& ir : fLastDiagnostics) {
index++;
if (sci_position > ir.range.from && sci_position <= ir.range.to) {
if (sci_position >= ir.range.from && sci_position < ir.range.to) {
dia = ir;
return index;
}
}
}
return index;
return -1;
}


Expand Down
5 changes: 4 additions & 1 deletion src/ui/EditorTabManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ EditorTabManager::GetToolTipText(int32 index)
BString label("");
Editor* editor = EditorAt(index);
if (editor) {
label << editor->Name();
label << editor->FilePath();
ProjectFolder* project = editor->GetProjectFolder();
if (project) {
if (label.StartsWith(project->Path()))
label.Remove(0, project->Path().Length() + 1);
// Length + 1 to also remove the path separator
label << "\n" << B_TRANSLATE("Project") << ": " << project->Name();
if (project->Active())
label << " (" << B_TRANSLATE("Active") << ")";
Expand Down

0 comments on commit 8a99dbc

Please sign in to comment.