Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support word/line deletion #169

Closed
rlivsey opened this issue Oct 12, 2015 · 6 comments
Closed

Support word/line deletion #169

rlivsey opened this issue Oct 12, 2015 · 6 comments

Comments

@rlivsey
Copy link
Collaborator

rlivsey commented Oct 12, 2015

option+backspace on OSX should delete the word to the left, this is ctrl+backspace on Windows & Linux IIRC.

Likewise cmd+backspace on OSX should delete to the start of the line, I'm not sure what the Windows/Linux shortcut for this is…

@bantic
Copy link
Collaborator

bantic commented Oct 13, 2015

Thanks for opening. This should definitely be added.

@rlivsey
Copy link
Collaborator Author

rlivsey commented Oct 13, 2015

I wonder if the standard behaviour is documented anywhere, or if there are other projects which do this we can crib from. It's not a simple as "delete up to the closest whitespace character" unfortunately.

Certain non-whitespace characters (eg :) look to be treated as part of the word, whereas others (eg +) aren't:

Quick experiment results, where | is the cursor:

before after
foo bar ` `
foo+bar ` `
foo:bar ` `

Possibly "just" a case of coming up with a whitelist of characters to treat as separators or not.

@bantic
Copy link
Collaborator

bantic commented Oct 13, 2015

Interesting. I also found this apple doc that shows some other common movement commands.
Whitelisting word-separators seems like a fine way to go. I experimented briefly just now and can find only one other separator that is ignored like the colon is: the underscore.

@rlivsey
Copy link
Collaborator Author

rlivsey commented Oct 13, 2015

Cool, that's hopefully fairly straightforward then. I'll take a stab at it tomorrow as it's probably a good task to get my head around section editing etc…

@chrisdpeters
Copy link

The same goes for option + shift + left/right arrow for highlighting an individual word or or cmd + shift + left/right arrow for highlighting a whole line.

@bantic
Copy link
Collaborator

bantic commented Jul 19, 2016

the word and line cursor movements are implemented as of v0.10.0. Supporting option-delete is in progress...

bantic added a commit that referenced this issue Jul 21, 2016
…169

  * Add `Position#moveWord`
  * Refactor EventManager's modifier key down/up tracking to include alt and ctrl
  * Add Position#isHeadOfPost and Position#isTailOfPost
bantic added a commit that referenced this issue Jul 21, 2016
…169

  * Add `Position#moveWord`
  * Refactor EventManager's modifier key down/up tracking to include alt and ctrl
  * Add Position#isHeadOfPost and Position#isTailOfPost
bantic added a commit that referenced this issue Jul 21, 2016
…169

  * Add `Position#moveWord`
  * Refactor EventManager's modifier key down/up tracking to include alt and ctrl
  * Add Position#isHeadOfPost and Position#isTailOfPost
@bantic bantic closed this as completed in f919490 Jul 21, 2016
bantic added a commit that referenced this issue Jul 21, 2016
Add support for word deletion on Mac (opt+del) and PC (ctrl+del) ref #169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants