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

Coffee-mode, indents keeps doubling #369

Open
quangv opened this issue Apr 20, 2018 · 2 comments
Open

Coffee-mode, indents keeps doubling #369

quangv opened this issue Apr 20, 2018 · 2 comments

Comments

@quangv
Copy link

quangv commented Apr 20, 2018

Description :octocat:

I am editing a coffee-script file, so am using coffee-mode

The indents keeps doubling... so 4, 8, 16, 32 .... the further I nest...

https://emacs.stackexchange.com/questions/41072/spacemacs-coffee-mode-indents-keeps-doubling?noredirect=1#comment64517_41072

Thanks!

Reproduction guide 🪲

  • Open a .coffee file with spacemacs
  • type [ RET (right bracket auto-inserted)
  • type [ RET (right bracket auto-inserted) again
  • type [ RET (right bracket auto-inserted) and again...

Observed behaviour: 👀 💔

The indents keeps doubling.

what happens

Expected behaviour: ❤️ 😄
enter image description here

Only indent 2 spaces per level.

System Info 💻

  • OS: gnu/linux
  • Emacs: 25.3.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 0fa3658)
  • Graphic display: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(react python vimscript asciidoc html javascript markdown clojure helm emacs-lisp neotree           
       (keyboard-layout :variables kl-layout 'colemak-hnei)                                         
       themes-megapack)                                                                             
  • System configuration features: JPEG SOUND GPM DBUS NOTIFY LIBSELINUX GNUTLS LIBXML2 ZLIB MODULES

Backtrace 🐾

<<BACKTRACE IF RELEVANT>>                                                                           

mirror of: syl20bnr/spacemacs#10602

@Compro-Prasad
Copy link

I don't think this is being actively maintained.

@gfederix
Copy link

gfederix commented Oct 21, 2019

It is probably spacemacs fuck up!

My patch:

diff --git a/coffee-mode.el b/coffee-mode.el
index a2ce3fa..6998d2a 100644
--- a/coffee-mode.el
+++ b/coffee-mode.el
@@ -892,6 +892,10 @@ END lie."
                   (coffee-indent-shift-amount start end 'right))))
     (indent-rigidly start end amount)))
 
+(defun indent-for-tab-command ()
+  (interactive
+   (call-interactively 'coffee-indent-shift-right)))
+
 (defun coffee-indent-region (start end)
   (interactive "r")
   (save-excursion

Activate indent-tabs-mode if you use coffe-indent-tabs-mode

gfederix pushed a commit to gfederix/coffee-mode that referenced this issue Oct 21, 2019
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

3 participants