! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Add option delete line
Status:
RESOLVED: MOVED
Product:
Mousepad
Component:
General

Comments

Description Andre Miranda editbugs 2014-09-17 03:47:41 CEST
Created attachment 5651 
patch

Add an option to delete line / selection.
Comment 1 Yan Pas 2016-08-04 15:05:37 CEST
Created attachment 6766 
patch for 0.4

I've updated patch for 0.4 version. Merge please
Comment 2 Andre Miranda editbugs 2016-08-04 15:12:58 CEST
Even though I have commit rights now, I'd like to hear Matt's opinion about the code.
Comment 3 Matthew Brush editbugs 2016-08-04 17:04:41 CEST
I haven't tested the functionality, but I'm not really fond of dropping an existing keybinding so it can be used for something else. It might be better to choose a new keybinding for this feature (ex. `<Ctrl><Shift>del`), or at least to give an alternative one to the detach tab feature.

Also the wording is a bit confusing, it sounds like it would delete the current line or whatever is selected, but it seems to delete entire lines that have any amount of them selected. Maybe if it was just called "Delete Line(s)"?
Comment 4 Yan Pas 2016-08-04 22:07:54 CEST
Speaking about kb shortcuts: on the other hand detaching tab with keyboard is rarely used functionality. If you detach it you are likely to do it with mouse to place the window in desirable place. Ctrl+D shortcut is popular across Text editors: gedit, Eclipse and located near other popular shortcuts.
Comment 5 Andre Miranda editbugs 2016-08-05 01:07:21 CEST
What about Ctrl + Shift + D? Most users are used to Ctrl + D, but some other editors use more awkward shortcuts, e.g. IntelliJ uses Ctrl + Y, Notepad++ uses Ctrl + L, Atom uses Ctrl + Shift + K... But I wonder if someday when we add a shortcut to Duplicate Line/Selection, what would that be? Ctrl + Alt + D?

Regarding the wording, I don't know, using (s) to pluralize complicates some translations. GEdit calls this "Delete current line", Atom calls "Delete Line", Notepad++(Scintilla) calls "SCI_LINEDELETE" but they all delete all selected lines. Maybe Delete Line/Selection?
Comment 6 Matthew Brush editbugs 2016-08-05 01:58:26 CEST
(In reply to André Miranda from comment #5)
> Regarding the wording, I don't know, using (s) to pluralize complicates some
> translations. GEdit calls this "Delete current line", Atom calls "Delete
> Line", Notepad++(Scintilla) calls "SCI_LINEDELETE" but they all delete all
> selected lines. Maybe Delete Line/Selection?

Mostly I meant because it doesn't delete the selection (like Delete key does), it deletes all lines on which a selection exists, which can be more than what was selected, for example:

  Line| 1 Here
  Line 2 Here
  Line 3 |Here

If the | shows the selection start/end, "delete selection" sounds like it would leave "LineHere", but it really deletes all 3 lines.
Comment 7 Matthew Brush editbugs 2016-08-05 02:04:10 CEST
(In reply to Yan Pas from comment #4)
> Speaking about kb shortcuts: on the other hand detaching tab with keyboard
> is rarely used functionality. If you detach it you are likely to do it with
> mouse to place the window in desirable place. Ctrl+D shortcut is popular
> across Text editors: gedit, Eclipse and located near other popular shortcuts.

I agree Ctrl+D is wasted on detaching tabs, what I meant was I just don't like breaking the ability to do it by a keybinding for people who do use it. At least if it's just changed to something else, they can still use the new binding.

Geany uses Ctrl+k for "delete current line(s)", and Ctrl+d for "duplicate line or selection", as another data point.

I'm rather indifferent on which actual binding gets used though. In a perfect world we would have a GUI like Geany has to allow easy re-binding of keys.
Comment 8 Yan Pas 2016-08-05 11:46:48 CEST
Users already may edit kb shortcuts (http://docs.xfce.org/faq). The problem is that only a few people know about this feature :)
Comment 9 Andre Miranda editbugs 2016-08-05 16:47:08 CEST
Basically we have to choose one of the options:
1. Use Ctrl+D for "Delete current line(s)" and use another shortcut for Detach Tabs(Ctrl+Alt+T).
2. Choose another shortcut for "Delete current line(s)", e.g. Ctrl + K.

I'd go for option 1, IMHO deleting lines is more used than detaching tabs(I didn't know there's a shortcut for it). In any case, if the user really needs the old shortcut they can do that enabling the option mentioned by Yan Pas, but I'm not sure that works for GTK 3.

Also I agree with the naming "Delete current line(s)" and I hope the translators are able to handle the pluralization as this is not the first time we use the "(s)".
Comment 10 Git Bot editbugs 2020-05-24 01:28:52 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/13.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #11168

Reported by:
Andre Miranda
Reported on: 2014-09-17
Last modified on: 2020-05-24

People

Assignee:
Matthew Brush
CC List:
5 users

Version

Target Milestone:
Mousepad 0.2.x

Attachments

patch (9.49 KB, patch)
2014-09-17 03:47 CEST , Andre Miranda
andreldm : review? ( matt )
patch for 0.4 (6.43 KB, patch)
2016-08-04 15:05 CEST , Yan Pas
no flags

Additional information