Folding in markdown files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Folding in markdown files

Maral Watanabe
Hi,

I store all my notes in a vimwiki with markdown syntax. 
These are the relevant settings from my .vimrc:

let g:vimwiki_table_mappings=0
let g:vimwiki_table_auto_fmt=0
let g:vimwiki_folding='expr'

let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
let g:vimwiki_list = [{'path': '~/Documents/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}, ... ]

When I try to fold sections in a note I encounter a very strange behavior.

Suppose this is the note document and the cursor is located at <cursor> and I am in normal mode (Screen_1):

Title: Some Titel

<cursor># Header

some line

## Section

section line

When I press zc to close the folding I receive this error: E490: No Fold found.

Then I cycle through the opened tabs by typing gt until I am back in the tab of the above note. Now the folding of the Header is closed, 
i.e. the content of the tab is like this (Screen_2):

Title: Some Titel

<cursor># Header [7] --------------------------------------------------------------------------
~
~

Now I can open the folding of the Header with zo and close it with zc
But when I wait a few seconds without hitting any key while the buffer is shown like in Screen_2 
MacVim opens the entire folding of Header, i.e. it automatically switches the buffer back to Screen_1.
After that automatic expansion of the folding of Header MacVim forgets the folding it has used before.
Now, when I try to close the folding with zo I again receive the error  E490: No Fold found.

Is this a known issue of MacVim? Does anyone have an idea why this behaviour occurs?

By the way: At work I use gVim (with almost the same settings in my vimrc) under Windows 10 and Ubuntu 16.04.
In gVim I encounter no such issues when I use fold commanads like zc and zo.

My MacVim version is: Custom Version 8.1.2234 (161)

Ciao

Maral

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/c28c301a-00ef-47fe-8ddc-7c77f943b595%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Folding in markdown files

Tony Mechelynck
On Saturday, January 11, 2020 at 2:41:06 AM UTC+1, Maral Watanabe wrote:
Hi,

I store all my notes in a vimwiki with markdown syntax. 
These are the relevant settings from my .vimrc:

let g:vimwiki_table_mappings=0
let g:vimwiki_table_auto_fmt=0
let g:vimwiki_folding='expr'

let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
let g:vimwiki_list = [{'path': '~/Documents/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}, ... ]

When I try to fold sections in a note I encounter a very strange behavior.

Suppose this is the note document and the cursor is located at <cursor> and I am in normal mode (Screen_1):

Title: Some Titel

<cursor># Header

some line

## Section

section line

When I press zc to close the folding I receive this error: E490: No Fold found.

Then I cycle through the opened tabs by typing gt until I am back in the tab of the above note. Now the folding of the Header is closed, 
i.e. the content of the tab is like this (Screen_2):

Title: Some Titel

<cursor># Header [7] --------------------------------------------------------------------------
~
~

Now I can open the folding of the Header with zo and close it with zc
But when I wait a few seconds without hitting any key while the buffer is shown like in Screen_2 
MacVim opens the entire folding of Header, i.e. it automatically switches the buffer back to Screen_1.
After that automatic expansion of the folding of Header MacVim forgets the folding it has used before.
Now, when I try to close the folding with zo I again receive the error  E490: No Fold found.

Is this a known issue of MacVim? Does anyone have an idea why this behaviour occurs?

By the way: At work I use gVim (with almost the same settings in my vimrc) under Windows 10 and Ubuntu 16.04.
In gVim I encounter no such issues when I use fold commanads like zc and zo.

My MacVim version is: Custom Version 8.1.2234 (161)

Ciao

Maral

I don't think this issue is peculiar to MacVim (though I could be mistaken); but it could be a bug in Vim 8.1.2234. Which version of gvim are you using at work? It can be seen from the top part of the output of the :version command, once you are running that gvim version. You can capture that output, for instance in the clipboard (see :help :redir — and the clipboard is register +). You don't need to answer with the full output of :version, the interesting part is the top part, up to and including the line which ends with "Features included (+) or not (-)", you can remove the part after that, after pasting and before sending.

If your gvim version is not 8.1.2234, you can see a one-line description of each Vim patch, for version 8.1 at http://ftp.vim.org/pub/vim/patches/8.1/ and for 8.2 at http://ftp.vim.org/pub/vim/patches/8.2/ ; I don't think the difference between the last patchlevel of 8.1 and version 8.2.0 is related to folding so if there is something relevant to your problem it should be listed on one of these two pages.

The latest Vim source as of this writing is 8.2.110; if your gmail version at work is later than your MacVim version, then maybe you can try and find a later MacVim?

Best regards,
Tony.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/40d35257-fe22-4e8b-857b-f33ce6e81a5d%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Folding in markdown files

Maral Watanabe
In reply to this post by Maral Watanabe

Hi,


I tried to analyze under which situation the problem arises. I use these versions of vim

  • MacBook
    •   MacVim: Custom Version 8.1.2234 (161)
  •  Work
    •   Windows 10: gVim 8.1.1817
    •   Ubuntu 16.04 (work): 7.4.1689

In both environments at work, the issue did not arise.


Then I set up a virtual machine running Ubuntu 16.04. on my MacBook. In the virtual machine, vim is of version 7.4.1689, i.e. the same version as in my Ubuntu environment at work. But although I installed the same plugins in both Ubuntu environments the issue with folding did only arise in the virtual machine on my MacBook. So I checked the versions of the plugins. It turned out that I used older versions of the following plugins in my environments at work:

After I had updated those plugins to the most recent versions in both environments at work the issue with folding also occurred at work in the Ubuntu environment but not in the Windows 10 environment. Hence my conclusion is that vim-markdown and vimwiki are incompatible in these versions of vim:

  • 7.4.1689
  • Custom Version 8.1.2234 (161)

but compatible in version 8.1.1817. So I guess there was a bug in version 7.4 which was fixed in 8.1 but somehow shows up again in the more recent version of MacVim. Another possibility would be that the recent version of either vim-markdown or vimwiki has some bug. But that's not me to find out.


Ciao


Maral


Am Samstag, 11. Januar 2020 02:41:06 UTC+1 schrieb Maral Watanabe:
Hi,

I store all my notes in a vimwiki with markdown syntax. 
These are the relevant settings from my .vimrc:

let g:vimwiki_table_mappings=0
let g:vimwiki_table_auto_fmt=0
let g:vimwiki_folding='expr'

let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
let g:vimwiki_list = [{'path': '~/Documents/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}, ... ]

When I try to fold sections in a note I encounter a very strange behavior.

Suppose this is the note document and the cursor is located at <cursor> and I am in normal mode (Screen_1):

Title: Some Titel

<cursor># Header

some line

## Section

section line

When I press zc to close the folding I receive this error: E490: No Fold found.

Then I cycle through the opened tabs by typing gt until I am back in the tab of the above note. Now the folding of the Header is closed, 
i.e. the content of the tab is like this (Screen_2):

Title: Some Titel

<cursor># Header [7] --------------------------------------------------------------------------
~
~

Now I can open the folding of the Header with zo and close it with zc
But when I wait a few seconds without hitting any key while the buffer is shown like in Screen_2 
MacVim opens the entire folding of Header, i.e. it automatically switches the buffer back to Screen_1.
After that automatic expansion of the folding of Header MacVim forgets the folding it has used before.
Now, when I try to close the folding with zo I again receive the error  E490: No Fold found.

Is this a known issue of MacVim? Does anyone have an idea why this behaviour occurs?

By the way: At work I use gVim (with almost the same settings in my vimrc) under Windows 10 and Ubuntu 16.04.
In gVim I encounter no such issues when I use fold commanads like zc and zo.

My MacVim version is: Custom Version 8.1.2234 (161)

Ciao

Maral

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/e3b760ea-6fc3-41b9-a745-f93960665c5d%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Folding in markdown files

Tony Mechelynck
In reply to this post by Maral Watanabe


On Saturday, January 11, 2020 at 2:41:06 AM UTC+1, Maral Watanabe wrote:
Hi,

I store all my notes in a vimwiki with markdown syntax. 
These are the relevant settings from my .vimrc:

let g:vimwiki_table_mappings=0
let g:vimwiki_table_auto_fmt=0
let g:vimwiki_folding='expr'

let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
let g:vimwiki_list = [{'path': '~/Documents/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}, ... ]

When I try to fold sections in a note I encounter a very strange behavior.

Suppose this is the note document and the cursor is located at <cursor> and I am in normal mode (Screen_1):

Title: Some Titel

<cursor># Header

some line

## Section

section line

When I press zc to close the folding I receive this error: E490: No Fold found.

Then I cycle through the opened tabs by typing gt until I am back in the tab of the above note. Now the folding of the Header is closed, 
i.e. the content of the tab is like this (Screen_2):

Title: Some Titel

<cursor># Header [7] --------------------------------------------------------------------------
~
~

Now I can open the folding of the Header with zo and close it with zc
But when I wait a few seconds without hitting any key while the buffer is shown like in Screen_2 
MacVim opens the entire folding of Header, i.e. it automatically switches the buffer back to Screen_1.
After that automatic expansion of the folding of Header MacVim forgets the folding it has used before.
Now, when I try to close the folding with zo I again receive the error  E490: No Fold found.

Is this a known issue of MacVim? Does anyone have an idea why this behaviour occurs?

By the way: At work I use gVim (with almost the same settings in my vimrc) under Windows 10 and Ubuntu 16.04.
In gVim I encounter no such issues when I use fold commanads like zc and zo.

My MacVim version is: Custom Version 8.1.2234 (161)

Ciao

Maral

I don't see these two plugins (filetype-pligins?) on my system. I hope someone else can help you.

Best regards,
Tony.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/b8e4c728-b187-4f7f-b1c5-4efa8be69c30%40googlegroups.com.