After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326006 - Unexpected behavior with "smart" [Home] and [End]
Unexpected behavior with "smart" [Home] and [End]
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.12.x
Other Linux
: Normal normal
: 2.14.0
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-06 18:31 UTC by Evert Verhellen
Modified: 2007-07-19 09:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Evert Verhellen 2006-01-06 18:31:53 UTC
Apparently "smart" [Home] and [End] behaviour is considered a feature (see also bug 324496). I think it should be considered a bug unless there's an easy way to disable it because it does unexpected things (e.g. it is impossible to see if there's trailing whitespace). Therefore I suggest to add a preference that allows to explicitly disable this "smart" behaviour.

An explanatory dialog should ideally be shown as well when this "smart" behaviour is triggered for the first time so that users can decide to either keep using it or to just turn it off permanently.

Consider this analogy ... If my favourite coffee shop keeps putting sugar and milk in my coffee by default then I am going to look for another coffee shop ultimately. The waiter or waitress should ask me the first time if I want sugar or milk with it and if not never ask me again until I request so (i.e. turning the feature on again in the preferences).
Comment 1 Paolo Borelli 2006-01-06 19:06:46 UTC
A program is made of features and decisions, we surely do not want a zillion preferences and popup dialogs for each of them, do we?

For instance when we first implemented smart home-end it was more intrusive becuase it would have moved the cursor first the end of text and then at the end of the line. That was intrusive and would have warranted a way to turn it off.

However the current way smart-home is implemented is very unubtrusive, what is so problematic about it? Without it, when you are at the end of a line END doesn't do anything anything anyway...

Let's take your example of trailing whitespaces[1]: you press END, see that there are trailing whitespaces, hold SHIFT, press END again and there they are, ready to be deleted!


[1] I am totally obsessed with trailing whitespaces :)
Comment 2 Evert Verhellen 2006-01-07 01:30:08 UTC
I don't want loads of preferences or pop-ups but I think that any auto-stuff must at least be configurable. Even Microsoft allows to disable all the auto-stuff in Word. Don't get me wrong. I fully agree that it is interesting for users to have some stuff done automatically provided it helps in the majority of the cases and that users remain in control over these kind of things.

This particular feature makes 2 keys of my keyboard do the opposite of what's printed on it. You call it smart. Well I think it's plain stupid because it does the opposite of what a user might expect. Therefore you cannot enforce this on users. Did you do a usability survey on this feature? If so I am interested to learn the results.

I will give you a practical example which proves that this so-called feature is actually a bug in some cases. Suppose that I have to append a trailing slash at the very end of each line in a file. Type in the following file contents (pressing [Space] where it says so):

X
Y[Space]
X
Y[Space]

Add the slashes by repeating the following keys (starting on the 1st line):

 1. [End]
 2. /
 3. [Down]

Actual results:
Due to the "smart" [End] behaviour the result looks like this:

X/
Y/ 
X/
Y/ 

Expected results:
While this is what there should be (e.g. in vi):

X/
Y /
X/
Y /

Conclusion:
Even though you thought is was a cool feature to jump back and forth of the leading or trailing whitespace using the [Home] or [End] keys (e.g. to easily delete whitespace) there are side-effects that make this feature unacceptable (let alone be the default behaviour and worst of all it's unconfigurable). In software this is considered a bug. Therefore upping the severity to normal.

FYI, deleting the trailing whitespace in a file can easily be done like this:

cat filename | sed 's/[[:blank:]]*$//'

Such functionality could be a perfect plugin candidate for users that lack experience with regular expressions.
Comment 3 Paolo Maggi 2006-01-07 11:02:53 UTC
I see what you mean. 
The behavior you described is a sort of corner case, we will see if there is a way to implement smart Home/End in a smarter way, in order to fix the case you reported.

FYI, there is a smarter way to add a trailing slash to all lines: search for "\n" and replace with "/\n"

I completely disagree about adding a preference to disable smart Home/End, so I'm changing the summary of this bug since we should focus on fix the unexpected behavior you reported. 
Please, feel free to add some other unexpected behaviors if you find them.
Comment 4 Evert Verhellen 2006-01-07 12:22:19 UTC
I am glad that someone recognizes there's a real problem with this so-called "feature" as the side-effects are really irritating.

However I still don't see an answer to the question on the usability study. How do you know this is useful in the majority of the cases? Can someone please speak up on this?

Regarding the "\n" issue ... I don't think any non-technical GNOME user has a clue what "\n" means. Even if this is possible in gedit it isn't something one would expect a user to do.
Comment 5 Paolo Maggi 2006-01-07 13:43:10 UTC
We consider it a "feature", but we recognize there are some "implementation" problems that in some cases could produce some irritating side-effects. We will work on fixing it.
I suppose that if we will be able to fix these side-effect you will not complain anymore about this feature, right?

We don't have usability studies, but we can affirm:
- most major modern editors have the same (or similar) feature
- in one year (may be more) no one complained about it (except you)

About the "\n" stuff, we have this feature since 2.0, and it is well documented on the user manual.
Comment 6 Evert Verhellen 2006-01-07 14:24:08 UTC
Are you saying that people shouldn't complain about functionality that doesn't work as it should? I guess the bulk of the people are just to lazy to report bugs. I happen to have filed bug reports for Mozilla as the first reporter for which there were above 50 duplicates afterwards. Somebody simply must be the first to "complain" (to use your language). Thanks for working on this!
Comment 7 Paolo Maggi 2006-01-07 14:39:19 UTC
> Are you saying that people shouldn't complain about functionality that doesn't
> work as it should? 

I never said that, I only said no one reported problems regarding smart Home/End.

The question seems simple to me:
- we have a functionality we think it is very useful
- in some cases this functionality does not work as it should
- we will try to fix it

Thanks for showing us this problem.
Comment 8 Patryk Zawadzki 2006-01-16 13:25:32 UTC
Maybe this feature could be expanded even further. Quanta does more - if a line is wrapped, pressing END for the first time moves you to the last character of the current row, pressing it again moves you to the end of the last wrapped part. Same about HOME but the other way around.

BTW: I love this feature and I am glad it was implemented this way (first goes to line boundary, next time skips whitespace, not the other way around).

I second the idea of aa automatic trailing whitespace removing plugin.
Comment 9 Loïc Minier 2006-01-31 23:24:28 UTC
I don't like this behavior either, it's simply not consistent with other text edition widgets, for example try deleting the trailing spaces in the "Run..." dialog, this is how I do it:
- type "foo bar  " in the dialog
- type HOME and END
- type END, Shift-Ctrl-Left, Shift-Ctrl-Right

I'd rather use simple and consistent text widgets across the system, and across systems.
Comment 10 Paolo Borelli 2007-07-19 09:03:06 UTC
in gedit 2.19 there is a gconf key to turn this on/off