From 85752e72e877889d9b1832fb12d9904969c382a3 Mon Sep 17 00:00:00 2001 From: Marcel Schramm Date: Fri, 11 Oct 2019 23:06:40 +0200 Subject: [PATCH] Update tview and enable overflow indicators on all containers --- go.mod | 2 +- go.sum | 15 ++------------- ui/channeltree.go | 3 ++- ui/commandview.go | 6 +++--- ui/guildlist.go | 3 ++- ui/privatechats.go | 3 ++- ui/window.go | 1 + 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 6e4f996d..09b6bdf5 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Bios-Marcel/discordgo v0.20.4-0.20191007163810-41c4e4a91fd6 github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d github.com/Bios-Marcel/shortnotforlong v1.0.0 - github.com/Bios-Marcel/tview v0.0.0-20191010190327-42c5245b3d25 + github.com/Bios-Marcel/tview v0.0.0-20191011210517-9ff18389d0f6 github.com/alecthomas/chroma v0.6.6 github.com/atotto/clipboard v0.1.2 github.com/gdamore/tcell v1.3.0 diff --git a/go.sum b/go.sum index b448846e..aadda185 100644 --- a/go.sum +++ b/go.sum @@ -1,23 +1,13 @@ github.com/Bios-Marcel/discordemojimap v0.0.0-20190404160132-506fd0e8d912 h1:QxaGxuQTupp5haCZu+zuQoQ9JbiM13N5UiTSJpsuvh8= github.com/Bios-Marcel/discordemojimap v0.0.0-20190404160132-506fd0e8d912/go.mod h1:D1W9gRQXP1UESEobmNIng2i+E8UvdDF4NJ9EOXn9Ano= -github.com/Bios-Marcel/discordgo v0.20.4-0.20190901100625-c0b4a9b40243 h1:FgFOmhd9id31pa7b4B6fTAqq7IEeNPYMyUw7kZIMl3Y= -github.com/Bios-Marcel/discordgo v0.20.4-0.20190901100625-c0b4a9b40243/go.mod h1:bLnfQU0j/SejmPozgW5GepmKvd8CrbMIml2I0IZENVE= github.com/Bios-Marcel/discordgo v0.20.4-0.20191007163810-41c4e4a91fd6 h1:SKG4DGHPz6ZIWfdnnHB/bto0SyypPhV6OAR8vrVmGeQ= github.com/Bios-Marcel/discordgo v0.20.4-0.20191007163810-41c4e4a91fd6/go.mod h1:bLnfQU0j/SejmPozgW5GepmKvd8CrbMIml2I0IZENVE= github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d h1:vfrX8l3fHuaP7gRgEc7mX/lHVTlfQcQeaIdSPmT6Ej0= github.com/Bios-Marcel/goclipimg v0.0.0-20190417192721-b58a8831f27d/go.mod h1:u7z9t086HoIbA/uuoA2KcRDhKS47DRYCDZ39aegTR4c= github.com/Bios-Marcel/shortnotforlong v1.0.0 h1:K4JJ5U3+D8LXoAiH0QbfMujWuqKo+NAEZKuQ2RHPqqE= github.com/Bios-Marcel/shortnotforlong v1.0.0/go.mod h1:g6bFiwq0pq7pqENRgHiCZu7uMzeYPIXwANlaBQ47LBw= -github.com/Bios-Marcel/tview v0.0.0-20191005105220-888684dabd6b h1:Z4pYp0FKemDptJdB27Xm6kmBPGZezs09ZWlIr6Np3fc= -github.com/Bios-Marcel/tview v0.0.0-20191005105220-888684dabd6b/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= -github.com/Bios-Marcel/tview v0.0.0-20191008165233-c1d70afae712 h1:woFPJ1+2P7cPwDO7ES0WqEZ5Gr7uomx2mX+waHZDFlg= -github.com/Bios-Marcel/tview v0.0.0-20191008165233-c1d70afae712/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= -github.com/Bios-Marcel/tview v0.0.0-20191010184840-e957ee729af5 h1:fpOcmkGt7VZAZM+vLHxEsyoHyMiPHus5gDrJluQdhH8= -github.com/Bios-Marcel/tview v0.0.0-20191010184840-e957ee729af5/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= -github.com/Bios-Marcel/tview v0.0.0-20191010185340-4087ce6a56dd h1:1lP9nen8TalO7/wh4nGsYMK0QtaKRzoJ5I/cfGjDMZM= -github.com/Bios-Marcel/tview v0.0.0-20191010185340-4087ce6a56dd/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= -github.com/Bios-Marcel/tview v0.0.0-20191010190327-42c5245b3d25 h1:6qaZmnHVaTfn3KLpbs1EZxi8ZWPnvyKSVN6m1azdpVg= -github.com/Bios-Marcel/tview v0.0.0-20191010190327-42c5245b3d25/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= +github.com/Bios-Marcel/tview v0.0.0-20191011210517-9ff18389d0f6 h1:MNgdsJiHHU543t+6pp7Qt09jcF2gJq0ZsQA8cKONXYQ= +github.com/Bios-Marcel/tview v0.0.0-20191011210517-9ff18389d0f6/go.mod h1:AtXfMotMUyN+IQ7JwQyvrWr9dQN+TNRlq+slKB0fmQc= github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= @@ -53,7 +43,6 @@ github.com/gen2brain/beeep v0.0.0-20190317152856-aa3d7c1499fd/go.mod h1:GprdPCZg github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4= github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github/v28 v28.1.1 h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo= github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= diff --git a/ui/channeltree.go b/ui/channeltree.go index ef29599b..659d0524 100644 --- a/ui/channeltree.go +++ b/ui/channeltree.go @@ -48,7 +48,8 @@ func NewChannelTree(state *discordgo.State) *ChannelTree { SetVimBindingsEnabled(config.GetConfig().OnTypeInListBehaviour == config.DoNothingOnTypeInList). SetCycleSelection(true). SetTopLevel(1). - SetBorder(true) + SetBorder(true). + SetIndicateOverflow(true) channelTree.SetRoot(tview.NewTreeNode("")) channelTree.SetSelectedFunc(func(node *tview.TreeNode) { diff --git a/ui/commandview.go b/ui/commandview.go index f21d8c42..4a54fed9 100644 --- a/ui/commandview.go +++ b/ui/commandview.go @@ -33,13 +33,13 @@ func NewCommandView(onExecuteCommand func(command string)) *CommandView { SetWordWrap(true). SetWrap(true). SetText("[::b]### Welcome back. ###\n If you need to know more, run the [::b]man[::-] command.\n"). - SetBorder(true) + SetBorder(true). + SetIndicateOverflow(true) commandInput := NewEditor() commandInput.internalTextView. SetWrap(false). - SetWordWrap(false). - SetIndicateOverflow(true) + SetWordWrap(false) cmdView := &CommandView{ commandOutput: commandOutput, diff --git a/ui/guildlist.go b/ui/guildlist.go index 1e44dbe3..41215871 100644 --- a/ui/guildlist.go +++ b/ui/guildlist.go @@ -23,7 +23,8 @@ func NewGuildList(guilds []*discordgo.Guild, window *Window) *GuildList { SetVimBindingsEnabled(config.GetConfig().OnTypeInListBehaviour == config.DoNothingOnTypeInList). SetCycleSelection(true). SetTopLevel(1). - SetBorder(true) + SetBorder(true). + SetIndicateOverflow(true) root := tview.NewTreeNode("") guildList.SetRoot(root) diff --git a/ui/privatechats.go b/ui/privatechats.go index e57f1375..37d5c18f 100644 --- a/ui/privatechats.go +++ b/ui/privatechats.go @@ -53,7 +53,8 @@ func NewPrivateChatList(state *discordgo.State) *PrivateChatList { SetTopLevel(1). SetCycleSelection(true). SetSelectedFunc(privateList.onNodeSelected). - SetBorder(true) + SetBorder(true). + SetIndicateOverflow(true) privateList.internalTreeView.GetRoot().AddChild(privateList.chatsNode) diff --git a/ui/window.go b/ui/window.go index 261f9f29..4711ea03 100644 --- a/ui/window.go +++ b/ui/window.go @@ -335,6 +335,7 @@ func NewWindow(doRestart chan bool, app *tview.Application, session *discordgo.S window.messageContainer = window.chatView.GetPrimitive() window.messageInput = NewEditor() + window.messageInput.internalTextView.SetIndicateOverflow(true) window.messageInput.SetOnHeightChangeRequest(func(height int) { window.chatArea.ResizeItem(window.messageInput.GetPrimitive(), maths.Min(height, 20), 0) })