diff options
Diffstat (limited to 'view-main.go')
-rw-r--r-- | view-main.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/view-main.go b/view-main.go index acd9576..5a3a70c 100644 --- a/view-main.go +++ b/view-main.go @@ -65,11 +65,14 @@ func (ui *GomuksUI) NewMainView() tview.Primitive { mainView.roomList. ShowSecondaryText(false). + SetSelectedBackgroundColor(tcell.ColorDarkGreen). + SetSelectedTextColor(tcell.ColorWhite). SetBorderPadding(0, 0, 1, 0) mainView.input. SetDoneFunc(mainView.InputDone). SetChangedFunc(mainView.InputChanged). + SetTabCompleteFunc(mainView.InputTabComplete). SetFieldBackgroundColor(tcell.ColorDefault). SetPlaceholder("Send a message..."). SetPlaceholderExtColor(tcell.ColorGray). @@ -93,6 +96,13 @@ func (view *MainView) InputChanged(text string) { } } +func (view *MainView) InputTabComplete(text string, cursorOffset int) { + roomView, _ := view.rooms[view.CurrentRoomID()] + if roomView != nil { + // text[0:cursorOffset] + } +} + func (view *MainView) InputDone(key tcell.Key) { if key == tcell.KeyEnter { room, text := view.CurrentRoomID(), view.input.GetText() @@ -128,7 +138,7 @@ func (view *MainView) HandleCommand(room, command string, args []string) { view.matrix.client.LeaveRoom(room) case "/join": if len(args) == 0 { - view.AddMessage(room, "Usage: /join <room>") + view.AddMessage(room, "Usage: /join <room>") break } view.debug.Print(view.matrix.JoinRoom(args[0])) @@ -207,7 +217,7 @@ func (view *MainView) AddRoom(room string) { return } view.roomIDs = append(view.roomIDs, room) - view.addRoom(len(view.roomIDs) - 1, room) + view.addRoom(len(view.roomIDs)-1, room) } func (view *MainView) RemoveRoom(room string) { |