Skip to content

Extract key binding and selection logic into a KeyBindingResponder struct #113

Description

@davidbalbert

Only do this after we support multiple selections #106.

The ideal is that every method in TextView+KeyBinding.swift and TextView+Mouse.swift should be a single line.

Design thoughts:

  • KeyBindingResponder should have an associated method for each method on NSStandardKeyBindingResponding
  • It should handle things like scrolling the selection into view, autoscroll, etc.
  • The owning view should provide or be a KeyBindingResponderDelegate to do the actual scrolling, receive edits, etc.
  • For transpose(_:) and transposeWords(_:) it should be possible to control whether the transposed characters get selected or not.
  • Don't rely on any globals. Even an NSApplication instance should be passed in if necessary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions