Fix block/jsdoc comment continuation in typescript
Also improves writing block comments in js2-mode and rjsx-mode. Reported by @ar1a
This commit is contained in:
parent
638ff6b0a2
commit
6fbd3407e0
1 changed files with 8 additions and 4 deletions
|
@ -17,6 +17,11 @@
|
|||
;; Other
|
||||
:yield "import"))
|
||||
|
||||
(after! smartparens
|
||||
(sp-with-modes '(js2-mode typescript-mode rjsx-mode)
|
||||
(sp-local-pair "/**" "" :post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET")))
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET")))))
|
||||
|
||||
|
||||
;;
|
||||
;; Major modes
|
||||
|
@ -25,6 +30,7 @@
|
|||
(def-package! js2-mode
|
||||
:mode "\\.js\\'"
|
||||
:interpreter "node"
|
||||
:commands js2-line-break
|
||||
:config
|
||||
(setq js2-skip-preprocessor-directives t
|
||||
js2-highlight-external-variables nil
|
||||
|
@ -38,16 +44,12 @@
|
|||
js2-strict-missing-semi-warning nil)
|
||||
|
||||
(add-hook! 'js2-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
|
||||
;; Indent switch-case another step
|
||||
(setq-hook! 'js2-mode-hook js-switch-indent-offset js2-basic-offset)
|
||||
|
||||
(set-electric! 'js2-mode :chars '(?\} ?\) ?. ?:))
|
||||
(set-repl-handler! 'js2-mode #'+javascript/repl)
|
||||
|
||||
(sp-with-modes '(js2-mode rjsx-mode)
|
||||
(sp-local-pair "/*" "*/" :post-handlers '(("| " "SPC"))))
|
||||
|
||||
(map! :map js2-mode-map
|
||||
:localleader
|
||||
:n "S" #'+javascript/skewer-this-buffer))
|
||||
|
@ -83,6 +85,8 @@
|
|||
|
||||
(after! typescript-mode
|
||||
(add-hook! 'typescript-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
|
||||
(setq-hook! 'typescript-mode-hook
|
||||
comment-line-break-function #'js2-line-break)
|
||||
(set-electric! 'typescript-mode
|
||||
:chars '(?\} ?\)) :words '("||" "&&"))
|
||||
(set-pretty-symbols! 'typescript-mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue