normalize tabs when not lisp

This commit is contained in:
David Botton 2024-07-04 18:59:01 -04:00
parent 4523916e74
commit f110cdf1e4
3 changed files with 260 additions and 255 deletions

View file

@ -85,6 +85,7 @@
(clog-ace::js-ace editor) (clog-ace::js-ace editor)
(jquery editor))) (jquery editor)))
;; setup adjust tab key ;; setup adjust tab key
(when (current-editor-is-lisp app)
(js-execute editor (js-execute editor
(format nil (format nil
"~A.commands.addCommand({ "~A.commands.addCommand({
@ -119,7 +120,7 @@
(if *editor-use-tab-as-tabbify* (if *editor-use-tab-as-tabbify*
"Ctrl-t|Tab" "Ctrl-t|Tab"
"Ctrl-t") "Ctrl-t")
(jquery editor))) (jquery editor))))
(set-on-event-with-data editor "clog-adjust-tabs" (set-on-event-with-data editor "clog-adjust-tabs"
(lambda (obj data) (lambda (obj data)
(declare (ignore obj)) (declare (ignore obj))

View file

@ -70,6 +70,7 @@
lisp-package lisp-package
regex regex
show-find show-find
force-mode
is-console is-console
left top left top
(editor-use-console-for-evals *editor-use-console-for-evals*) (editor-use-console-for-evals *editor-use-console-for-evals*)
@ -262,11 +263,6 @@
(clog-ace:resize ace) (clog-ace:resize ace)
(set-geometry status :units "" :width "" :height "20px" (set-geometry status :units "" :width "" :height "20px"
:bottom "0px" :left "0px" :right "0px") :bottom "0px" :left "0px" :right "0px")
(setup-lisp-ace ace status)
(when is-console
(setf (clog-ace:mode ace) "ace/mode/plain_text")
(clog-ace:set-auto-completion ace nil)
(set-on-change ace nil))
(labels ((on-help (obj) (labels ((on-help (obj)
(declare (ignore obj)) (declare (ignore obj))
(alert-dialog win (alert-dialog win
@ -331,6 +327,14 @@
(not (equalp open-file " ")) (not (equalp open-file " "))
(not (equalp open-file ""))) (not (equalp open-file "")))
(open-file-name open-file)) (open-file-name open-file))
(when force-mode
(setf (clog-ace:mode ace) force-mode)
(setf (current-editor-is-lisp app) nil))
(setup-lisp-ace ace status)
(when is-console
(setf (clog-ace:mode ace) "ace/mode/plain_text")
(clog-ace:set-auto-completion ace nil)
(set-on-change ace nil))
(when regex (when regex
(focus ace) (focus ace)
(js-execute obj (format nil "~A.find('~A',{caseSensitive:false,regExp:true})" (js-execute obj (format nil "~A.find('~A',{caseSensitive:false,regExp:true})"

View file

@ -1023,9 +1023,9 @@ not a temporarily attached one when using select-control."
(get-control-list app panel-id)) (get-control-list app panel-id))
result))) result)))
(set-on-click m-html (lambda (obj) (set-on-click m-html (lambda (obj)
(on-open-file obj :text (render-html)))) (on-open-file obj :force-mode "ace/mode/html" :text (render-html))))
(set-on-click m-htmlq (lambda (obj) (set-on-click m-htmlq (lambda (obj)
(on-open-file obj :text (on-open-file obj :force-mode "ace/mode/html" :text
(ppcre:regex-replace-all "\"" (ppcre:regex-replace-all "\""
(render-html) (render-html)
"\\\""))))) "\\\"")))))