jceb / vim-orgmode

Text outlining and task management for Vim based on Emacs' Org-Mode
http://www.vim.org/scripts/script.php?script_id=3642
Other
3.12k stars 267 forks source link

Traceback if <TAB> with no folds #153

Open jean opened 11 years ago

jean commented 11 years ago
E490: No fold found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jean/.vim/bundle/vim-orgmode/ftplugin/orgmode/_vim.py", line 80
, in r
    res = f(*args, **kwargs)
  File "/home/jean/.vim/bundle/vim-orgmode/ftplugin/orgmode/plugins/ShowHide.
py", line 100, in toggle_folding
    vim.command((u'%d,%dfoldclose!' % (heading.start_vim, heading.end_of_last
_child_vim)).encode(u'utf-8'))
vim.error    
jean commented 11 years ago

Reloaded the same todo.org file, now <TAB> doesn't cause the error. Will update if I figure out how to reproduce this.

The org file is just a scribble:

*** TODO check out orgmode                                      :bla_bal_bla:
    some stuff  <0013-10-08> 
    sadf <2013-10-16 Wed>
    a [2013-10-16 Wed]
*** another thing
    a <2013-10-16 Wed>
** TODO higher level                                                :another:
   other stuff  <2013-10-16 Wed>
sotte commented 11 years ago

Hey,

I don't get an error. The folding is not ideal, but the structure of the file is not a proper hierarchy so it's understandable.

Keep me posted!

jean commented 11 years ago

154 is also about the hierarchy ... since it's dealing with a textfile written by a human, I think orgmode should try to cope with bad hierarchy.

Hmm, actually this is quite tricky, not surprisingly. I see I can promote a heading, until I create a bad hierarchy. If I then m]] the subtree gets moved under the next following heading of the parent level. (I.e. **** will be moved under the next ***.)