Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Feature request: Allow tab triggers to invoke commands #221

Open
@JoshCheek

Description

@JoshCheek

JoshCheek/atom-seeing-is-believing#25 was opened against my package, thought I'd play around and see if I liked anything. However, it doesn't look like there is any way to do it.

Here are some ideas for what it might look like:

Take action other than expand/tabstop-cycle

With this approach, pressing tab the second time evaluates the file instead of expanding (ie the action to take becomes configurable and defaults to the current behaviour of expansion/tabstop cycling).

'.source.ruby':
  'Add SiB annotation':
    'prefix': '#'
    'body': '# => '
  'Evaluate SiB annotation':
    'prefix': '# => '
    'action': 'seeing-is-believing:annotate-magic-comments'

A second argument for this approach is that it might handle the decision to expand / tabstop-cycle better and not require the two keymap registration files with the comment to explain them.

Hook into snippet events

This one is probably easiest, it's the same behaviour as presently exists, but it lets the user set a callback.

'.source.ruby':
  'Add SiB annotation':
    'prefix': '#'
    'body': '# => '
    'after-expand': 'seeing-is-believing:annotate-magic-comments'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions