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

Fix behavior when pressing Tab after a snippet reaches an explicit end stop. #280

Merged
merged 1 commit into from Oct 17, 2018

Conversation

Projects
None yet
1 participant
@savetheclocktower
Collaborator

savetheclocktower commented Oct 16, 2018

Fixes #278.

Description of the Change

Issue #278 describes the problem: when a snippet contains an explicit $0, and when the user cycles through the snippet to that end stop, the next press of Tab does nothing. This doesn’t have any benefit for the user and behaves differently from other implementations of snippets (Sublime Text, VSCode, etc.).

Alternate Designs

This behavior was introduced (inadvertently, I think) in #262, whose effect was to add an implied $0 at the end of every snippet that didn’t have its own $0. If I were doing a larger overhaul here, I’d want to refactor so as to remove the need for a goToEndOfLastTabStop method altogether. But I think that’d be touching a lot of code just to fix a pretty minor issue, so I went for the simpler fix.

Benefits

Brings the behavior of snippets more in line with other IDEs’ implementations. Annoys the user less.

Possible Drawbacks

The behavior change will perhaps be surprising to people the first time it happens. But nobody will mind unless they had grown particularly fond of pressing Tab and having it do nothing.

Applicable Issues

Reported in #278. #262 is the source of the unwanted behavior.

@savetheclocktower savetheclocktower merged commit e9ed1ca into atom:master Oct 17, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@savetheclocktower savetheclocktower deleted the savetheclocktower:apd-278-end-stop-only branch Oct 17, 2018

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