Toad World® Forums

Formatter error - incorrect indent for when clause in a case statement


I'm currently on Toad

The formatter is generating an incorrect indent for the second when clause in the following case statement (which is part of a Multi-column by order by clause):
case /* Relevance of database */
when prm.database_name = g_my_database_name then 99999 -- exact match
--**!! when prm.database_name = g_my_database_group then 99000 -- group match
when prm.database_name = '-' then 0 -- irrelevant
else length(translate(prm.database_name, '.%', '.')) -- the more precise the name, the higher the ranking
end desc

After formatting it looks like this:

As you (hopefully) can see, the when clause that follows the comment line is insufficiently indented.

After uncommenting the commented-out when clause and reformatting I get correctly aligned when clauses:

Since I've been having problems posting this issue, I'll attach the formatter file later...

Abe Kornelis.

Here’s the FmtPlus.opt file (renamed to .txt since the button does not tolerate a .opt extension)



Comment formatting has several issues since a long time, we know that. We planned to address that before the end of the year.

A quick fix is not possible, sorry. We need to kind of rethink/rewrite it.



thanks for the reply.
I’m not in a hurry - this is just formatting. No more than a minor nuisance.

I’ve made various improvement suggestions in the past.
I’m happy to hear you’re planning to do some revamping before the end of the year.

Best regards,