def edit.put

ezx@1.11.0.0 · src/ws/moved.bend:297

import ezx@1.11.0.0/src/ws/moved.bend as Moved
import Base
import ezx@1.11.0.0/src/lock/plan.bend as LP

297# a rewritten file written, when the rewrite changed it and it is not the lock
298def edit.put(changed: Bool, +at: String, text: String, +rest: List<&2, LP.Effect>) -> List<&2, LP.Effect>:
299  match changed:
300    case True{}:
301      Bool.pick(List<&2, LP.Effect>, String.eq(at, LP.lockfile()), rest, LP.Write{at, text} <> rest)
302    case False{}:
303      rest

Uses (7)

Used by (1)