Skip to content

Commit

Permalink
fixing #5644
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Aug 9, 2024
1 parent 165a577 commit 0761dc1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
27 changes: 15 additions & 12 deletions app/formmain.lfm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
object fmMain: TfmMain
Left = 44
Height = 518
Height = 476
Top = 87
Width = 1236
AllowDropFiles = True
Caption = 'CudaText'
ClientHeight = 518
ClientHeight = 476
ClientWidth = 1236
Constraints.MinHeight = 200
Constraints.MinWidth = 300
Expand All @@ -28,7 +28,7 @@ object fmMain: TfmMain
OnWindowStateChange = FormWindowStateChange
object PanelSide: TATPanelSimple
Left = 0
Height = 518
Height = 476
Top = 0
Width = 75
Align = alLeft
Expand All @@ -39,7 +39,7 @@ object fmMain: TfmMain
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 30
Top = 488
Top = 446
Width = 75
Anchors = [akLeft, akBottom]
AutoSize = True
Expand All @@ -53,7 +53,7 @@ object fmMain: TfmMain
AnchorSideTop.Control = PanelSide
AnchorSideBottom.Control = ToolbarSideMid
Left = 0
Height = 458
Height = 416
Top = 0
Width = 75
Anchors = [akTop, akLeft, akBottom]
Expand All @@ -72,7 +72,7 @@ object fmMain: TfmMain
AnchorSideBottom.Control = ToolbarSideLow
Left = 0
Height = 30
Top = 458
Top = 416
Width = 75
Anchors = [akLeft, akBottom]
AutoSize = True
Expand All @@ -84,7 +84,7 @@ object fmMain: TfmMain
end
object PanelAll: TATPanelSimple
Left = 75
Height = 518
Height = 476
Top = 0
Width = 1161
Align = alClient
Expand All @@ -102,13 +102,13 @@ object fmMain: TfmMain
end
object PanelMain: TATPanelSimple
Left = 0
Height = 494
Height = 452
Top = 24
Width = 1161
Align = alClient
object PanelEditors: TATPanelSimple
Left = 0
Height = 494
Height = 452
Top = 0
Width = 1161
Align = alClient
Expand Down Expand Up @@ -726,6 +726,12 @@ object fmMain: TfmMain
OnPopup = PopupTextPopup
Left = 560
Top = 96
object mnuTextOpenUrl: TMenuItem
Caption = 'Open URL'
end
object mnuTextSepURL: TMenuItem
Caption = '-'
end
object mnuTextUndo: TMenuItem
Caption = 'Undo'
end
Expand Down Expand Up @@ -756,9 +762,6 @@ object fmMain: TfmMain
object mnuTextGotoDef: TMenuItem
Caption = 'Go to definition'
end
object mnuTextOpenUrl: TMenuItem
Caption = 'Open URL'
end
end
object TimerTooltip: TTimer
Enabled = False
Expand Down
9 changes: 7 additions & 2 deletions app/formmain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ TfmMain = class(TForm)
mnuTextSep2: TMenuItem;
mnuTextSel: TMenuItem;
mnuTextGotoDef: TMenuItem;
mnuTextSepUrl: TMenuItem;
TimerMouseStop: TTimer;
TimerStatusWork: TTimer;
TimerAppIdle: TIdleTimer;
Expand Down Expand Up @@ -8186,7 +8187,7 @@ procedure TfmMain.PopupTextPopup(Sender: TObject);
UpdateMenuItemHotkey(mnuTextDelete, cCommand_TextDeleteSelection);
UpdateMenuItemHotkey(mnuTextSel, cCommand_SelectAll);
UpdateMenuItemHotkey(mnuTextGotoDef, cmd_GotoDefinition);
UpdateMenuItemHotkey(mnuTextOpenUrl, cmd_LinkAtCaret_Open);
UpdateMenuItemHotkey(mnuTextOpenUrl, cmd_LinkAtPopup_Open);

Ed:= CurrentEditor;

Expand All @@ -8206,7 +8207,11 @@ procedure TfmMain.PopupTextPopup(Sender: TObject);
mnuTextRedo.Enabled:= not Ed.ModeReadOnly and (Ed.RedoCount>0);

if Assigned(mnuTextOpenUrl) then
mnuTextOpenUrl.Enabled:= EditorGetLinkAtCaret(Ed)<>'';
begin
mnuTextOpenUrl.Visible:= EditorGetLinkAtScreenCoord(Ed, PopupText.PopupPoint)<>'';
if Assigned(mnuTextSepUrl) then
mnuTextSepUrl.Visible:= mnuTextOpenUrl.Visible;
end;
end;


Expand Down

0 comments on commit 0761dc1

Please sign in to comment.