Skip to content

Commit

Permalink
no selection operates on whole buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jpohjolainen committed Sep 16, 2017
1 parent 6d398c2 commit b7cbad9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
gpg.recipients
test.yaml

*.asc
*.gpg
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Or install trough Atom Packages.

## Usage

Select text and press ```ctrl-shift-e``` to encrypt or ```ctrl-shift-d``` to decrypt.
Select text and press ```ctrl-shift-e``` to encrypt or ```ctrl-shift-d``` to decrypt. NEW: If no text is selected,
operations are done on whole buffer.

Optionally you can also use context menu with right mouse button and select either _GPG Encrypt_ or
_GPG Decrypt_. Same options can be found under menu __Packages__ -> __GPG__.
Expand Down
5 changes: 4 additions & 1 deletion lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ module.exports =
allSelectionRanges = @editor.getSelectedBufferRanges()
@selectedRanges = _.reject allSelectionRanges, (s) -> s.start.isEqual(s.end)
@rangeCount = @selectedRanges.length

if not @rangeCount
whole =
@selectedRanges = [ Range([@editor.getLastBufferRow(),0]) ]
@rangeCount = 1
@rootScopes = @editor.getRootScopeDescriptor()?.getScopesArray()
@rootScopes ?= @editor.getRootScopeDescriptor()

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]
},
"engines": {
"atom": ">=0.189.0 <2.0.0"
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"underscore-plus": "1.x"
Expand Down

0 comments on commit b7cbad9

Please sign in to comment.