mirror of
https://github.com/Kyren223/eko.git
synced 2025-09-05 21:18:14 +00:00
Fixed wrapping issues of placeholder in viminput and also re-phrased
some things
This commit is contained in:
@@ -51,13 +51,13 @@ var (
|
||||
Foreground(colors.LightGray).Padding(0, PaddingCount, 1).
|
||||
AlignHorizontal(lipgloss.Center).AlignVertical(lipgloss.Bottom).
|
||||
SetString("This frequency has no messages, start transmiting!")
|
||||
NoAccess = NoMessages.SetString("You do not have permissions to see messages in this frequency")
|
||||
NoAccess = NoMessages.SetString("You do not have permission to see messages in this frequency")
|
||||
|
||||
SelectedGap = lipgloss.NewStyle().Background(colors.BackgroundDim)
|
||||
|
||||
SendMessagePlaceholder = "Send a message..."
|
||||
ReadOnlyPlaceholder = "You do not have permissions to send messages in this frequency"
|
||||
MutedPlaceholder = "You have been muted by a server adminstrator"
|
||||
ReadOnlyPlaceholder = "You do not have permission to send messages in this frequency"
|
||||
MutedPlaceholder = "You have been muted by a network adminstrator"
|
||||
|
||||
EditedIndicator = lipgloss.NewStyle().
|
||||
Foreground(colors.LightGray).SetString(" (edited)").String()
|
||||
|
@@ -116,6 +116,8 @@ func (m Model) View() string {
|
||||
cursorStyle = InactiveCursorStyle
|
||||
}
|
||||
|
||||
m.PlaceholderStyle = m.PlaceholderStyle.Width(m.width)
|
||||
|
||||
var builder strings.Builder
|
||||
switch m.mode {
|
||||
case NormalMode, InsertMode, OpendingMode:
|
||||
@@ -125,9 +127,11 @@ func (m Model) View() string {
|
||||
}
|
||||
|
||||
if len(m.lines) == 1 && len(line) == 0 && m.Placeholder != "" {
|
||||
cursorChar := m.PlaceholderStyle.Render(m.Placeholder[0:1])
|
||||
cursorChar := cursorStyle.
|
||||
Foreground(m.PlaceholderStyle.GetForeground()).
|
||||
Render(m.Placeholder[0:1])
|
||||
rest := m.PlaceholderStyle.Render(m.Placeholder[1:])
|
||||
builder.WriteString(cursorStyle.Render(cursorChar))
|
||||
builder.WriteString(cursorChar)
|
||||
builder.WriteString(rest)
|
||||
builder.WriteByte('\n')
|
||||
continue
|
||||
@@ -155,9 +159,11 @@ func (m Model) View() string {
|
||||
}
|
||||
|
||||
if len(m.lines) == 1 && len(line) == 0 && m.Placeholder != "" {
|
||||
cursorChar := m.PlaceholderStyle.Render(m.Placeholder[0:1])
|
||||
cursorChar := cursorStyle.
|
||||
Foreground(m.PlaceholderStyle.GetForeground()).
|
||||
Render(m.Placeholder[0:1])
|
||||
rest := m.PlaceholderStyle.Render(m.Placeholder[1:])
|
||||
builder.WriteString(cursorStyle.Render(cursorChar))
|
||||
builder.WriteString(cursorChar)
|
||||
builder.WriteString(rest)
|
||||
builder.WriteByte('\n')
|
||||
continue
|
||||
@@ -261,9 +267,11 @@ func (m Model) View() string {
|
||||
}
|
||||
|
||||
if len(m.lines) == 1 && len(line) == 0 && m.Placeholder != "" {
|
||||
cursorChar := m.PlaceholderStyle.Render(m.Placeholder[0:1])
|
||||
cursorChar := cursorStyle.
|
||||
Foreground(m.PlaceholderStyle.GetForeground()).
|
||||
Render(m.Placeholder[0:1])
|
||||
rest := m.PlaceholderStyle.Render(m.Placeholder[1:])
|
||||
builder.WriteString(cursorStyle.Render(cursorChar))
|
||||
builder.WriteString(cursorChar)
|
||||
builder.WriteString(rest)
|
||||
builder.WriteByte('\n')
|
||||
continue
|
||||
|
Reference in New Issue
Block a user