소스 검색

Update editorconfig-auto-apply

master
10sr 5 년 전
부모
커밋
f6599d920e
로그인 계정: 10sr GPG 키 ID: 7BEC428194130EB2
2개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. +1
    -0
      .editorconfig
  2. +15
    -5
      emacs.el

+ 1
- 0
.editorconfig 파일 보기

@@ -33,3 +33,4 @@ trim_trailing_whitespace = false

[*.hoe]
file_type_ext = ini
aaa=b

+ 15
- 5
emacs.el 파일 보기

@@ -1928,13 +1928,22 @@ and search from projectile root (if projectile is available)."

(define-minor-mode editorconfig-auto-apply-mode
"When saving .editorconfig file update buffer configs."
:global t ;; TODO: global nil and instruct to hook to editorconfig-conf-mode-hook
:lighter ""
:lighter " ECAA"
(if editorconfig-auto-apply-mode
(add-hook 'after-save-hook
'editorconfig-auto-apply-mode--run)
'editorconfig-auto-apply-mode--run nil t)
(remove-hook 'after-save-hook
'editorconfig-auto-apply-mode--run)))
'editorconfig-auto-apply-mode--run t)))

(defun editorconfig-auto-apply-mode-turn-on ()
"Turn on `editorconfig-auto-apply-mode'."
(unless editorconfig-auto-apply-mode
(editorconfig-auto-apply-mode 1)))

(defun editorconfig-auto-apply-mode-turn-off ()
"Turn off `editorconfig-auto-apply-mode'."
(when editorconfig-auto-apply-mode
(editorconfig-auto-apply-mode -1)))

(defun editorconfig-auto-apply-mode--run ()
"When saving .editorconfig file walk all buffers and update configs."
@@ -1948,7 +1957,8 @@ and search from projectile root (if projectile is available)."
(with-current-buffer buf
(editorconfig-mode-apply)))))))

(editorconfig-auto-apply-mode 1)
(add-hook 'editorconfig-conf-mode-hook
'editorconfig-auto-apply-mode-turn-on)





불러오는 중...
취소
저장