Compare commits
No commits in common. "a28f84ae1e34475898fd2f34e871b6483a7437f3" and "2c7518fa760d6b1f2d7345a699ec427e193f29e1" have entirely different histories.
a28f84ae1e
...
2c7518fa76
@ -36,13 +36,7 @@
|
||||
(goto-char mb)
|
||||
(sp--looking-back-p "=" 1))))
|
||||
|
||||
(defun sp-web-mode-is-code-context (id action context)
|
||||
(and (eq action 'insert)
|
||||
(not (or (get-text-property (point) 'part-side)
|
||||
(get-text-property (point) 'block-side)))))
|
||||
|
||||
(sp-local-pair '(web-mode) "<" nil
|
||||
:when '(sp-web-mode-is-code-context)
|
||||
:unless '(:add sp-after-equals-p)
|
||||
:skip-match 'sp-after-equals-skip-p)
|
||||
:hook
|
||||
|
@ -8,22 +8,6 @@
|
||||
(defvar-local run-command-project-local-commands nil)
|
||||
(put 'run-command-project-local-commands 'safe-local-variable (lambda (_) t))
|
||||
:config
|
||||
;; Add ability to edit command line with prefix arg
|
||||
(defvar run-command-edit? nil)
|
||||
|
||||
(defun run-command-core-run-advice (orig-fun command-spec &rest args)
|
||||
(let ((spec (if run-command-edit?
|
||||
(plist-put command-spec :command-line (read-string "Command: " (plist-get command-spec :command-line)))
|
||||
command-spec)))
|
||||
(apply orig-fun spec args)))
|
||||
|
||||
(defun run-command-advice (orig-fun &rest args)
|
||||
(let ((run-command-edit? (not (null current-prefix-arg))))
|
||||
(apply orig-fun args)))
|
||||
|
||||
(advice-add 'run-command :around #'run-command-advice)
|
||||
(advice-add 'run-command-core-run :around #'run-command-core-run-advice)
|
||||
|
||||
(defun run-command-recipe-terraform ()
|
||||
(when (directory-files default-directory
|
||||
nil
|
||||
@ -401,8 +385,7 @@
|
||||
|
||||
(defun run-command-recipe-rspec ()
|
||||
(when
|
||||
(and (or (derived-mode-p 'ruby-mode)
|
||||
(derived-mode-p 'ruby-ts-mode))
|
||||
(and (derived-mode-p 'ruby-mode)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "RSpec" nil t)))
|
||||
|
@ -26,31 +26,42 @@
|
||||
(dolist (lang (mapcar #'car treesit-language-source-alist))
|
||||
(treesit-install-language-grammar lang)))
|
||||
|
||||
(defvar treesit-langs-mode-overrides '((sh-mode . bash)
|
||||
(defvar treesit-langs-by-mode '((sh-mode . bash)
|
||||
(sh-ts-mode . bash)
|
||||
(cmake-mode . cmake)
|
||||
(cmake-ts-mode . cmake)
|
||||
(css-mode . css)
|
||||
(css-ts-mode . css)
|
||||
(emacs-lisp-mode . elisp)
|
||||
(emacs-lisp-ts-mode . elisp)
|
||||
(go-mode . go)
|
||||
(go-ts-mode . go)
|
||||
(html-mode . html)
|
||||
(html-ts-mode . html)
|
||||
(js-mode . javascript)
|
||||
(js-ts-mode . javascript)
|
||||
(json-mode . json)
|
||||
(json-ts-mode . json)
|
||||
(makefile-mode . make)
|
||||
(makefile-ts-mode . make)))
|
||||
(makefile-ts-mode . make)
|
||||
(markdown-mode . markdown)
|
||||
(markdown-ts-mode . markdown)
|
||||
(python-mode . python)
|
||||
(python-ts-mode . python)
|
||||
(ruby-mode . ruby)
|
||||
(ruby-ts-mode . ruby)
|
||||
(toml-mode . toml)
|
||||
(toml-ts-mode . toml)
|
||||
(typescript-mode . typescript)
|
||||
(typescript-ts-mode . typescript)
|
||||
(yaml-mode . yaml)
|
||||
(yaml-ts-mode . yaml)
|
||||
(astro-mode . astro)
|
||||
(astro-ts-mode . astro)))
|
||||
|
||||
(defun treesit-parse-lang-from-mode (mode)
|
||||
(let* ((mode (if (symbolp mode) (symbol-name mode) mode))
|
||||
(lang (save-match-data
|
||||
(string-match "\\(.*?\\)\\(-ts\\)?-mode" mode)
|
||||
(match-string 1 mode))))
|
||||
(intern lang)))
|
||||
|
||||
(defun treesit-lang-for-mode (mode)
|
||||
(or (cdr (assoc mode treesit-langs-mode-overrides))
|
||||
(treesit-parse-lang-from-mode mode)
|
||||
(error "Unable to determine tree-sitter parser for %s" mode)))
|
||||
|
||||
(defun treesit-parser ()
|
||||
(if-let ((lang (treesit-lang-for-mode major-mode)))
|
||||
(if-let ((lang (cdr (assoc major-mode treesit-langs-by-mode))))
|
||||
(treesit-parser-create lang (current-buffer))
|
||||
(user-error "No tree-sitter parser for %s" major-mode)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user