You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IndexError when a selected line has fewer columns than the sort column #2
Claude reports: sorting fails with an IndexError when any selected line has fewer columns than the column picked, and the selection is left unchanged.
Tested on Sublime Text 4 build 4215 (Windows) with Column Sort 2.0.0 from Package Control. Selected these lines (tab separated):
name qty
pear 3
apple 10
fig
cherry 7
then ran column_pick and chose qty. The console printed:
File ".../ColumnSort.py", line 23, in run
rows_cols_tail.sort(key=lambda col:col[col_num], reverse=ascending)
IndexError: list index out of range
Fix, tested here (loose copy of ColumnSort.py): change the key to key=lambda col:col[col_num] if col_num < len(col) else "". The same selection then sorts to name qty, fig, apple 10, pear 3, cherry 7: the header stays first and the short row sorts as an empty value.
Activity