Skip to content

Commit

Permalink
Merge pull request #5 from robkorv/multi-cursor
Browse files Browse the repository at this point in the history
multi cursor support
  • Loading branch information
robkorv authored Sep 24, 2016
2 parents bf59969 + c34f98e commit d804419
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.3.0 - Slugifies
* Multi-cursor support

## 0.2.0 - Happy 1.x to Atom
* Upgrade to Atom's 1.0 APIs

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ An [atom package](https://atom.io/packages/slugify-atom) which exposes a
apm install slugify-atom
```

Or Settings/Preferences -> Packages -> Search for `slugify-atom`
Or Settings/Preferences -> Install -> Search for `slugify-atom`

## Usage
1. Select text
Expand Down
10 changes: 6 additions & 4 deletions lib/slugify-atom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ module.exports = SlugifyAtom =

convert: ->
if editor = atom.workspace.getActiveTextEditor()
selection = editor.getSelectedText()

slug = require 'slug'
slugify = slug(selection, {mode: 'rfc3986'})
editor.insertText("#{slugify}")
editor.mutateSelectedText(
(selection) ->
selectedText = selection.getText()
slugify = slug(selectedText, {mode: 'rfc3986'})
selection.insertText("#{slugify}", {select: true})
)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slugify-atom",
"main": "./lib/slugify-atom",
"version": "0.2.0",
"version": "0.3.0",
"description": "Slugify a selection",
"activationCommands": {
"atom-workspace": "slugify:convert"
Expand Down

0 comments on commit d804419

Please sign in to comment.