Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOME key, could put caret on first non-space position #38

Closed
GoogleCodeExporter opened this issue Aug 23, 2015 · 10 comments
Closed

HOME key, could put caret on first non-space position #38

GoogleCodeExporter opened this issue Aug 23, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

Example: notepad++
e.g.
  test;
if I am at the end of exemplary line I push home
and I am on beggining by now in keynote.
In notepad++ however I am just at first letter t position.
Then next hit of home moves caret to beggining of the line.
And yet another one again to letter t.

Sorry I produce so many key-enhancement requests, but I think
it is easy to work on all of them just together once to make it perfect.
These is small things which make life faster and easier :)

Original issue reported on code.google.com by szmas...@googlemail.com on 23 Jan 2009 at 5:54

@GoogleCodeExporter
Copy link
Author

Original comment by dpra...@gmail.com on 23 Jan 2009 at 7:00

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Implemented in revision r36

Original comment by dpra...@gmail.com on 24 Jan 2009 at 5:56

  • Changed state: Finished

@GoogleCodeExporter
Copy link
Author

Just one small remark since it is already implemented.
I do not know if version available on svn is now current, but..
I have just tested that, when I push home from any position of text works great.
But if I push home from position 0, it does not jump to first text position.
Could be nice to jump again to first text position, just like in notepad++.

Original comment by szmas...@googlemail.com on 26 Jan 2009 at 5:03

@GoogleCodeExporter
Copy link
Author

Solution:
col  := length(lines[line]);//SelStart - posFirstChar;

          if ((TRxRichEdit(sender).SelStart > (posFirstChar + indent)) or (TRxRichEdit(sender).SelStart = posFirstChar) ) then begin
             TRxRichEdit(sender).SelStart:= posFirstChar + indent;
             key:= 0;
          end

By the way, I noticed in delphi one can define function inside of another one,
that is well.. a bit confusing ;)

Original comment by szmas...@googlemail.com on 26 Jan 2009 at 6:33

@GoogleCodeExporter
Copy link
Author

Actually if a push Home from first 't' (of your example) goes to column 0 of 
that row.
If you see the code of r36 that is the behaviour, only if cursor further to the 
right
than indent then apply new code, if it is further to the left or in that 
posititon
then behaves like old Home.

Original comment by dpra...@gmail.com on 26 Jan 2009 at 6:38

@GoogleCodeExporter
Copy link
Author

Oh, now I understand the behavior you wanted. Being right at the beginning of 
the
line jump to the first "t"
Ok, no problem

Original comment by dpra...@gmail.com on 26 Jan 2009 at 7:39

@GoogleCodeExporter
Copy link
Author

Adjusted in revision r38

Original comment by dpra...@gmail.com on 26 Jan 2009 at 10:44

@GoogleCodeExporter
Copy link
Author

Original comment by dpra...@gmail.com on 27 Jan 2009 at 12:29

  • Added labels: Milestone-1.7.5

@GoogleCodeExporter
Copy link
Author

Original comment by dpra...@gmail.com on 1 Feb 2009 at 12:12

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

I do not like this behavior. Can I turn it off?

Original comment by ricky.he...@gmail.com on 30 Jul 2013 at 10:12

@dpradov dpradov modified the milestone: 1.7.5 Nov 6, 2015
dpradov added a commit that referenced this issue Jan 10, 2016
…n first non-space position)

When wrapping is enabled and we are at the final of one line SelStart could return the same value as if we were at the beginning of the next one (*). In that case, pressing HOME would move the cursor incorrectly to the first character of next line.

(*): That occurs when we go to that position pressing 'End'. If we move (left arrow) from the beginning of the next line, the cursor will be apparently in the same position, but in the first case it will be as if we were in the next line.

Signed-off-by: Daniel Prado Velasco <dpradov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants