robmcmullen / omnivore

Hex editor and debugging emulator, sponsored by the Player/Missile Podcast
Mozilla Public License 2.0
53 stars 7 forks source link

IndexError trying to copy #100

Closed robmcmullen closed 7 years ago

robmcmullen commented 7 years ago

Selection in a segment, switch to another segment that doesn't contain any of the selected bytes, and try Copy:

Traceback (most recent call last):
  File "/noaa/maproom-deps/omnivore/pyface/ui/wx/action/action_item.py", line 277, in _on_menu
    self.controller.perform(action, action_event)
  File "/noaa/maproom-deps/omnivore/pyface/tasks/action/task_action_controller.py", line 31, in perform
    return action.perform(event)
  File "/noaa/maproom-deps/omnivore/omnivore/framework/actions.py", line 287, in perform
    self.active_editor.copy()
  File "/noaa/maproom-deps/omnivore/omnivore/framework/editor.py", line 398, in copy
    data_obj = self.create_clipboard_data_object()
  File "/noaa/maproom-deps/omnivore/omnivore/tasks/hex_edit/hex_editor.py", line 255, in create_clipboard_data_object
    ranges, indexes = self.get_selected_ranges_and_indexes()
  File "/noaa/maproom-deps/omnivore/omnivore/framework/editor.py", line 550, in get_selected_ranges_and_indexes
    return opt, ranges_to_indexes(opt)
  File "/noaa/maproom-deps/omnivore/omnivore/utils/sortutil.py", line 97, in ranges_to_indexes
    return np.hstack((np.arange(r[0], r[1], dtype=np.uint32) for r in ranges))
  File "/noaa/virtualenv/wx3/lib/python2.7/site-packages/numpy/core/shape_base.py", line 277, in hstack
    if arrs[0].ndim == 1:
IndexError: list index out of range
robmcmullen commented 7 years ago

Also occurs when trying to paste before anything is selected.