Skip to content

Commit

Permalink
Fix #24
Browse files Browse the repository at this point in the history
ensure step isn't already negative if start > stop
  • Loading branch information
duydao committed Nov 22, 2014
1 parent 1ed8d36 commit cae544d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -13,8 +13,13 @@ _Text Pastry_ is a free plugin for [Sublime Text](http://www.sublimetext.com/),
- Improved paste _(paste the first three lines of the clipboard data to the three selected locations)_

## What's new ##
- 1.4.2: Fix range / negative steps [#24](https://github.com/duydao/Text-Pastry/issues/24) - Thanks [@TheClams](https://github.com/TheClams)
- 1.4.1: Hotfix for [#23](https://github.com/duydao/Text-Pastry/issues/23) - Thanks [@dufferzafar](https://github.com/dufferzafar)
- 1.4.0: [New Features!](https://github.com/duydao/Text-Pastry#release-notes-140)
- 1.3.5: History navigation, command shortcuts - Thanks [@JAStanton](https://github.com/JAStanton)
- 1.3.4: Fixed for Sublime Text 3 - Thanks [@forcey](https://github.com/forcey)
- 1.3.3: New commands: \r(regexp) and \r regex
- 1.3.2: Bugfix release

## Release Notes 1.4.0 ##

Expand Down
2 changes: 1 addition & 1 deletion text_pastry.py
Expand Up @@ -675,7 +675,7 @@ def run(self, edit, start=0, stop=None, step=1, padding=1, fillchar='0', justify
if global_settings('range_include_end_index', True):
stop += step
# if stop is negative, step needs to be negative aswell
if (start > stop):
if (start > stop and step > 0):
step = step * -1
items = [str(x) for x in range(start, stop, step)]
if padding > 1:
Expand Down

0 comments on commit cae544d

Please sign in to comment.