idea-multimarkdown icon indicating copy to clipboard operation
idea-multimarkdown copied to clipboard

Edit Table of Contents style intention dialog has no effect

Open InvisibleSmiley opened this issue 5 years ago • 11 comments

I started with something like this:

# API

[TOC]: #

## Definitions

### foo
bar

Then used the "Update Table of Contents" intention. That removed my custom "Definitions" heading but OK, I manually fixed that, arriving at this:

# API

[TOC]: #

# Table of Contents
- [Definitions](#definitions)
  - [foo](#foo)

## Definitions

### foo
bar

Now I tried to use the "Edit Table of Contents style" intention on the TOC line. But no matter what I did in that dialog, pressing OK had no effect other than closing the dialog. Trying again resulted in the same situation. In the end I manually changed the TOC line to:

[TOC levels=2,3]: # "## Table of Contents"

which is what I wanted to achieve (heading level 1: API, heading level 2: TOC), and that works.

InvisibleSmiley avatar Apr 15 '20 15:04 InvisibleSmiley

@InvisibleSmiley, can reproduce. It's a bug.

vsch avatar Apr 15 '20 15:04 vsch

@InvisibleSmiley, new EAP 3.0.xxx.85 is released.

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

Please note the change that EAP channel is for JetBrains licensed plugin and Legacy EAP is for legacy licensing by vladsch.com

vsch avatar Apr 15 '20 18:04 vsch

"Title Level" still seems to do nothing. Changing it even disables all buttons except for Reset and Cancel.

InvisibleSmiley avatar Apr 16 '20 06:04 InvisibleSmiley

@InvisibleSmiley, the buttons are disabled if their action results in no changes. So if the selected options result in no text change for the TOC, OK and Reset will be disabled.

Title Level options are optimized to minimize text.

Can you please post a screenshot of the dialog with the disabled buttons and the [TOC....]:... line on which it is used so I can see the selection.

vsch avatar Apr 16 '20 18:04 vsch

TOC

The problem seems to be that as long as the Title reads exactly "Table of Contents", changing Title Level has no effect.

InvisibleSmiley avatar Apr 17 '20 05:04 InvisibleSmiley

@InvisibleSmiley, sorry I confused Include Levels with Title Level and only addressed the former.

Options form for TOC settings was not updating the title level value properly.

Another EAP with a bunch of fixes is due today or tomorrow.

vsch avatar Apr 17 '20 22:04 vsch

@InvisibleSmiley, new EAP 3.0.xxx.87 released. Should be available shortly.

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

Please note the change that EAP channel is for JetBrains licensed plugin and Legacy EAP is for legacy licensing by vladsch.com

vsch avatar Apr 19 '20 00:04 vsch

It is better now in the sense that Title Level is no longer ignored if Title reads "Table of Contents" or anything else that does not start with a hash.

If however the dialog is opened from a line reading

[TOC]:` # "## Table of Contents"

then the Title value will start with ## in which case changing Title Level will have no effect.

I'll leave it up to you whether you consider the bug fixed. At least the dialog is usable now. :-)

InvisibleSmiley avatar Apr 20 '20 06:04 InvisibleSmiley

@InvisibleSmiley, this is still a bug but under different conditions.

The plugin used to have code in the markdown library handling the TOC and in the plugin, using the IDE AST. I removed the duplication. I missed a few code differences.

I do not have UI automated tests and rely on testing the underlying non-UI code. Not all conditions are caught this way. I apologize for the inconvenience. I will get this fixed.

vsch avatar Apr 20 '20 19:04 vsch

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

Please note the change that EAP channel is for JetBrains licensed plugin and Legacy EAP is for legacy licensing by vladsch.com

vsch avatar Apr 24 '20 20:04 vsch

Looks good now, thanks!

InvisibleSmiley avatar Apr 27 '20 07:04 InvisibleSmiley