Chore: newline count
This commit is contained in:
32
tui.go
32
tui.go
@@ -20,21 +20,21 @@ import (
|
|||||||
var _ = sync.RWMutex{}
|
var _ = sync.RWMutex{}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
app *tview.Application
|
app *tview.Application
|
||||||
pages *tview.Pages
|
pages *tview.Pages
|
||||||
textArea *tview.TextArea
|
textArea *tview.TextArea
|
||||||
editArea *tview.TextArea
|
editArea *tview.TextArea
|
||||||
textView *tview.TextView
|
textView *tview.TextView
|
||||||
statusLineWidget *tview.TextView
|
statusLineWidget *tview.TextView
|
||||||
helpView *tview.TextView
|
helpView *tview.TextView
|
||||||
flex *tview.Flex
|
flex *tview.Flex
|
||||||
imgView *tview.Image
|
imgView *tview.Image
|
||||||
defaultImage = "sysprompts/llama.png"
|
defaultImage = "sysprompts/llama.png"
|
||||||
indexPickWindow *tview.InputField
|
indexPickWindow *tview.InputField
|
||||||
renameWindow *tview.InputField
|
renameWindow *tview.InputField
|
||||||
roleEditWindow *tview.InputField
|
roleEditWindow *tview.InputField
|
||||||
fullscreenMode bool
|
fullscreenMode bool
|
||||||
positionVisible bool = true
|
positionVisible bool = true
|
||||||
scrollToEndEnabled bool = true
|
scrollToEndEnabled bool = true
|
||||||
// pages
|
// pages
|
||||||
historyPage = "historyPage"
|
historyPage = "historyPage"
|
||||||
@@ -1293,6 +1293,8 @@ func init() {
|
|||||||
// newline is not needed is prev msg ends with one
|
// newline is not needed is prev msg ends with one
|
||||||
if strings.HasSuffix(prevText, nl) {
|
if strings.HasSuffix(prevText, nl) {
|
||||||
nl = ""
|
nl = ""
|
||||||
|
} else if strings.HasSuffix(prevText, "\n") {
|
||||||
|
nl = "\n" // only one newline, add another
|
||||||
}
|
}
|
||||||
if msgText != "" {
|
if msgText != "" {
|
||||||
// as what char user sends msg?
|
// as what char user sends msg?
|
||||||
|
|||||||
Reference in New Issue
Block a user