Skip to content

Commit

Permalink
Update src
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 11, 2023
1 parent 2ff39a1 commit a5de820
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions rainbow-csv.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,13 @@
(line-beginning-position) (line-end-position))))
(n (1+ n)))
(dotimes (i n)
(let ((r (format "^\\([^%c\"\n]*\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[%c]+\\)\\{%d\\}"
(let ((r (format "^\\([^%c\"\n]*\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[%c\n]+\\)\\{%d\\}"
separator separator (1+ i)))
(color (or (nth i rainbow-csv-colors)
(rainbow-csv--rgb))))
(setq csv-font-lock-keywords
(append csv-font-lock-keywords
`((,r (1 '(face (:foreground ,color)) prepend t))))))))
;; For last column!
(let* ((r (format "[%c]+.*\\(\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[\n]+\\)\\{%d\\}"
separator 1))
(i n)
(color (or (nth i rainbow-csv-colors)
(rainbow-csv--rgb))))
(setq csv-font-lock-keywords
(append csv-font-lock-keywords
`((,r (1 '(face (:foreground ,color)) prepend t))))))
(font-lock-refresh-defaults))

;;
Expand Down

0 comments on commit a5de820

Please sign in to comment.