Relocate global variable declarations
This commit is contained in:
parent
1aefedfaec
commit
8ea53c88a5
4 changed files with 15 additions and 13 deletions
|
|
@ -11,8 +11,6 @@ const userAgent = "" +
|
|||
"AppleWebKit/537.36 (KHTML, like Gecko) " +
|
||||
"Chrome/92.0.4515.131 Safari/537.36"
|
||||
|
||||
var conf *config
|
||||
|
||||
type keybindingsChannelsTree struct {
|
||||
Focus string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,6 @@ import (
|
|||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
var (
|
||||
session *discordgo.Session
|
||||
selectedChannel *discordgo.Channel
|
||||
selectedMessage int
|
||||
)
|
||||
var (
|
||||
boldRegex = regexp.MustCompile(`(?m)\*\*(.*?)\*\*`)
|
||||
italicRegex = regexp.MustCompile(`(?m)\*(.*?)\*`)
|
||||
|
|
|
|||
13
main.go
13
main.go
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/ayntgl/discordgo"
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
"github.com/zalando/go-keyring"
|
||||
|
|
@ -8,6 +9,18 @@ import (
|
|||
|
||||
const service = "discordo"
|
||||
|
||||
var (
|
||||
app *tview.Application
|
||||
loginForm *tview.Form
|
||||
channelsTree *tview.TreeView
|
||||
messagesView *tview.TextView
|
||||
messageInputField *tview.InputField
|
||||
mainFlex *tview.Flex
|
||||
|
||||
conf *config
|
||||
session *discordgo.Session
|
||||
)
|
||||
|
||||
func main() {
|
||||
conf = loadConfig()
|
||||
|
||||
|
|
|
|||
8
ui.go
8
ui.go
|
|
@ -10,12 +10,8 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
app *tview.Application
|
||||
loginForm *tview.Form
|
||||
channelsTree *tview.TreeView
|
||||
messagesView *tview.TextView
|
||||
messageInputField *tview.InputField
|
||||
mainFlex *tview.Flex
|
||||
selectedChannel *discordgo.Channel
|
||||
selectedMessage int
|
||||
)
|
||||
|
||||
func newApp() *tview.Application {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue