Skip to content

Commit

Permalink
More work on fixing constraint logic
Browse files Browse the repository at this point in the history
It is a mess I will clean it up eventually
  • Loading branch information
imayhaveborkedit committed Sep 8, 2017
1 parent 286f142 commit aa384f5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,17 @@ def _process_event_before(self, event):
full_state.update(state=self.RANGE_SELECTED, low=low, high=high)

def _process_event_after(self, event):
event.cli.ui.print(f"Acting on buffer {event.cli.current_buffer_name}")
last_buffer_name = event.previous_buffer.text.split(':')[0]
key = event.key_sequence[0].key.name # non-character keys are key objects in events
last_cursor_pos = event.previous_buffer.cursor_position - 17

full_state = self._state[last_buffer_name]
state = full_state['state']

if key in (Keys.Up.name, Keys.Down.name):
if state == self.RANGE_SELECTED_PENDING:
full_state.update(state=self.SINGLE_SELECTED)



class StatConstraint:
Expand Down

0 comments on commit aa384f5

Please sign in to comment.