Skip to content

Commit d28a62c

Browse files
committed
fixed inplace modifications of arrays in the console (via setitem) not updating the view (closes #94)
1 parent 10436a5 commit d28a62c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

larray_editor/editor.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,12 @@ def update_title(self):
503503
self.setWindowTitle(' - '.join(title))
504504

505505
def set_current_array(self, array, name):
506-
if array is not self.current_array:
507-
self.current_array = array
508-
self.arraywidget.set_data(array)
509-
self.current_array_name = name
510-
self.update_title()
506+
# we should NOT check that "array is not self.current_array" because this method is also called to
507+
# refresh the widget value because of an inplace setitem
508+
self.current_array = array
509+
self.arraywidget.set_data(array)
510+
self.current_array_name = name
511+
self.update_title()
511512

512513
def _add_arrays(self, arrays):
513514
for k, v in arrays.items():

0 commit comments

Comments
 (0)