jscheid / dtrt-indent

A minor mode that guesses the indentation offset originally used for creating source code files and transparently adjusts the corresponding settings in Emacs, making it more convenient to edit foreign files.
187 stars 31 forks source link

Error while processing typescript files #75

Closed blahgeek closed 1 year ago

blahgeek commented 1 year ago

dtrt-indent version: 1.13 (69d8e93c33050b073228be2e8ec0b3ca52989f9b) emacs version: 30.0.50 (master)

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  dtrt-indent--skip-to-end-of-match(nil nil nil nil)
  dtrt-indent--for-each-indentation(typescript #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_3> (#<hash-table eql 0/65 0x1592c6ad35ef ...> . 0))
  dtrt-indent--calc-histogram(typescript)
  dtrt-indent-try-set-offset()
  dtrt-indent-mode()
rrthomas commented 1 year ago

Please can you supply an example file on which it fails?

rrthomas commented 1 year ago

Ah, this seems to be a problem with typescript-ts-mode which I didn't catch. To fix, change:

    (typescript-ts-mode typescript typescript-ts-mode-indent-offset)

to

    (typescript-ts-mode javascript typescript-ts-mode-indent-offset)

If you can check that fixes it, that would be most helpful.

blahgeek commented 1 year ago

Thanks for your quick response! I can confirm it fixes the issue.