Skip to content

Commit

Permalink
Don't animate edited line
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoran committed Dec 7, 2024
1 parent 963f7a4 commit 86d8f62
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ class ChatLinesAdapter @MainThread constructor(
onLinesChanged(Animation.LastLineAdded)
}

@WorkerThread override fun onLineReplaced() {
onLinesChanged(Animation.None, diffLineContents = true)
}

@WorkerThread override fun onTitleChanged() {
onLinesChanged()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ class BufferFragment : Fragment(), BufferEye {
linesAdapter?.onLineAdded()
}

@WorkerThread override fun onLineReplaced() {
linesAdapter?.onLineReplaced()
}

@MainThread override fun onGlobalPreferencesChanged(numberChanged: Boolean) {
linesAdapter?.onGlobalPreferencesChanged(numberChanged)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ class Buffer @WorkerThread constructor(
bufferEyes.forEach { it.onLineAdded() }
}

@WorkerThread fun onLineReplaced() {
bufferEyes.forEach { it.onLineReplaced() }
}

var style = 0

@MainThread fun onGlobalPreferencesChanged(numberChanged: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ interface BufferEye {
// 1 line added on bottom
@WorkerThread fun onLineAdded()

// line was replaced via _buffer_line_data_changed
@WorkerThread fun onLineReplaced()

// indicates changed title
@WorkerThread fun onTitleChanged()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ object BufferList {
val spec = LineSpec(entry)
findByPointer(spec.bufferPointer)?.let { buffer ->
buffer.replaceLine(spec.toLine())
buffer.onLinesListed()
buffer.onLineReplaced()
}
}
}
Expand Down

0 comments on commit 86d8f62

Please sign in to comment.