Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Alt+Backspace, Ctrl+Backspace whole word deletion #367

Closed
LeafyLappa opened this issue Nov 14, 2020 · 11 comments
Closed

Alt+Backspace, Ctrl+Backspace whole word deletion #367

LeafyLappa opened this issue Nov 14, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@LeafyLappa
Copy link

What do you want

To be able to delete whole words with the typical shortcut which is either alt+backspace or ctrl+backspace.

Why

I'm a somewhat fast typist regularly exceeding 130 wpm with peak typing speed of roughly 760 cpm. The fact that cordless does not have this simple feature (which contributes to my typing speed greatly) is astonishing and really perplexes me, let alone makes me extremely irritated when I have to erase something.

Now cordless seems to have a vim-like shortcut ctrl+w to remove whole words. And while it may be easier on fingers and more accessible, it's not worth to train muscle memory for that shortcut unless one is frequently using vim, so the other common options should really be available.

I first wanted to submit it as a bug report because it really looks more like a bug but it does not seem to fit the template so I'm making it a feature request.

@Bios-Marcel
Copy link
Owner

Bios-Marcel commented Nov 14, 2020

Hey there, thanks for creating an issue on this.
While you are right, that Ctrl+W is a less widely known variant of the shortcut, it's easily usable on every keyboard and every terminal and it's what command-line-application users are used to. Therefore I still deem it do be a good default.

However, cordless allows you to change any existing shortcut for pre-defined features, such as Delete word left is one. You can change the shortcut via Ctrl+K, selecting relevant entry, hitting Enter ans hitting your desired key combination.

Note that right now, Ctrl+Backspace doesn't work, but Alt+Backspace will, depending on your operating system / terminal.

This is due to an underlying issue where some terminals don't differentiate between delete and backspace. Maybe this was a tcell issue and is resolved by know, i'll have to reinvestigate this.

@LeafyLappa
Copy link
Author

Interesting. I'm using xfce4-terminal.

For some reason I also figured that the typical behavior of the vim-like delete word was slightly different from ctrl+backspace style but it does not seem to be the case (my bad I suppose), so the possibility to change the key combination for the shortcut pretty much closes this issue (at least, once it's possible to make ctrl+backspace work).

Bios-Marcel added a commit that referenced this issue Nov 16, 2020
@Bios-Marcel
Copy link
Owner

Hey @Greentaily can you checkout whether the latest commit solves your issue?

@Bios-Marcel Bios-Marcel added the bug Something isn't working label Nov 16, 2020
@LeafyLappa
Copy link
Author

Just built from the latest commit and both ctrl+backspace and alt+backspace now seem to add invisible characters that need to be removed with normal backspace (which works) instead of deleting anything. Once I rebind the shortcut everything becomes chaotic and simply won't work, even regular backspace.

@Bios-Marcel
Copy link
Owner

Bios-Marcel commented Nov 18, 2020 via email

@LeafyLappa
Copy link
Author

I might have poorly expressed myself. They both misbehave in my terminal. Even if I bind the shortcut to ctrl+w now, they both add invisible characters.

@Bios-Marcel
Copy link
Owner

Yeah, I added another workaround. Can you try again please?

@LeafyLappa
Copy link
Author

ctrl+backspace works however once I change it things become chaotic.
On top of that ctrl+w now inserts invisible characters too.

@Bios-Marcel
Copy link
Owner

I noticed after I've committed haha. I now ignore all characters that aren't runes, tab or newline.
Also, what do you mean with chaotic?

@LeafyLappa
Copy link
Author

Never mind, tested twice and it actually works perfectly except the invisible characters on ctrl+w. I launched the installed version of cordless the first time instead of the one built from cloned repo I suppose.

@Bios-Marcel
Copy link
Owner

I'll be closing this then. Reopen it or recomment if you still have problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants