Ticket #1480 (assigned enhancement)
Home key behavior in editor
Reported by: | dborca | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | Future Releases |
Component: | mcedit | Version: | 4.7.0-pre1 |
Keywords: | Cc: | dborca@…, szaszg@… | |
Blocked By: | Blocking: | ||
Branch state: | on rework | Votes for changeset: |
Description
The following patch (against 4.7.0-pre1) makes the Home key go to the first column on first press, and then go to the beginning of non-whitespace -- if any.
Attachments
Change History
comment:2 follow-up: ↓ 3 Changed 15 years ago by slavazanko
- Milestone changed from 4.7.0-pre2 to 4.7.0-pre3
Nice, but IMO need to add config option for toggle this behaviour.
This feature-append go in pre3
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 15 years ago by andrew_b
- Priority changed from major to minor
Replying to slavazanko:
Nice, but IMO need to add config option for toggle this behaviour.
Definitely yes. I personally dislike such behavior.
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 13 Changed 15 years ago by ossi
Replying to andrew_b:
Replying to slavazanko:
Nice, but IMO need to add config option for toggle this behaviour.
Definitely yes. I personally dislike such behavior.
this is exactly the type of micro option one should avoid at all costs.
you don't like it? get used to it, damn it. it's really not a big deal.
comment:5 Changed 15 years ago by angel_il
- Status changed from new to accepted
- Owner set to angel_il
comment:8 Changed 13 years ago by andrew_b
- Branch state set to no branch
- Milestone changed from 4.7 to Future Releases
comment:9 Changed 13 years ago by szaszg
Here is a patch for the current HEAD.
It adds also a similar function to END key.
comment:10 Changed 13 years ago by angel_il
- Cc szaszg@… added
- Votes for changeset set to angel_il
- Branch state changed from no branch to on review
look nice, thanx
branch: 1480_mcedit_home_end_enchencement
(parent: master)
my vote here
comment:11 Changed 13 years ago by andrew_b
- Votes for changeset angel_il deleted
- Branch state changed from on review to on rework
Don't unconditionally change common behavior. Please find a way to restore the previous one.
comment:12 Changed 12 years ago by szaszg
I update the patch (for the master branch).
Now, by default HOME/END keys work as before. If user check Smart Home/End key behavior in options, or set option_smart_home_end to 1, Home/End keys work the new way (the Home key go to the first column on first press, and after second press go to the beginning of non-whitespace char and the End key go to the last column on first press, and after second press go to the end of non-whitespace char)
- edit.h
- new variable declaration: option_smart_home_end - for new option
- editoptions.c
- new option: Smart Home/End key behavior - to activate/deactivate new behavior
- edit.c
- new variable: option_smart_home_end
- new functions: edit_bol_var(), edit_eol_var() - to new behavior
- mcedit.1.in
- new section about "option_smart_home_end" option
(Thanks to Ilia for the man page and option_smart_home_end :-)
comment:13 in reply to: ↑ 4 Changed 10 years ago by egmont
Replying to ossi:
Replying to andrew_b:
Replying to slavazanko:
Nice, but IMO need to add config option for toggle this behaviour.
Definitely yes. I personally dislike such behavior.
this is exactly the type of micro option one should avoid at all costs.
you don't like it? get used to it, damn it. it's really not a big deal.
My 2 cents here, in case anyone cares after 5 years :)
My favorite text editor "joe" implemented this feature at some point. As much as it irritated me and I didn't like it initially, I was lazy to dig up the config option to disable it (yes it can be disabled), and I got used to this feature quite quickly. I mean, I hardly ever press Home to get home when already at the first column (why would I?), but slowly began to use this every once in a while for its new functionality, so I find it more useful than annoying.
My vote goes for ossi's opinion: "get used to it, damn it."
comment:14 Changed 8 years ago by andrew_b
- Status changed from accepted to assigned
- Owner angel_il deleted