Skip to main content

kill-at-pos

function

rewrite-clj.paredit/kill-at-pos

(kill-at-pos [zloc pos])
Return `zloc` with found item starting at `pos` removed to its natural end. If `pos` is: - inside a string, removes all characters in string starting at `pos` to the end of the string - is inside a comment, removes all characters in comment starting at `pos` to the end of line (not including comment linebreak, if present) - otherwise, executes [[kill]] at node found from `pos` `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). - `[:foo "Hello |World"]` => [:foo |"Hello "]` - `42 ;; A comment| of some length => 42 |;; A comment` - `[:foo |"Hello World"] => [|:foo ]`

No examples yet. Be the first to add one!