Skip to content

M-j in /** foo */ comment blocks is broken. Reasonbly easy to fix #150

Open
@joaotavora

Description

@joaotavora

To reproduce:

emacs -Q -L /path/to/typescript.el -l typescript-mode ~/tmp/something.ts

In something.ts, this exists:

/**
 * foo <cursor here>
 */

Pressing M-j begets:

/**
 * foo */
/**
 */

In #41 (sorry, not #42) , a reasonable suggestion is to rebind M-j to c-indent-new-comment-line, but that requires this patch to typescript.el:

diff -u --label /home/capitaomorte/.emacs.d/elpa/typescript-mode-20201002.1109/typescript-mode.el --label \#\<buffer\ typescript-mode.el\> /home/capitaomorte/.emacs.d/elpa/typescript-mode-20201002.1109/typescript-mode.el /tmp/buffer-content-NJt1TY
--- /home/capitaomorte/.emacs.d/elpa/typescript-mode-20201002.1109/typescript-mode.el
+++ #<buffer typescript-mode.el>
@@ -2945,6 +2945,7 @@
         c-paragraph-start "$"
         c-paragraph-separate "$"
         c-block-comment-prefix "* "
+        c-block-comment-ender-regexp "\\*/"
         c-line-comment-starter "//"
         c-comment-start-regexp "/[*/]\\|\\s!"
         comment-start-skip "\\(//+\\|/\\*+\\)\\s *")

Diff finished.  Wed Aug 11 12:13:38 2021

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions