mirror of
https://github.com/junegunn/fzf.git
synced 2026-09-02 04:47:03 +08:00
Rename ChunkList.Retransform to ForEachItem
This commit is contained in:
+2
-2
@@ -99,9 +99,9 @@ func (cl *ChunkList) Clear() {
|
|||||||
cl.mutex.Unlock()
|
cl.mutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retransform iterates all items and applies fn to each one.
|
// ForEachItem iterates all items and applies fn to each one.
|
||||||
// The done callback runs under the lock to safely update shared state.
|
// The done callback runs under the lock to safely update shared state.
|
||||||
func (cl *ChunkList) Retransform(fn func(*Item), done func()) {
|
func (cl *ChunkList) ForEachItem(fn func(*Item), done func()) {
|
||||||
cl.mutex.Lock()
|
cl.mutex.Lock()
|
||||||
for _, chunk := range cl.chunks {
|
for _, chunk := range cl.chunks {
|
||||||
for i := 0; i < chunk.count; i++ {
|
for i := 0; i < chunk.count; i++ {
|
||||||
|
|||||||
+1
-1
@@ -463,7 +463,7 @@ func Run(opts *Options) (int, error) {
|
|||||||
// Reset cross-line ANSI state before re-processing all items
|
// Reset cross-line ANSI state before re-processing all items
|
||||||
lineAnsiState = nil
|
lineAnsiState = nil
|
||||||
prevLineAnsiState = nil
|
prevLineAnsiState = nil
|
||||||
chunkList.Retransform(func(item *Item) {
|
chunkList.ForEachItem(func(item *Item) {
|
||||||
origBytes := *item.origText
|
origBytes := *item.origText
|
||||||
savedIndex := item.Index()
|
savedIndex := item.Index()
|
||||||
if newTransformer != nil {
|
if newTransformer != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user