elp-revive / origami.el

A folding minor mode for Emacs
MIT License
32 stars 6 forks source link

Not working with the terminal version of Spacemacs #34

Closed tofuya closed 3 years ago

tofuya commented 3 years ago

Description :octocat:

Not working with the terminal version of Spacemacs.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: The code is not folded

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  origami-rebuild-tree\?(#<buffer REPORT_SPACEMACS_ISSUE<2>>)
  origami-get-fold-tree(#<buffer REPORT_SPACEMACS_ISSUE<2>>)
  origami-close-all-nodes(#<buffer REPORT_SPACEMACS_ISSUE<2>>)
  funcall-interactively(origami-close-all-nodes #<buffer REPORT_SPACEMACS_ISSUE<2>>)
  call-interactively(origami-close-all-nodes nil nil)
  command-execute(origami-close-all-nodes)
jcs090218 commented 3 years ago

Can you paste the code your were trying to fold? Thanks!

tofuya commented 3 years ago

Thank you for your reply. Here is the text file I tried.

foo
  bar
baz
jcs090218 commented 3 years ago

Okay, I have applied a patch in f53bf717e75f0957d454f8236ec176d471ff7e9b with better defense programming strategy.

Are you trying to fold in the text-mode? You might see warning like. 😕

[WARNING] No parser specify in major-mode, ‘text-mode‘
tofuya commented 3 years ago

Yes, it is in text mode. And I have checked the warning message. However, in gregsexton's origami, if the parser to be used in major-mode is not specified, origami-indent-parser seems to be used, and folding in text files is possible. For convenience, it may be better to make it work with emacs-origami as well.

jcs090218 commented 3 years ago

Ah, okay. I have revert changes so the default will always be the indent parser. Thanks! 👍

jcs090218 commented 3 years ago

Does the patch resolved the original issue (wrong-type-argument number-or-marker-p nil)? If it does, I guess this issue can be closed?

jcs090218 commented 3 years ago

I assumed the issue can be closed? Feel free to reopen this issue if you find out useful! :)