Recent

Author Topic: [SOLVED] SynEdit moving caret to end  (Read 981 times)

AsleyCruz

  • Full Member
  • ***
  • Posts: 118
    • Graphic and web designer
[SOLVED] SynEdit moving caret to end
« on: June 30, 2023, 07:00:10 am »
Hi coders

I would like to avoid moving the caret on the click position. I want to the caret to move to the end of the text line
but I don't know any option to do this. Is there a way? Please, thanks for your help.

Take a look at the attached gif:
1.gif = this is what I want
2.gif = this is what I got
« Last Edit: June 30, 2023, 06:32:46 pm by AsleyCruz »
Graphic & web designer

paweld

  • Hero Member
  • *****
  • Posts: 1577
Re: SynEdit moving caret to end
« Reply #1 on: June 30, 2023, 08:08:03 am »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.SynEdit1Click(Sender: TObject);
  2. begin
  3.   SynEdit1.CaretX := Length(SynEdit1.LineText) + 1;
  4. end;
Best regards / Pozdrawiam
paweld

Warfley

  • Hero Member
  • *****
  • Posts: 2040
Re: SynEdit moving caret to end
« Reply #2 on: June 30, 2023, 09:46:26 am »
Just uncheck the "ScrollPastEOL" Option in the Options Property of your SynEdit

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12205
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit moving caret to end
« Reply #3 on: June 30, 2023, 11:54:32 am »
For the IDE: Tools > Options > Editor > General
In the Object Inspector: SynEdit.Options.

And you also may want to look at eoKeepCaretX
When moving up down by keyboard, the X pos will be remembered when going through shorter line, and restored when in a longer line again

 

TinyPortal © 2005-2018