Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{"caption":"TextCommands: Integer Sequence", "command":"integer_sequence"},
{"caption":"TextCommands: Decimal To Hex", "command":"decimal_to_hex"},
{"caption":"TextCommands: Hex To Decimal", "command":"hex_to_decimal"},
{"caption":"TextCommands: Increment Selection", "command":"increment_selection"},
{"caption":"TextCommands: Increment Selection", "command":"text_commands_increment_selection"},
{"caption":"TextCommands: Decrement Selection", "command":"decrement_selection"},
{"caption":"TextCommands: Selection Length", "command":"selection_length"},
{"caption":"TextCommands: Sort Text", "command":"sort_text"},
Expand Down
9 changes: 7 additions & 2 deletions numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,22 @@


class IntegerSequenceCommand(bases.PerIntegerTextCommand):

def pre(self):
super(IntegerSequenceCommand, self).pre()
self.ind = 0

def per_int(self, intval):
self.ind += 1
return str(self.ind-1)
return str(self.ind - 1)

"""
Converts selected hex numbers into decimal equivalents
"""


class HexToDecimalCommand(bases.PerWordTextCommand):

def per_word(self, text):
try:
int_val = int(text, base=16)
Expand All @@ -66,6 +68,7 @@ def per_word(self, text):


class DecimalToHexCommand(bases.PerIntegerTextCommand):

def per_int(self, num):
return num_to_hex(num)

Expand All @@ -74,7 +77,8 @@ def per_int(self, num):
"""


class IncrementSelectionCommand(bases.PerIntegerTextCommand):
class TextCommandsIncrementSelectionCommand(bases.PerIntegerTextCommand):

def per_int(self, num):
num += 1
return str(num)
Expand All @@ -85,6 +89,7 @@ def per_int(self, num):


class DecrementSelectionCommand(bases.PerIntegerTextCommand):

def per_int(self, num):
num -= 1
return str(num)