FIXED: minor bug in cursor movement

Report issues, odd behaviors or submit a detailed bug report.
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

FIXED: minor bug in cursor movement

Post by DerellLicht1 »

Okay, this may seem like a trivial issue, but it has been bugging me for all the time that I've used RJTE, so I would at least wish to discuss it with our author and everyone else...

So consider this line of C++ code:

Code: Select all

   for (idx=0; data_flags[idx].flag != 0; idx++) {
Visualize the cursor sitting just after the 'g' in flag... I wish to move the cursor to the beginning of this entire variable, using ctrl-left-arrow...
All other editors that I've used, would shift on text boundaries - so first command would jump to start of 'flag', second jumps to 'idx', third jumps to 'data', and I'm done...
But RJTE includes every single symbol in the line!! That is unexpected, and very frustrating, it takes *forever* (it feels like) to get to the beginning of the variable...

Is it possible, maybe with an added option, to make ctrl-left-arrow only recognize the character strings, and ignore all the symbols??
Or is there already a way to do that??

===============================================================
Note on final fix... while I *still* feel that having NextWordNoSymbolsAction jump to end-of-word, is not likely to be something that anyone actually wants, in practice, it is trivial to deal with; I execute NextWordNoSymbolsAction until I'm at desired word, then execute PreviousWordNoSymbolsAction *once* to get to beginning of desired word...

That works fine, and isn't annoying; it's not like this is something that I do many times per day... So let's consider it done;
Thank you once again, Rickard, for your diligent support!!
Last edited by DerellLicht1 on 22 Dec 2023 03:50, edited 3 times in total.
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: minor bug in cursor movement

Post by pjj »

DerellLicht1 wrote: 09 Dec 2023 22:25 But RJTE includes every single symbol in the line!!
What exactly do you mean? Using your code (or my own PHP code), caret goes to: beginning of the word "flag" -- end of "idx" -- beginning of "idx" -- end of "data_flags" -- beginning of "data_flags", but no other stops are made, e.g. at the brackets. In the opposite direction it covers space after the word.

I assume this is just how PreviousWordAction operates: it goes to the end and the beginning of a word; I don't know nor suppose it can be changed in options. Perhaps two new actions, PreviousWordBeginningAction and NextWordEndAction, would save you some keystrokes (and nerves :wink:).
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: minor bug in cursor movement

Post by DerellLicht1 »

pjj wrote: 10 Dec 2023 09:00
DerellLicht1 wrote: 09 Dec 2023 22:25 But RJTE includes every single symbol in the line!!
What exactly do you mean? Using your code (or my own PHP code), caret goes to: beginning of the word "flag" -- end of "idx" -- beginning of "idx" -- end of "data_flags" -- beginning of "data_flags", but no other stops are made, e.g. at the brackets. In the opposite direction it covers space after the word.

I assume this is just how PreviousWordAction operates: it goes to the end and the beginning of a word; I don't know nor suppose it can be changed in options. Perhaps two new actions, PreviousWordBeginningAction and NextWordEndAction, would save you some keystrokes (and nerves :wink:).
Well, okay, you are describing exactly what I described; the brackets are at the end of the strings... whether it stopped at the end of string, or at the bracket, is irrelevant, it makes no sense in any case!! When I jump left by word, stopping at the "end" of a string simply cannot ever be what I requested!!

So, Author, I still would really wish this corrected...
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: minor bug in cursor movement

Post by DerellLicht1 »

pjj wrote: 10 Dec 2023 09:00
DerellLicht1 wrote: 09 Dec 2023 22:25 But RJTE includes every single symbol in the line!!
What exactly do you mean? Using your code (or my own PHP code), caret goes to: beginning of the word "flag" -- end of "idx" -- beginning of "idx" -- end of "data_flags" -- beginning of "data_flags", but no other stops are made, e.g. at the brackets. In the opposite direction it covers space after the word.
BTW, I believe that my interpretation is correct, and yours is mistaken.
If I use PreviousWordAction on regular text (with space delimiters), it *only* jumps to beginning of word, not end of word.
So I'm pretty sure that in my code situation, it is misinterpreting what "words" are, or possibly what "delimiters" are...

Maybe I could re-define delimiters for C/C++ code, to resolve this anomaly??
User avatar
Rickard Johansson
Site Admin
Posts: 6562
Joined: 19 Jul 2006 14:29

Re: minor bug in cursor movement

Post by Rickard Johansson »

I'll fix it in the next release. Please test the beta version when released.

BTW. I noticed some issues with ctrl+right as well...
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: minor bug in cursor movement

Post by DerellLicht1 »

Will do... will report back here afterwards.
Thanks, Rickard!!
User avatar
Rickard Johansson
Site Admin
Posts: 6562
Joined: 19 Jul 2006 14:29

Re: minor bug in cursor movement

Post by Rickard Johansson »

Just for reference. I tested against Sublime, VS Code, NotePad++ and Delphi IDE.

Sublime and VS Code jumps very differently compared to RJ TextEd. When going to the left - it jumps to the beginning of a word, and when going right - it jumps to the end of the word.

NotePad++ seems work like RJ TextEd. Ctrl-left and ctrl-right stops at the same positions.

The Sublime (VS Code) way makes jumping quicker and if you e.g. jump left and you wish to jump to the end of the word - just do a ctrl-right.

In Delphi editor the cursor only jumps to the beginning of a word, regardless of the direction :?

The VS Code, Sublime way is quicker and does make sense.
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: minor bug in cursor movement

Post by DerellLicht1 »

Well, I pray that you will pursue the logical choice...
When moving among words in a line, stopping at every symbol character simply makes no sense, and is very disruptive...

I would suggest that this should be viewed in the context of "moving among words"...
PreviousWordAction should move among words - which should be groupings of normal characters...
To have that operation recognize and interact with formatting characters, just doesn't make any sense, and certainly will not ever be something that I desire...

BTW, my reference editors are MultiEdit (a commercial editor that I used for decades, but is no longer available) and PsPad, which was previously my go-to editor, before a bug popped up that he has never been able to solve... anyway, both of them use a more-intuitive previous/next movement that actually recognizes 'words'...
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: minor bug in cursor movement

Post by pjj »

DerellLicht1 wrote: 10 Dec 2023 19:31 BTW, I believe that my interpretation is correct, and yours is mistaken.
If I use PreviousWordAction on regular text (with space delimiters), it *only* jumps to beginning of word, not end of word.
So I'm pretty sure that in my code situation, it is misinterpreting what "words" are, or possibly what "delimiters" are...
Yes, it stops on punctuation marks even on "regular text" (e.g. braces or dots), however removing "symbols that separates words at double mouse click selection" (this was mu hunch) doesn't affect this behavior.

Let's wait for Rickard's solution.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: FIXED? minor bug in cursor movement

Post by DerellLicht1 »

Okay, I'm using 16.10 beta 1... but movement by word still isn't working as I expect...
looking at this line:

for (i=start ; i< finish ; i++) {

starting at end of line, ctrl-left...

Pspad: stops only on keywords, no symbols; number of steps from right to left: 6
multiedit: stops only on keywords, no symbols; number of steps from right to left: 5
RJTE: stops on almost every object, both text and symbol; number of steps from right to left: 10

Why can't we just jump between words, and skip the symbols?
User avatar
Rickard Johansson
Site Admin
Posts: 6562
Joined: 19 Jul 2006 14:29

Re: FIXED? minor bug in cursor movement

Post by Rickard Johansson »

To me it seems most editors doesn't work that way. I tried your example in a few editors.

NotePad++ : 13 steps
VSCode : 11 steps
Sublime : 10 steps (worked exactly like RJ TextEd)

But I've added new keyboard actions to the final release.

PreviousWordNoSymbolsAction
NextWordNoSymbolsAction
SelectPreviousWordNoSymbolsAction
SelectNextWordNoSymbolsAction

Just open Environment -> Customize keyboard...
Select e.g. "PreviousWordNoSymbolsAction" and assign Ctrl+left to it (instead of "PreviousWordAction").

With PreviousWordNoSymbolsAction it completes your example in 6 steps, from right to left.
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: FIXED? minor bug in cursor movement

Post by DerellLicht1 »

Excellent!! Thank you so much!!

and I agree with you about those other editors; I looked at each of those, when I was looking for a replacement for MultiEdit, which I had used for decades before the company folded... frankly, I think VS Code is quite primitive; n++ is close, but lacks *many* features that I treasured, especially in handling of bookmarks. I also rejected Sublime, which I found to be *far* from Sublime, though I no longer recall my issues with it...

For awhile, I was very happy with PsPad, until that end-of-block corruption bug popped up a few years ago, which he's never been able fix for some reason...
Then I found RJTE, and wondered why I hadn't switched to it years earlier!! I *did* have a few somewhat serious issues with it, initially, but once I got on the support forum, you fixed every one of them, almost immediately!! I have to say, I've never seen any other program that has the level of support that you provide here; I remain grateful!!

One question, though... what is difference between
PreviousWordNoSymbolsAction and SelectPreviousWordNoSymbolsAction ??
User avatar
Rickard Johansson
Site Admin
Posts: 6562
Joined: 19 Jul 2006 14:29

Re: FIXED? minor bug in cursor movement

Post by Rickard Johansson »

You can assign Shift+Ctrl+Left to SelectPreviousWordNoSymbolsAction instead of SelectPreviousWordAction, if you want the same behavior when selecting words.
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: FIXED? minor bug in cursor movement

Post by DerellLicht1 »

Ahhh... interesting... I've actually used both move and select (shift-ctrl-arrow vs ctrl-arrow), but never consciously realized I was doing it!! Thanks for the clarification...
User avatar
DerellLicht1
Posts: 136
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: FIXED: minor bug in cursor movement

Post by DerellLicht1 »

YES!!! That is perfect!! Thank ye very much...
Post Reply