Skip to content

Commit

Permalink
fix(Editor component): Force parsing within 100ms to handle folding b…
Browse files Browse the repository at this point in the history
…ig documents (#1677)
  • Loading branch information
0xbase12 authored Nov 1, 2024
1 parent 64af079 commit fe8dc18
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 46 deletions.
88 changes: 48 additions & 40 deletions code/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
"dependencies": {
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.1.0",
"@codemirror/language": "^6.6.0",
"@codemirror/legacy-modes": "^6.3.1",
"@codemirror/language": "^6.10.3",
"@codemirror/legacy-modes": "^6.4.1",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@stripe/react-stripe-js": "^2.1.0",
"@stripe/stripe-js": "^1.54.0",
"@uiw/react-codemirror": "^4.19.9",
"@uiw/react-codemirror": "^4.23.6",
"bluebird": "^3.7.2",
"chart.js": "^3.9.1",
"chartjs-adapter-date-fns": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@
(defn EditorCode
[{:keys [value] :as props}]
[ui/CodeMirror
(assoc props :value (or value ""))])
(assoc props :value (or value "")
;; forceParsing upto 999999 and within 100ms timeout
:on-create-editor #(language/forceParsing % 999999 100))])

(defn EditorJson
[props]
Expand Down Expand Up @@ -713,8 +715,8 @@
:reagent-render (fn [args]
[:div
[:div {:ref #(reset! ref %)
:style {:overflow-y :hidden
:overflow-x :auto
:style {:overflow-y :hidden
:overflow-x :auto
:max-height (if @show-more? nil "15ch")}}
[Component args]]
(when @overflow?
Expand Down

0 comments on commit fe8dc18

Please sign in to comment.