From bc0813b8c7f070743a008003ceb05f0b3d306d7c Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 10 May 2019 08:47:31 -0700 Subject: [PATCH 1/4] Add Windows build support in goreleaser config --- .goreleaser.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index ba068113..28c8c267 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,6 +7,7 @@ builds: goos: - darwin - linux + - windows goarch: - 386 - amd64 From 0d2667685e1ae9d64c21b7234087e3d095854005 Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Fri, 10 May 2019 18:46:31 -0400 Subject: [PATCH 2/4] Add stable sort for focusable windows Addresses #435 --- wtf/focus_tracker.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wtf/focus_tracker.go b/wtf/focus_tracker.go index 002c5e10..de935c96 100644 --- a/wtf/focus_tracker.go +++ b/wtf/focus_tracker.go @@ -1,6 +1,8 @@ package wtf import ( + "sort" + "github.com/olebedev/config" "github.com/rivo/tview" ) @@ -177,6 +179,17 @@ func (tracker *FocusTracker) focusables() []Wtfable { } } + // Sort for deterministic ordering + sort.SliceStable(focusable[:], func(i, j int) bool { + if focusable[i].Top() < focusable[j].Top() { + return true + } + if focusable[i].Top() == focusable[j].Top() { + return focusable[i].Left() < focusable[j].Left() + } + return false + }) + return focusable } From 7be64c0558472577ba3277b316f7b6306adc1a45 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 10 May 2019 23:12:10 -0700 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94310733..a514b24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ ### ⚡️ Added -* DataDog module is now scrollable and interactive, by [@Seanstoppable](https://github.com/Seanstoppable) +* DataDog module is now scrollable and interactive, by @Seanstoppable +* Focusable hot key numbers are now assigned in a stable order, [#435](https://github.com/wtfutil/wtf/issues/435) by @Seanstoppable ## v0.9.2 From d1670413cc361f8e040bff04eacb806fe1bf2011 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 10 May 2019 23:12:35 -0700 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a514b24a..def47a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ ### ⚡️ Added -* DataDog module is now scrollable and interactive, by @Seanstoppable -* Focusable hot key numbers are now assigned in a stable order, [#435](https://github.com/wtfutil/wtf/issues/435) by @Seanstoppable +* DataDog module is now scrollable and interactive, by [@Seanstoppable](https://github.com/Seanstoppable) +* Focusable hot key numbers are now assigned in a stable order, [#435](https://github.com/wtfutil/wtf/issues/435) by [@Seanstoppable](https://github.com/Seanstoppable) ## v0.9.2