CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Search in Outline Menu

Open abhibeckert opened this issue 4 years ago • 4 comments

In Xcode, when the Outline Menu is open you can type to filter the list and press enter to select an item.

There is also a keyboard shortcut to open the Outline Menu (Ctrl-6).

The search method should allow for abbreviated search. In my experience the best way to do this is to convert abc to a regex pattern .*a.*b.*c.* and then sort results by length - the shortest match is the most likely result.

abhibeckert avatar Sep 01 '20 01:09 abhibeckert

I did not know this feature on Xcode. Looks interesting.

Because it seems they use not just simple AppKit components, it may take time to implement. But I'll dig it when I have time.

1024jp avatar Sep 01 '20 10:09 1024jp

Apple provides sample code on how to implement this feature. See the accepted answer here:

https://stackoverflow.com/questions/31968959/intercepting-nsmenu-key-events

abhibeckert avatar Sep 01 '20 11:09 abhibeckert

Sorry for taking the time. Finally, I added the outline filtering feature o the next CotEditor 4.1.0, but not in the outline menu in the navigation bar but in the outline pane in the side panel because of ease of implementation. Regarding the implementation of the navigation bar, it may take more, but I'll give it a try.

Screen Shot 2022-02-03 at 17 58 44

1024jp avatar Feb 03 '22 09:02 1024jp

In addition, added the menu command to open the online menu to the Find menu so that users can add their favorite shortcut keys.

Screen Shot 2022-02-04 at 14 09 51

1024jp avatar Feb 04 '22 05:02 1024jp