coffee-mode icon indicating copy to clipboard operation
coffee-mode copied to clipboard

Coffee-mode, indents keeps doubling

Open quangv opened this issue 6 years ago • 2 comments

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 :beetle:

  • 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: :eyes: :broken_heart:

The indents keeps doubling.

what happens

Expected behaviour: :heart: :smile:
enter image description here

Only indent 2 spaces per level.

System Info :computer:

  • 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 :paw_prints:

<<BACKTRACE IF RELEVANT>>                                                                           

mirror of: https://github.com/syl20bnr/spacemacs/issues/10602

quangv avatar Apr 20 '18 20:04 quangv

I don't think this is being actively maintained.

Compro-Prasad avatar Jan 04 '19 04:01 Compro-Prasad

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 avatar Oct 21 '19 16:10 gfederix