##// END OF EJS Templates
chistedit: change action for the correct item...
av6 -
r52520:6ec4c745 stable
parent child Browse files
Show More
@@ -1581,14 +1581,16 b' pgup/K: move patch up, pgdn/J: move patc'
1581
1581
1582 def change_action(self, pos, action):
1582 def change_action(self, pos, action):
1583 """Change the action state on the given position to the new action"""
1583 """Change the action state on the given position to the new action"""
1584 assert 0 <= pos < len(self.rules)
1584 rule_pos = self.display_pos_to_rule_pos(pos)
1585 self.rules[pos].action = action
1585 assert 0 <= rule_pos < len(self.rules)
1586 self.rules[rule_pos].action = action
1586
1587
1587 def cycle_action(self, pos, next=False):
1588 def cycle_action(self, pos, next=False):
1588 """Changes the action state the next or the previous action from
1589 """Changes the action state the next or the previous action from
1589 the action list"""
1590 the action list"""
1590 assert 0 <= pos < len(self.rules)
1591 rule_pos = self.display_pos_to_rule_pos(pos)
1591 current = self.rules[pos].action
1592 assert 0 <= rule_pos < len(self.rules)
1593 current = self.rules[rule_pos].action
1592
1594
1593 assert current in KEY_LIST
1595 assert current in KEY_LIST
1594
1596
@@ -1597,6 +1599,8 b' pgup/K: move patch up, pgdn/J: move patc'
1597 index += 1
1599 index += 1
1598 else:
1600 else:
1599 index -= 1
1601 index -= 1
1602 # using pos instead of rule_pos because change_action() also calls
1603 # display_pos_to_rule_pos()
1600 self.change_action(pos, KEY_LIST[index % len(KEY_LIST)])
1604 self.change_action(pos, KEY_LIST[index % len(KEY_LIST)])
1601
1605
1602 def change_view(self, delta, unit):
1606 def change_view(self, delta, unit):
General Comments 0
You need to be logged in to leave comments. Login now