Replies: 6 comments 19 replies
-
|
Hi @rohitab, I'll try replying one by one. May not have enough time tonight to address all issues. If so, I'll continue tomorrow or on the weekend. Please bear with me. Annotations Highlighting
I am trying to understand the scenario. What is the purpose of inserting an item which does not contain the found text? That aside, I think that I should clear annotations only if I clear complex user data. Something like this: if (NewItem->Item.Flags&LIF_DELETEUSERDATA)
{
Item.ComplexUserData = {};
Item.Annotations.clear();
}I am not sure why I did not do it right away, likely because I did not exactly understand the scenarios where As an aside, I have plans to remove annotations altogether and provide them on the fly based on the complex user data. Then the issue will naturally disappear. |
Beta Was this translation helpful? Give feedback.
-
Line and Column NumbersAgain, I do not understand the scenario. While your script apparently works, I would not bet that something is not broken when you meddle with the content of the Find All menu. Think about At the higher level of abstraction, scripts should not depend on undocumented features, like particular layout of Find All menu items. Let me quote @alabuzhev (#952 (comment)):
This discussion about another script actually prompted the implementation of In this light, the Circling back, what is your scenario? Could it be supported in another, not so intrusive way? |
Beta Was this translation helpful? Give feedback.
-
Selecting TextAs I tried to explain above, depending on the content of the Find All menu items is asking for trouble.
I wrote the You are more than welcome to reuse this technique (and the implementation) in your script and do not bother about performance in this scenario. P.S. Unrelated. Are you aware of the new Find All menu feature, ( |
Beta Was this translation helpful? Give feedback.
-
Column VisibilityPlease open a separate feature request. Let's have a proper discussion. Personally, I would not implement a Lua API for such a niche functionality. Saving the last state of the columns should not be difficult, but I am not sure the maintainer will bless even this, and I will not insist. Again, personally, I do not feel I need preserving the state here. With the columns taking much less screen real estate, I use |
Beta Was this translation helpful? Give feedback.
-
|
To summarize, in this topic we are left only with |
Beta Was this translation helpful? Give feedback.
-
Sounds interesting. Wouldn't you mind to share them? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Lua script that customizes the Find all results menu. I just updated my script to account for the recent changes. However, there are still a few issues remaining.
Annotations Highlighting
My script modifies the menu to indicate the current line by adding a checkmark to it. If the current line is already present, it adds a checkmark to that line, otherwise it inserts a new line and adds a checkmark to it. Here are screenshots from both old and new versions.
Old Version

New Version

As you can see, in the new version, the annotations in the current line
3427are missing. The issue appears to be due to the following code inVMenu::UpdateItem, which clears the annotations when an item is updated usingDM_LISTUPDATE.FarManager/far/vmenu.cpp
Line 992 in 96d48b7
For testing, I commented out the above code and the issue was resolved.
Line and Column Numbers
In the previous dialog design, there was a fixed amount of space allocated for line and column numbers. As a result, when a new line was added, that had a line number with more digits than the existing lines, it was displayed properly. Here are screenshots from both old and new versions.
Old Version

New Version

As you can see, in the current version, the line number of the inserted line, which is
3772is not displayed fully (the first digit is missing). The actual content of the menu item is"3772 struct test_data". In cases where the inserted line has the same number or fewer digits than existing lines, this issue is not present.One way to fix this issue might be to expose an API
Menu.SetItemExtendedDatathat allows extended menu data to be set. This API would be similar to theMenu.GetItemExtendedDataAPI that is currently available for retrieving extended menu data.Another way to fix this might be to format the menu text (using separators for example) so that the menu handler can extract the columns from the text. In the old version, the menu text matched what was displayed on the screen.
Old Version: Menu.Value
211:6 │ + need_check_mark()New Version: Menu.Value
211 6 + need_check_mark()Selecting Text
In the previous version, if you wanted to select the menu item with line number
246, you could use the following code:Similarly, you could use
Menu.Select("246:28", 1)to select a matching line/column, if there were multiple matches within a single line. Unfortunately, this cannot be used reliably with the current design, especially if the text starts with a number. As a result, you have to iterate over all the items, retrieve extended data, and compare the line and column/position of each item, which can be slow if there are a large number of items in the menu.Column Visibility
This is not a big deal, but I think it would be useful to have a way to get/set column visibility via a Lua API. Alternatively, if the state can be saved/restored, that would work too.
@MKadaner tagging you since you are the main developer, and thank you for all the effort you have put to improve the Find all results menu.
Beta Was this translation helpful? Give feedback.
All reactions