Persistent text folding in editor

Love the plugin! Is there any way that you can make it work without having to use the markdown editor?

Strange nobody has this bug. In my case (Linux, Dark Theme, 13 font) the plugin creates a narrow vertical black line, which overlaps the first symbol in each line. It is extremely difficult because it hides a text pointer if it is in a first position in the line. I can't see if I am starting to type in a right line. And reading without the first letter in each line is difficult too.

Not to be critical but in my experience customising CSS (including theming) or/and using extensively rich markdown plugin messes up the presentation of gutters (narrow vertical line).

I'm not sure that this is your problem but in my experience it usually is. Every time I change css I try to catch if gutters were screwed up.

It takes a lot of fiddling to make it work "just right" on all window sizes, themes, alongside other editor plugins, etc.

For now, you may list plugins you use, attach the screenshot how does this narrow vertical line look like, show your CSS (Settings - Appearance - Show Advanced - Joplin-wide settings) and, if you're technical enough, this css line might help, adjust it to your situation:

.CodeMirror-gutters {
/* locates the gutter more or less to the left */
     left: 1px !important;

/* makes gutter colour to be transparent essentially hiding it */
     background-color: transparent !important;

P.S. I don't know much about css, this just happened to help in my situation, so if I'm wrong, pm is welcome

Thanks for response! I don't have any plugins installed or custom CSS setting.

Is it possible to render foldings in view mode too? Because navigation is unsynced now when I have folded headings in markdown section but all unfolded in viewing section.

Great plugin but an odd streak of white in the side-by-side editing layout appeared with Joplin v2.3.5 Windows 10 desktop app (plugin v1.2.5):

When displayed by itself the markdown pane doesn't have the streak. The streak also (obviously) disappears with the plugin turned off.


Hi @ipsum, I found this with the latest update also, I believe it's to do with this, from the changelog

Improved: Allow setting a max width for the editor content (8063c94)

I found that if in the Settings under Appearance, you set the Editor maximum width to 0, the folding and unfolding continues to work as before.


Thanks @johano, that returned the side-by-side display to normal. I'm also glad to learn that senility isn't the reason I had no memory of setting the editor content width to 600.

Hello everyone,
I don't know if it's me or actually, with 2.4.1 pre-release, folding behaviour got broken.

Hi @davidpoza, folding is working good her on version 2.4.1 (Linux).

Presuming that you have Editor maximum width set to 0 under Settings > General > Appearance, here's a couple of things you might try:

Maybe you could narrow things down by opening the profile directory from the Help menu, temporarily renaming userstyle.css and userchrome.css, and restarting Joplin. If folding works again, then you'll know it's something in your CSS files. After that, perhaps try disabling plugins apart from Folding in Code Mirror Editor, to eliminate the possibility of some kind of negative interaction.

Hope you get it sorted.

1 Like

Thanks for replying so fast. I didn't know about the existence of max width setting, I've set it and problem has disappeared. Thank you so much!

1 Like

Are there plans to fix it to work with restricted width editors?


I'm also waiting @vsimkus with anticipation to this fix, but as a workaround you could add a dot (.) at the end of any heading you wish to fold, and it will still work. (unfold by deleting the dot, and sometimes also pressing the "expand" icon that was next to it.)

1 Like

@ambrt Thank you for making this plugin. I think it's quite useful for some of my longer notes. However, is there any update on making this plugin work with a fixed editor width? This is keeping me from using this plugin since setting a max width of 0 conflicts with other things I have configured. Thanks again!

1 Like

Awesome, that solved my issue as well, thanks!

1 Like

Fabulous plugin! I keep a few journal notes so it's really useful to be able to collapse the days as the end of the month approaches!

I was just wondering if you could also add folding on fenced code blocks? Thanks to a plugin that allows me to write javascript and run it within joplin I've got a few notes with a LOT of code in them where I only care about the output... Would that be possible?

Thanks :smiley:

PS here's that javascript plugin for those curious

Hey @ambrt, loving the plug-in - one request, could you add an explicit keyboard shortcut to toggle fold on the current heading?

I have realised that I can manually add a dot to the end of a heading and hit Enter to fold and that I can use arrow keys to then unfold headings.

While this works, the behaviour can be a bit unreliable:

  1. when unfolding the . is left behind
  • is this supposed to be for persistent folding? If so, once the arrow-to-unfold is used, the Headings don't seem to fold again once I move to another section of the editor
  1. Sometimes the folding just doesn't seem to trigger when a dot is added
  • I can't see any pattern in when this does/doesn't occur

I think explicitly calling a function to fold/unfold would clean this right up?

One last clarification - when I refer to the 'current' heading, I'm assuming the shortcut works only on when focus is on the heading line itself. If you could search up the document and fold the closest heading, that would be even better!

I really appreciate this plugin :slight_smile: I notice a similar issue where when you scroll, things elsewhere on the note seem to get unfolded, and so the page jumps around a bit. If I open another note and then go back to the original note, things are folded again. Always takes a beat to realise that things got unfolded again though.

A keyboard shortcut would be great. Love keyboard shortcuts :slight_smile:

Is dead this plugin?

The plugin still appears in the Joplin plugins search if you search for "folding". I just installed it that way and it works for me. Plugin is version 2.0.1 and Joplin is version 2.8.8.