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.

Tab stop markers are not removed correctly after reaching last tab stop #248

@winstliu

Description

@winstliu

Prerequisites

Description

Snippet tab stop markers are not removed correctly after reaching the last tab stop and typing. The last tab stop should be treated differently than all the rest. After any whitespace is entered, the tab stop markers should be invalidated. Instead, as long as you are at the final tab stop, the only way that I can find to invalidate the tab stops is to edit the previous tab stops. This essentially means that the number of markers will never stop growing as long as the last tab stop is always reached and previous tab stops are not touched.

Steps to Reproduce

  1. Open an untitled editor
  2. Set language to CoffeeScript
  3. Trigger the fora snippet
  4. Go to the last tab stop, which is when # body... is highlighted
  5. Do anything you want as long as your cursor is not placed within a previous tab stop, which can include typing, creating other snippets, copy/pasting in text, deleting everything (editor:select-all followed by backspace), etc.
  6. In dev tools: let editor = atom.workspace.getActiveTextEditor()
  7. editor.getMarkers().length
  8. If you want, you can look at the last marker, which should have some interesting ranges depending on what you did.

Expected behavior: If whitespace or destructive actions was created in step 5, step 7 should return 0

Actual behavior: Step 7 returns at least 3

Reproduces how often: 100%

Versions

Atom    : 1.23.0-dev-02b133844
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions