Skip to content

Instantly share code, notes, and snippets.

View 501st-alpha1's full-sized avatar

Scott Weldon 501st-alpha1

View GitHub Profile
@501st-alpha1
501st-alpha1 / gist:02071b570bcfd58486aa
Created June 19, 2014 00:54
Bug in web-mode erb tag completion
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
remove-text-properties(nil nil (block-token nil))
(let ((pos reg-beg) beg char match continue (flags 0) token-type) (remove-text-properties reg-beg reg-end (quote (block-token nil))) (goto-char reg-beg) (while (re-search-forward regexp reg-end t) (setq beg (match-beginning 0) match (match-string 0) continue t flags (logior flags 1) token-type nil) (setq char (aref match 0)) (cond ((and (string= web-mode-engine "asp") (eq char 39)) (setq token-type (quote comment)) (goto-char (if (< reg-end (line-end-position)) reg-end (line-end-position)))) ((eq char 39) (setq token-type (quote string)) (while (and continue (search-forward "'" reg-end t)) (if (looking-back "\\\\+'" reg-beg t) (setq continue (= ... 0)) (setq continue nil)))) ((eq char 34) (setq token-type (quote string)) (while (and continue (search-forward "\"" reg-end t)) (if (looking-back "\\\\+\"" reg-beg t) (setq continue (= ... 0)) (setq continue nil)))) ((string= match "//")