Show More
@@ -1194,10 +1194,6 b' class histeditrule(object):' | |||||
1194 |
|
1194 | |||
1195 |
|
1195 | |||
1196 | # ============ EVENTS =============== |
|
1196 | # ============ EVENTS =============== | |
1197 | def makeselection(state, pos): |
|
|||
1198 | state.selected = pos |
|
|||
1199 |
|
||||
1200 |
|
||||
1201 | def swap(state, oldpos, newpos): |
|
1197 | def swap(state, oldpos, newpos): | |
1202 | """Swap two positions and calculate necessary conflicts in |
|
1198 | """Swap two positions and calculate necessary conflicts in | |
1203 | O(|newpos-oldpos|) time""" |
|
1199 | O(|newpos-oldpos|) time""" | |
@@ -1218,7 +1214,7 b' def swap(state, oldpos, newpos):' | |||||
1218 | rules[oldpos].checkconflicts(rules[r]) |
|
1214 | rules[oldpos].checkconflicts(rules[r]) | |
1219 |
|
1215 | |||
1220 | if state.selected: |
|
1216 | if state.selected: | |
1221 |
makeselection( |
|
1217 | state.make_selection(newpos) | |
1222 |
|
1218 | |||
1223 |
|
1219 | |||
1224 | def changeaction(state, pos, action): |
|
1220 | def changeaction(state, pos, action): | |
@@ -1525,7 +1521,7 b' pgup/K: move patch up, pgdn/J: move patc' | |||||
1525 | cycleaction(self, oldpos, next=False) |
|
1521 | cycleaction(self, oldpos, next=False) | |
1526 | elif action == b'select': |
|
1522 | elif action == b'select': | |
1527 | selected = oldpos if selected is None else None |
|
1523 | selected = oldpos if selected is None else None | |
1528 |
makeselection( |
|
1524 | self.make_selection(selected) | |
1529 | elif action == b'goto' and int(ch) < len(rules) and len(rules) <= 10: |
|
1525 | elif action == b'goto' and int(ch) < len(rules) and len(rules) <= 10: | |
1530 | newrule = next((r for r in rules if r.origpos == int(ch))) |
|
1526 | newrule = next((r for r in rules if r.origpos == int(ch))) | |
1531 | self.move_cursor(oldpos, newrule.pos) |
|
1527 | self.move_cursor(oldpos, newrule.pos) | |
@@ -1590,6 +1586,9 b' pgup/K: move patch up, pgdn/J: move patc' | |||||
1590 | if mode == MODE_PATCH: |
|
1586 | if mode == MODE_PATCH: | |
1591 | self.modes[MODE_PATCH][b'patchcontents'] = self.patch_contents() |
|
1587 | self.modes[MODE_PATCH][b'patchcontents'] = self.patch_contents() | |
1592 |
|
1588 | |||
|
1589 | def make_selection(self, pos): | |||
|
1590 | self.selected = pos | |||
|
1591 | ||||
1593 |
|
1592 | |||
1594 | def _chisteditmain(repo, rules, stdscr): |
|
1593 | def _chisteditmain(repo, rules, stdscr): | |
1595 | try: |
|
1594 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now