Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto indention of closing braces #2

Open
nyuichi opened this issue Jul 6, 2012 · 1 comment
Open

Auto indention of closing braces #2

nyuichi opened this issue Jul 6, 2012 · 1 comment

Comments

@nyuichi
Copy link
Member

nyuichi commented Jul 6, 2012

A closing brace should be indented automatically as soon as I insert it in a single line as well as c/c++-mode or other modes.
With current version of jsx-mode.el, closing braces remain the position they are inserted in.

@abicky
Copy link
Member

abicky commented Jul 8, 2012

I'll implement some input support features including the feature you want in version 0.2.
Could you write the following code in your init.el temporarily? This code will realize the feature.

(defun jsx-mode-init ()
  (define-key jsx-mode-map (kbd "}")
    (lambda (arg)
      (interactive "*P")
      (self-insert-command (prefix-numeric-value arg))
      (indent-according-to-mode))))
(add-hook 'jsx-mode-hook 'jsx-mode-init)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants