Skip to content

Commit

Permalink
Sort by view default only if sort not currently set (#1962)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkniko authored Mar 16, 2023
1 parent 6b93085 commit ab9f960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ui/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (t *Table) doUpdate(data *render.TableData) {
custData := data.Customize(cols, t.wide)
if t.viewSetting != nil && t.viewSetting.SortColumn != "" {
tokens := strings.Split(t.viewSetting.SortColumn, ":")
if custData.Header.IndexOf(tokens[0], false) >= 0 {
if custData.Header.IndexOf(tokens[0], false) >= 0 && custData.Header.IndexOf(t.sortCol.name, false) < 0 {
t.sortCol.name, t.sortCol.asc = tokens[0], true
if len(tokens) == 2 && tokens[1] == "desc" {
t.sortCol.asc = false
Expand Down

0 comments on commit ab9f960

Please sign in to comment.