Skip to content

Commit

Permalink
Preparing the 1.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mogenslund committed Feb 23, 2019
1 parent a8b5e74 commit b5eac83
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject mogenslund/liquid "1.0.2-SNAPSHOT" ;"0.4.6-SNAPSHOT"
(defproject mogenslund/liquid "1.1.0" ;"0.4.6-SNAPSHOT"
:description "This project is an attempt to create a text editor for editing
Clojure files and Markdown files. It operates primarily in a
terminal, but with dynamics and extensibilities inspired by
Expand Down
16 changes: 16 additions & 0 deletions src/dk/salza/liq/keymappings/normal.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
(dotimes [n (max @motion-repeat 1)] (fun))
(reset-motion-repeat)))

(defn wrap-selection [sl p1 p2]
(let [m1 (get-mark sl "selection")
m2 (get-point sl)]
(if m1
(-> sl
(remove-mark "selection")
(set-point (max m1 m2))
(insert p2)
(set-point (min m1 m2))
(insert p1)
(set-point m2))
sl)))

(def keymapping ; basic-mappings
{:id "dk.salza.liq.keymappings.normal"
:after-hook (fn [k] (when (not (re-find #"\d" k)) (reset-motion-repeat)))
Expand All @@ -39,6 +52,9 @@
"M" editor/prompt-to-tmp
" " (motion-repeat-fun editor/forward-page)
":" #(do (editor/request-fullupdate) (commandapp/run ":i :"))
"(" #(wrap-selection % "(" ")") ;)
"[" #(wrap-selection % "[" "]")
"{" #(wrap-selection % "{" "}")
"right" (motion-repeat-fun editor/forward-char)
"left" (motion-repeat-fun editor/backward-char)
"up" (motion-repeat-fun editor/backward-line)
Expand Down

0 comments on commit b5eac83

Please sign in to comment.