# Inline Comment / Uncomment Block

**URL:** <https://forums.toadworld.com/t/inline-comment-uncomment-block/55890>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [August 18, 2022, 1:03pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890 "2022-08-18T13:03:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Paul](https://forums.toadworld.com/u/Paul)\
**Post date:** [August 18, 2022, 1:03pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/1 "2022-08-18T13:03:42Z")

</div>

Could there be an option to comment / uncomment the selected text inline, rather than all of the lines the selected text covers?

So, if I select a block of text and trigger comment / uncomment block, it would be nice if Toad could add /\* .... \*/ comment around just the selected region (or remove them, if the comment markers start and end the region) rather than "--" comment the lines contained within the region. That way I can comment code inline.

Perhaps this could be triggered with a similar keypress like Ctrl + Alt + B and Ctrl + Shift + Alt + B?

Many modern IDEs have this, and it's something I've wanted for ages, unless it already exists and I'm missing it?

Paul

---

<div class="post-metadata">

**Author:** ![Gary.Jerep](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/gary.jerep/32/205_2.png) [@Gary.Jerep](https://forums.toadworld.com/u/Gary.Jerep)\
**Post date:** [August 18, 2022, 7:01pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/2 "2022-08-18T19:01:03Z")

</div>

I personally like this idea, and hoping that John and dev team take note of it.  
Talking about Inline Comment/Uncommenting at the "Selection" level, in addition to the current capability at the "block" level.

BTW, I can sort of mimic what you need by defining my own Make Code Template (see snap below), where I can highlight any portion of code in my Editor and have it commented  
(via Ctl-M shortcut, and then Ctl-V to paste the commented code in place)  
and it gets pretty close to your requirement.

Problem is that the corresponding Strip (Ctl-P) doesn't seem to be working. Ah well, maybe for now, it might be a useful work-around.

 ![image](https://global.discourse-cdn.com/quest/original/2X/1/1839a458dadbffbd4212518dfc7dc40efe5200b9.png)

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [August 18, 2022, 8:09pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/3 "2022-08-18T20:09:09Z")

</div>

What would Toad have to do when the selected text contains embedded /\* ... \*/ comments?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [August 18, 2022, 9:30pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/4 "2022-08-18T21:30:34Z")

</div>

@Andre I don't think that will happen often because Oracle treats the firsts comment end marker as the ending for the first comment start marker (not nested) See below.

 ![image](https://global.discourse-cdn.com/quest/original/2X/e/e66bc0fcac8651fb4ed5b9452bc4611584cfb9d9.png)

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [August 19, 2022, 1:39pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/5 "2022-08-19T13:39:29Z")

</div>

I meant that instead of  
 ![image](https://global.discourse-cdn.com/quest/original/2X/b/bacc39ad974c87067343c460f2333f6c48801a0b.png)  
I thought the OP wanted to have  
 ![image](https://global.discourse-cdn.com/quest/original/2X/7/7034cd280a6f97be6b81ba9349c939c55538f6b1.png)  
which is problematic.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [August 19, 2022, 1:53pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/6 "2022-08-19T13:53:19Z")

</div>

Oh, I see, yes. I guess it would be up to user to not do that if we implement a true block comment instead of multi-line comments.

---

<div class="post-metadata">

**Author:** ![Paul](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@Paul](https://forums.toadworld.com/u/Paul)\
**Post date:** [August 19, 2022, 3:43pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/7 "2022-08-19T15:43:28Z")

</div>

If there's any nested /\* or \*/ in the selected block you go to comment (which, let's be honest, shouldn't happen very often), it could fall back to full line comments, rather than inline.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [August 22, 2022, 7:51pm UTC](https://forums.toadworld.com/t/inline-comment-uncomment-block/55890/8 "2022-08-22T19:51:36Z")

</div>

This feature has been logged. I played around with Visual Studio Code and their implementation is straight forward. It works on your selection without overthinking edge cases. I think that's a good solution. If you have a bad selection, Undo and try again.
