Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.55k stars 174 forks source link

Handle dbclick in console output #5504

Closed pintassilgo closed 7 months ago

pintassilgo commented 7 months ago

The universal behavior on dbclicking a text is to select the word under mouse. It doesn't work in console output, only triple click to select the entire line.

Alexey-T commented 7 months ago

https://wiki.freepascal.org/CudaText#Console_panel

It's busy: Double-click on memo lines starting with ">>>" repeats entered command (after ">>>" symbols).

pintassilgo commented 7 months ago

Maybe at least on not ">>>" lines? If not intended to change the repeat command to other combination (like right click, middle click or single click).

Alexey-T commented 7 months ago

procedure TfmConsole.MemoOnClickDbl(Sender: TObject; var AHandled: boolean);
var
  s: string;
  n: integer;
begin
  n:= EdMemo.Carets[0].PosY;
  if EdMemo.Strings.IsIndexValid(n) then
  begin
    s:= EdMemo.Strings.Lines[n];
    if StartsStr(cConsolePrompt, s) then
    begin
      Delete(s, 1, Length(cConsolePrompt));
      DoRunLine(s);
    end
    else
      DoNavigate(Self);
  end;
  AHandled:= true;
end;  

so, if not on >>> line, it runs 'navigate to error' command. it may run it on ANY line.