Virgil Dupras avatar Virgil Dupras committed 5123dc3

Only save/restore visibility for optional columns rather than all columns.

Comments (0)

Files changed (1)

                 self.view.restore_columns()
             return
         for col in self.column_list:
-            pref_name = '{0}.Columns.{1}'.format(self.savename, col.name)
+            pref_name = '{}.Columns.{}'.format(self.savename, col.name)
             coldata = self.prefaccess.get_default(pref_name, fallback_value={})
             if 'index' in coldata:
                 col.ordered_index = coldata['index']
             if 'width' in coldata:
                 col.width = coldata['width']
-            if 'visible' in coldata:
+            if col.optional and 'visible' in coldata:
                 col.visible = coldata['visible']
         self.view.restore_columns()
     
         if not (self.prefaccess and self.savename and self.coldata):
             return
         for col in self.column_list:
-            pref_name = '{0}.Columns.{1}'.format(self.savename, col.name)
-            coldata = {'index': col.ordered_index, 'width': col.width, 'visible': col.visible}
+            pref_name = '{}.Columns.{}'.format(self.savename, col.name)
+            coldata = {'index': col.ordered_index, 'width': col.width}
+            if col.optional:
+                coldata['visible'] = col.visible
             self.prefaccess.set_default(pref_name, coldata)
     
     def set_column_order(self, colnames):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.