-
-
Notifications
You must be signed in to change notification settings - Fork 118
Hi I'm trying to add a fuzzy search (see my branch here) and the concept is really working well for now.
I'm now at the point where I want to open a file which was selected by the fuzzy finder (see plugins/fuzzy-search/fuzzy-search.vala line 80). But open_file from the interface can't open the file because it says the file is corrupt (it isn't!).
If the selected file is already open the editor will crash.
Can somebody guide me here how to programmatically open a file from a plugin? I'm kind of lost.
I'm getting following segmentation fault when opening the file:
open_file_error
All reactions
Replies: 2 comments 3 replies
Plugins have access to the MainWindow so you could try creating a Services.Document from the file and then call the open_document function.
All reactions
Thanks for the quick reply.
I tried it, but I'm still getting the same error:
editor_error_window
As far as I can tell the plugin interface method open_file is doing this internally.
All reactions
Looks like you have a null file?
All reactions
If you make and submit a draft PR it will be easier to investigate.
All reactions
Created #1159