Skip to main content

kill-one-at-pos

function

rewrite-clj.paredit/kill-one-at-pos

(kill-one-at-pos [zloc pos])
Return `zloc` with node/word found at `pos` removed. If `pos` is: - inside a string or comment, removes word at `pos`, if at whitespace, no-op. - otherwise removes node and moves left, or if no left node removes via [[rewrite-clj.zip/remove]]. If `pos` locates to whitespace between nodes, skips right to find node. `zloc` location is (inclusive) starting point for `pos` search `pos` can be a `{:row :col}` map or a `[row col]` vector. The `row` and `col` values are 1-based and relative to the start of the source code the zipper represents. Throws if `zloc` was not created with [position tracking](/doc/01-user-guide.adoc#position-tracking). - `(+ |100 200) => (|+ 200)` - `(foo |(bar do)) => (foo)` - `[|10 20 30]` => |[20 30]` - `"|hello world" => "| world"` - `; |hello world => ; |world`

No examples yet. Be the first to add one!