Bug 324316 - Allow more detailed control over caret positioning in identifiers (after Ctrl+Left / Ctrl+Right)
Summary: Allow more detailed control over caret positioning in identifiers (after Ctrl...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 519677 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-02 10:58 EDT by Peter Remmers CLA
Modified: 2020-09-04 15:19 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Remmers CLA 2010-09-02 10:58:52 EDT
Build Identifier: 20100617-1415, CDT 201006141710

Even though this option is turned off in "C/C++ / Editor", Ctrl-left and Ctrl-right still stop inside identifiers.

This is with eclipse running on a 64 bit linux machine, displaying on a Windows 7 PC with Cygwin/X server (although I don't think this makes any difference).

For some reason, I had to re-assign ctrl-left and ctrl-right to "next word" and "previous word", because the assignment was lost. So there's now a "U" next to each. But I don't think this makes a difference, either, because shift-ctrl-right and left still have the default assignment, and also stop inside identifiers.


Reproducible: Always
Comment 1 Peter Remmers CLA 2010-09-02 11:54:54 EDT
I just noticed that the option does indeed change the behavior.

Here's a table:

identifier       open_your_eyes    apples2oranges   CamelCaseIdent
option enabled      stops             skips             stops
option disabled     stops!!           stops!!           skips
Comment 2 Anton Leherbauer CLA 2010-09-03 03:11:57 EDT
If the option is disabled the behavior falls back to the platform default, i.e. the Eclipse Text Editor will behave the same.
On Windows the caret does not stop inside "apples2oranges" (with disabled option), but it does so on Linux/GTK.
So, it seems the behavior is also window system dependent.
Comment 3 Nathan Ridge CLA 2017-01-02 20:10:05 EST
I think the appropriate solution here is to allow controlling the caret positioning at the Platform level.
Comment 4 Dani Megert CLA 2017-01-03 10:38:03 EST
The Platform does not have a concept of "identifier" and currently we do not have a "language" layer. Hence this remains with CDT, JDT,...
Comment 5 Nathan Ridge CLA 2017-01-03 12:04:13 EST
(In reply to Dani Megert from comment #4)
> The Platform does not have a concept of "identifier" and currently we do not
> have a "language" layer. Hence this remains with CDT, JDT,...

What about the concept of a "word"? I imagined that the behaviour configured at the Platform level would affect any text editor, regardless of language.
Comment 6 Dani Megert CLA 2017-01-03 12:11:41 EST
(In reply to Nathan Ridge from comment #5)
> (In reply to Dani Megert from comment #4)
> > The Platform does not have a concept of "identifier" and currently we do not
> > have a "language" layer. Hence this remains with CDT, JDT,...
> 
> What about the concept of a "word"? I imagined that the behaviour configured
> at the Platform level would affect any text editor, regardless of language.

For word navigation we use the OS behavior to match other text editors.
Comment 7 Nathan Ridge CLA 2017-01-03 12:41:41 EST
(In reply to Dani Megert from comment #6)
> For word navigation we use the OS behavior to match other text editors.

And there is no interest in allowing the user to customize / override the OS behaviour at the Platform level?
Comment 8 Dani Megert CLA 2017-01-03 12:45:45 EST
(In reply to Nathan Ridge from comment #7)
> (In reply to Dani Megert from comment #6)
> > For word navigation we use the OS behavior to match other text editors.
> 
> And there is no interest in allowing the user to customize / override the OS
> behaviour at the Platform level?

Once we have a language layer this might be an option. But usually the navigation still slightly differs depending on the used language.
Comment 9 Nathan Ridge CLA 2017-01-03 15:44:30 EST
(In reply to Dani Megert from comment #8)
> (In reply to Nathan Ridge from comment #7)
> > (In reply to Dani Megert from comment #6)
> > > For word navigation we use the OS behavior to match other text editors.
> > 
> > And there is no interest in allowing the user to customize / override the OS
> > behaviour at the Platform level?
> 
> Once we have a language layer this might be an option. But usually the
> navigation still slightly differs depending on the used language.

What is a "language layer"?

I'm talking about customizing the default word navigation behaviour that's used in all text editors unless a specific editor overrides it.

Language editors (CDT, JDT) can then choose to override it to be appropriate for the language.
Comment 10 Dani Megert CLA 2017-01-04 10:04:22 EST
(In reply to Nathan Ridge from comment #9)
> (In reply to Dani Megert from comment #8)
> > (In reply to Nathan Ridge from comment #7)
> > > (In reply to Dani Megert from comment #6)
> > > > For word navigation we use the OS behavior to match other text editors.
> > > 
> > > And there is no interest in allowing the user to customize / override the OS
> > > behaviour at the Platform level?
> > 
> > Once we have a language layer this might be an option. But usually the
> > navigation still slightly differs depending on the used language.
> 
> What is a "language layer"?

A layer that has the things that are common to programming languages. We have something for refactoring (*.ltk.*) but not for other parts.


> I'm talking about customizing the default word navigation behaviour that's
> used in all text editors unless a specific editor overrides it.
> 
> Language editors (CDT, JDT) can then choose to override it to be appropriate
> for the language.

That was my point. Most of them will have to override it anyway if they want to provide perfect support.
Comment 11 Nathan Ridge CLA 2017-01-04 13:18:09 EST
Ok, thanks for clarifying.

To the bug reporter and anyone else interested in this: I think for now CDT would accept a patch that would allow customizing the behaviour along the lines of the table in comment 1. (I have no plans to work on such a patch myself.)

If Platform later introduces a language layer, we could consider upstreaming the setting there.
Comment 12 Nathan Ridge CLA 2017-07-16 16:02:58 EDT
*** Bug 519677 has been marked as a duplicate of this bug. ***