Преглед на файлове

fix: do not scroll to end if any message is selected (#90)

ayntgl преди 4 години
родител
ревизия
0dbc7d3fd5
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      discord.go

+ 4 - 2
discord.go

@@ -103,8 +103,10 @@ func onSessionMessageCreate(_ *discordgo.Session, m *discordgo.MessageCreate) {
 	} else {
 		selectedChannel.Messages = append(selectedChannel.Messages, m.Message)
 		messagesView.Write(buildMessage(m.Message))
-		// Scroll to the end of the text after the message has been written to the TextView.
-		messagesView.ScrollToEnd()
+		// Scroll to the end of the text if any message is selected.
+		if len(messagesView.GetHighlights()) != 0 {
+			messagesView.ScrollToEnd()
+		}
 	}
 }