From 97c735f82885ac0ce2e7dbc3725e46f84ecd1235 Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Fri, 26 Jan 2018 12:07:14 +0100 Subject: [PATCH 1/5] Reset offset when sending message Fixes #73 --- components/input.go | 1 + 1 file changed, 1 insertion(+) diff --git a/components/input.go b/components/input.go index 141e223..dcab2f1 100644 --- a/components/input.go +++ b/components/input.go @@ -194,6 +194,7 @@ func (i *Input) Clear() { i.Par.Text = "" i.CursorPositionScreen = 0 i.CursorPositionText = 0 + i.Offset = 0 } // GetText returns the text currently in the input From 43a91fafec3be5949b0faaf650426141650594a7 Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Fri, 26 Jan 2018 12:58:31 +0100 Subject: [PATCH 2/5] Clear notification when sending message on channel Fixes #74 --- handlers/event.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handlers/event.go b/handlers/event.go index b100639..6df9020 100644 --- a/handlers/event.go +++ b/handlers/event.go @@ -214,10 +214,16 @@ func actionSend(ctx *context.AppContext) { ctx.View.Input.Clear() ctx.View.Refresh() + // Send message ctx.Service.SendMessage( ctx.View.Channels.SelectedChannel, message, ) + + // Clear notification icon if there is any + ctx.Service.MarkAsRead(ctx.View.Channels.SelectedChannel) + ctx.View.Channels.SetChannels(ctx.Service.ChannelsToString()) + termui.Render(ctx.View.Channels) } } From b6b1b799f2f05fbfea0cc0755f77f76e20f01f50 Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Sat, 27 Jan 2018 09:35:00 +0100 Subject: [PATCH 3/5] Update version number --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 074d10d..8077e97 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ import ( ) const ( - VERSION = "v0.3.0" + VERSION = "v0.3.1" USAGE = `NAME: slack-term - slack client for your terminal From 2b86b6f9fd948392aa367f2ccea9763af34897c7 Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Sat, 27 Jan 2018 09:54:40 +0100 Subject: [PATCH 4/5] Fix GetText to return actual text not representation Fixes #81 --- components/input.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/input.go b/components/input.go index dcab2f1..1a9a493 100644 --- a/components/input.go +++ b/components/input.go @@ -199,7 +199,7 @@ func (i *Input) Clear() { // GetText returns the text currently in the input func (i *Input) GetText() string { - return i.Par.Text + return string(i.Text) } // GetMaxWidth returns the maximum number of positions From b234e63ebf277aca4dbf76d3467acd67721f48bf Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Sat, 27 Jan 2018 12:03:10 +0100 Subject: [PATCH 5/5] Fix vertical resizing Fixes #78 --- handlers/event.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handlers/event.go b/handlers/event.go index 6df9020..556c46b 100644 --- a/handlers/event.go +++ b/handlers/event.go @@ -163,6 +163,12 @@ func actionKeyEvent(ctx *context.AppContext, ev termbox.Event) { func actionResizeEvent(ctx *context.AppContext, ev termbox.Event) { termui.Body.Width = termui.TermWidth() + + // Vertical resize components + ctx.View.Channels.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height + ctx.View.Chat.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height + ctx.View.Debug.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height + termui.Body.Align() termui.Render(termui.Body) }