Repository: napari/napari

Issue:
Adding points after select (?) doesn't work
I get the following error after loading an image, adding a points layer, selecting select mode by tapping "s", then selecting add mode by tapping "a" (the add mode does not get enabled):

```pytb
 $ python examples/add_image.py 
/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/visuals/markers.py:564: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  ('a_edgewidth', np.float32, 1)])
/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/visuals/markers.py:564: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  ('a_edgewidth', np.float32, 1)])
WARNING: Traceback (most recent call last):
  File "examples/add_image.py", line 44, in <module>
    layer.interpolation = 'nearest'
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/home/jni/projects/napari/napari/_qt/event_loop.py", line 31, in gui_qt
    app.exec_()
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/app/backends/_qt.py", line 501, in event
    out = super(QtBaseCanvasBackend, self).event(ev)
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/app/backends/_qt.py", line 495, in keyPressEvent
    self._keyEvent(self._vispy_canvas.events.key_press, ev)
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/app/backends/_qt.py", line 544, in _keyEvent
    func(native=ev, key=key, text=text_type(ev.text()), modifiers=mod)
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/util/event.py", line 475, in _invoke_callback
    self, cb_event=(cb, event))
  << caught exception here: >>
  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 236, in on_key_press
    layer.on_key_press(event)
  File "/home/jni/projects/napari/napari/layers/points/points.py", line 968, in on_key_press
    list(range(len(self._data_view)))
TypeError: list indices must be integers or slices, not list
ERROR: Invoking <bound method QtViewer.on_key_press of <napari._qt.qt_viewer.QtViewer object at 0x7fc1c12c1798>> for KeyEvent
```



Discussion:

Resolving patch:
diff --git a/napari/layers/points/points.py b/napari/layers/points/points.py
--- a/napari/layers/points/points.py
+++ b/napari/layers/points/points.py
@@ -965,7 +965,7 @@ def on_key_press(self, event):
             elif event.key == 'a':
                 if self._mode == Mode.SELECT:
                     self.selected_data = self._indices_view[
-                        list(range(len(self._data_view)))
+                        : len(self._data_view)
                     ]
                     self._set_highlight()
             elif event.key == 'Backspace':


Test patch: