Code Folding support for gherkin Mode

Hi,

I am developing an editor which is in gherkin mode and the functionalities are working perfectly fine. Though I need to add support for code folding. I have checked Code folding is working for html , JS , python or xml with the addOn available but does it has anything for gherkin ? Or I should write some custom code to make it work .

I don’t know Gherkin, but at a glance it looks indentation-based, so you might be able to use indent-fold.js with it.

Thanks @marijn for the quick reply , Let me try that and I will update.

Hi @marijn , As you suggested I tried code-folding on gherkin mode with indent-fold.js . I created a stackblitz to test this.
ngx-codemirror-2fay8m - StackBlitz
Code fold marker is not showed up in the gutter and of course code folding is not working.

Could you please look into the code once to see if there is any wrong configuration . Otherwise I would try to write custom logic to make it work. Thank You.

The Gherkin mode doesn’t declare a fold style, so you have to manually include something like foldOptions: {rangeFinder: CodeMirror.helpers.fold.indent} in your options.