diff --git a/Default.sublime-commands b/Default.sublime-commands index be58227..7753de2 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -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"}, diff --git a/numeric.py b/numeric.py index d3ab020..3b80023 100644 --- a/numeric.py +++ b/numeric.py @@ -38,13 +38,14 @@ 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 @@ -52,6 +53,7 @@ def per_int(self, intval): class HexToDecimalCommand(bases.PerWordTextCommand): + def per_word(self, text): try: int_val = int(text, base=16) @@ -66,6 +68,7 @@ def per_word(self, text): class DecimalToHexCommand(bases.PerIntegerTextCommand): + def per_int(self, num): return num_to_hex(num) @@ -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) @@ -85,6 +89,7 @@ def per_int(self, num): class DecrementSelectionCommand(bases.PerIntegerTextCommand): + def per_int(self, num): num -= 1 return str(num)