Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #33. Noticeable lag when typing in larger code blocks #35

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions adoc-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ are fontified natively regardless of their size."
:type '(choice :tag "Fontify code blocks " :format "\n%{%t%}: %[Size%] %v"
(integer :tag "limited to")
(boolean :tag "unlimited"))
:safe '(lambda (x) (or (booleanp x) (numberp x)))
:safe #'(lambda (x) (or (booleanp x) (numberp x)))
:package-version '(adoc-mode . "0.8.0"))

;; This is based on `org-src-lang-modes' from org-src.el
Expand Down Expand Up @@ -1725,7 +1725,7 @@ Concerning TYPE, LEVEL and SUB-TYPE see `adoc-re-llisti'."
(list
;; see also regexp of forced line break, which is similar. it is not directly
;; obvious from asciidoc sourcecode what the exact rules are.
'(lambda (end) (adoc-kwf-std end "^\\(\\+\\)[ \t]*$" '(1)))
#'(lambda (end) (adoc-kwf-std end "^\\(\\+\\)[ \t]*$" '(1)))
'(1 '(face adoc-meta-face adoc-reserved block-del) t)))

(defun adoc-kw-delimited-block (del &optional text-face inhibit-text-reserved)
Expand Down Expand Up @@ -2119,6 +2119,8 @@ Use this function as matching function MATCHER in `font-lock-keywords'."
;; Set background for block as well as opening and closing lines.
(font-lock-append-text-property
start-src end-src+nl 'face 'adoc-native-code-face)
(add-text-properties
start-src end-src+nl '(font-lock-fontified t font-lock-multiline t))
)))
t)))

Expand Down Expand Up @@ -2351,7 +2353,7 @@ Use this function as matching function MATCHER in `font-lock-keywords'."

;; --- general attribute list block element
;; ^\[(?P<attrlist>.*)\]$
(list '(lambda (end) (adoc-kwf-std end "^\\(\\[\\(.*\\)\\]\\)[ \t]*$" '(0)))
(list #'(lambda (end) (adoc-kwf-std end "^\\(\\[\\(.*\\)\\]\\)[ \t]*$" '(0)))
'(1 '(face adoc-meta-face adoc-reserved block-del))
'(2 '(face adoc-meta-face adoc-attribute-list t)))

Expand Down
Loading