Skip to content

Commit

Permalink
add formatting by Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
migraine-user committed Jun 29, 2024
1 parent c34250a commit a50fa9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/app/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#js [(cm-clj/syntax live-grammar/parser)
(.slice editor-extensions-to-load 1)]
editor-extensions-to-load))
;; enable formatting by Tab key
(.of view/keymap (.filter cm-clj/complete-keymap #(= "Tab" (aget % "key"))))
#_(.of view/keymap cm-clj/complete-keymap)
#_(.of view/keymap historyKeymap)])))

Expand Down
4 changes: 2 additions & 2 deletions src/app/problem.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@
(reset! editor-extension-mode extension-mode))]]
[:p {:style {:margin-top "1rem"}}
[:small
"Alt+Enter will eval the local form in the editor box above. There are
"Alt+Enter will eval the local form in the editor box above, and Tab will format the code. There are
lots of nifty such features and keybindings. More docs coming soon! (Try
playing with alt + arrows / ctrl + enter) in the meanwhile.
playing with alt + arrows / ctrl + enter / tab) in the meanwhile.
For documentation try e.g. (doc map)."]]
[modal/box {:is-open success-modal-is-open
:on-close success-modal-on-close}
Expand Down

0 comments on commit a50fa9d

Please sign in to comment.