jupyter-org-font-lock-ansi-escapes: Fix regexp for fixed-width blocks

This commit is contained in:
Nathaniel Nicandro 2019-06-11 21:48:22 -05:00
parent 9f15db7133
commit fda5f0b414
2 changed files with 15 additions and 2 deletions

View file

@ -579,7 +579,7 @@ property."
(jupyter-org--ansi-color-apply-on-region beg1 end)))
;; fixed width
(t
(setq end (or (and (re-search-forward "^[ \t]*[^:]" nil t)
(setq end (or (and (re-search-forward "^[ \t]*[^ \t:]" nil t)
(1- (match-beginning 0)))
(point-max)))
(jupyter-org--ansi-color-apply-on-region beg end)))))))

View file

@ -2314,7 +2314,20 @@ ABCDEF
#+end_example")
;; Test the cached faces path
(remove-text-properties (point-min) (point-max) '(face))
(funcall test-fun 24 '(19 20 21 22 23 26 27 28 29)))))
(funcall test-fun 24 '(19 20 21 22 23 26 27 28 29))))
(ert-info ("Leading indentation")
(with-temp-buffer
(org-mode)
(jupyter-org-interaction-mode 1)
(pop-to-buffer (current-buffer))
(let ((beg (+ (point-min) 2)) end)
(insert " : ABCDEF\n")
(insert " : ABCDEF\n")
(setq end (1- (point)))
(insert "hey\n")
(goto-char (point-min))
(jupyter-org-font-lock-ansi-escapes (point-max))
(should-not (text-property-not-all beg end 'jupyter-ansi t))))))
(ert-deftest jupyter-org-closest-jupyter-language ()
:tags '(org)