Any way to change the TODO comment? lazarus / 9-Editor ---------------------------------------------------------------------- egsuh · 2025-05-23 08:19 I can directly change the content. But is there any way to open it again in the small message box so that I can change "category"? ---------------------------------------------------------------------- dsiders · 2025-05-23 15:43 Quote from: egsuh on May 23, 2025, 10:19:31 amI can directly change the content. But is there any way to open it again in the small message box so that I can change "category"? DId you try the View > TODO List menu option? ---------------------------------------------------------------------- JuhaManninen · 2025-06-25 08:43 Quote from: egsuh on May 23, 2025, 10:19:31 amI can directly change the content. But is there any way to open it again in the small message box so that I can change "category"? I guess you mean the "Insert a ToDo/Done/Note" dialog from editor's popup menu. Indeed, it can only be used to add a new ToDo item but not to edit an existing one. Yes, there should be an Edit button in the ToDo List window. I will add this task to my personal ToDo list. ---------------------------------------------------------------------- vangli · 2025-06-25 11:52 You may also change category in the code, like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i { #todo 3 -oBent -cDevelopement : Cloacked in release version until fully developed. } You see the "-c". Just write new category instead of Developement as showed in my example, and in the todo view list just refresh view. ---------------------------------------------------------------------- MarkMLl · 2025-06-25 12:04 Quote from: vangli on June 25, 2025, 01:52:34 pmYou may also change category in the code, like: OP's already said "I can directly change the content." which amounts to the same thing. I'm in broad agreement that having some methodical way of editing this from the report box would be extremely useful, since apart from anything else it would eliminate the risk of inadvertently changing the format of the embedded text in a way that broke something. Perhaps the most important thing is that it would also allow categories and owners to be split and merged to suit the resources available. Which also suggests that "multiply all priorities by ten" or "add five to all these priorities" would be useful. (Posted hesitantly, since I'm not the one with the understanding of how to do the work :-) MarkMLl ---------------------------------------------------------------------- n7800 · 2025-06-25 12:13 Then I will in turn ask for the possibility of group editing )) So that it would be possible to select several items at once and specify one category/priority/etc for them. ---------------------------------------------------------------------- JuhaManninen · 2025-06-25 16:00 OK, the latest suggested changes require some fancy GUI design. From GUI point of view editing a single item is easy because it can reuse the same dialog. ---------------------------------------------------------------------- JuhaManninen · 2025-06-26 09:09 I added an Edit button in  https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/87f0aec5708434c230bec1b0b89dda6830b0f3c3 Please test. ---------------------------------------------------------------------- n7800 · 2025-06-27 20:26 Quote from: JuhaManninen on June 25, 2025, 06:00:32 pmOK, the latest suggested changes require some fancy GUI design. From GUI point of view editing a single item is easy because it can reuse the same dialog. I see a couple of options. The simplest of them is to add the following commands to the context menu: * Edit type ... * Edit category ... * Edit priority ... * Edit owner ... * Edit text ... Each will open something like an InputBox, and the entered value will be set for all selected elements. It is even possible to specify all of them in the "Group editing >" submenu (of context menu), which will only appear with multiple selections. But now I see that there is no context menu at all, so this is not necessary for now. A more complex option is, of course, to change the editing dialog so that it supports "group editing". More precisely, it should apply only those fields that the user has changed, and leave the rest untouched. But this is a separate topic... ---------------------------------------------------------------------- n7800 · 2025-06-27 20:58 Quote from: JuhaManninen on June 26, 2025, 11:09:19 amI added an Edit button in  https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/87f0aec5708434c230bec1b0b89dda6830b0f3c3 Please test. And I added shortcuts )) A small problem is that to use the button in the toolbar, you first need to somehow select the item in the list. Although when you click it, it immediately opens it in the Source Editor. You have to open the window again and then click "Edit" in toolbar (or you can use [F2] after my commit). Or select with right-click, but theoretically it should open the context menu. So menu should be added so that you can select "Edit ..." in it. ---------------------------------------------------------------------- n7800 · 2025-06-27 20:59 It's probably time for the next feature request... When the cursor is inside a todo comment, it makes sense to show in the Source Editor context menu command "Edit ToDo ..." (or "Done"/"Note", depending on the current type) instead of "Insert a ToDo/Done/Note". This will allow to immediately call the editor of the current element, rather than searching for it in a huge window list. It will also fix the bug, since now it try inserts a comment right inside another comment. ---------------------------------------------------------------------- JuhaManninen · 2025-06-28 09:37 Quote from: n7800 on June 27, 2025, 10:59:07 pmWhen the cursor is inside a todo comment, it makes sense to show in the Source Editor context menu command "Edit ToDo ..." (or "Done"/"Note", depending on the current type) instead of "Insert a ToDo/Done/Note". Yes. How to do that? I guess it needs a new callback which the ToDoList package can register. ---------------------------------------------------------------------- JuhaManninen · 2025-06-28 13:13 OK, I managed to implement it. Please test. TIDESpecialCommand has OnRequestCaptionHint which works perfectly. The ToDoList window must be open for this feature to work which is not ideal. Solving it is not trivial. All ToDo items should be scanned when a menu is opened, and stored in some new structure. Now they are stored in the ListView's ListItem.Data. ---------------------------------------------------------------------- n7800 · 2025-06-29 17:58 Thanks, the implementation has begun )) Quote from: JuhaManninen on June 28, 2025, 03:13:44 pmThe ToDoList window must be open for this feature to work which is not ideal. I haven't looked at the code, but it seems to also require constant updating of the list when comments change? I was able to insert a "todo" inside a comment by simply adding spaces at the end of it... Quote from: JuhaManninen on June 28, 2025, 03:13:44 pmSolving it is not trivial. All ToDo items should be scanned when a menu is opened, and stored in some new structure. Scanning the entire list can create a large delay when opening the menu, which is certainly not good (even if the list is cached). I don't know CodeTools. Is it possible to get information from it whether the cursor is currently inside a comment? If outside it, then there is no need to check further, and IDE can immediately show "Insert todo" in the menu. If it is a comment, then see if it contains "todo:". If it does not, then IDE can again show "Insert todo". Otherwise, "Edit todo" may be shown. If this is possible, then IDE can work only with the current code, without accessing the list (and window). ---------------------------------------------------------------------- JuhaManninen · 2025-06-29 18:13 Quote from: n7800 on June 29, 2025, 07:58:44 pmI don't know CodeTools. Is it possible to get information from it whether the cursor is currently inside a comment? If outside it, then there is no need to check further, and IDE can immediately show "Insert todo" in the menu. If it is a comment, then see if it contains "todo:". If it does not, then IDE can again show "Insert todo". Otherwise, "Edit todo" may be shown. If this is possible, then IDE can work only with the current code, without accessing the list (and window). Yes, I will make a dedicated parser for the purpose. Codetools will not be needed then, and the ToDo list does not need to be open. ---------------------------------------------------------------------- JuhaManninen · 2025-06-30 08:03 Not related to the original question but I added a "Colors" button into the ToDoList Toolbar. It now opens the whole editor settings tree. A user must himself move to the Colors pane and scroll to the end of the list to find settings for "ToDo comments". We should implement a system (callback, event) that allows moving focus to the desired GUI element in the Options window automatically. [Edit] Now focus moves directly to the editor colors pane. A user only must scroll to the end of the color list. Quite good! I added the button because I didn't myself realize until recently the ToDo colors can be adjusted. I guess many other users don't realize it either. The editor settings are intimidating. ---------------------------------------------------------------------- JuhaManninen · 2025-07-01 07:00 Quote from: n7800 on June 29, 2025, 07:58:44 pmIf this is possible, then IDE can work only with the current code, without accessing the list (and window). Now there is a solution using the SynEdit highlighter for ToDo. Currently it works only for single line ToDo comments. The ToDoList window does not need to be updated or even created. Please test.