-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Pinner plugin #1308
Add Pinner plugin #1308
Conversation
Uhhh, that sounds interesting and like something I want to implement since some years already :). |
I just found some old code and it seems I started with a similar approach some time ago: https://gist.github.com/eht16/15afd001f238f77f100a43e4129b8d20 |
Duplicate checking works now. Any feedback on how I'm implementing this so far? One thing I'm not sure of yet is how to pass the the list to the cleanup function so I can free it. |
I made the list global. |
@eht16 It looks like we were working on something different but similar? ;) I think incorporating something like that into this plugin would be suitable. |
At this point, clicking on a document in the "Pinned" tab, will open (switch to) it. |
Ready for review and testing |
Do you have a final screenshot? |
Also: * Set margins to 10 pixels and left-justify
Longer filenames are now handled better, and they're left-justified with a 10 pixel margin on both sides. |
I moved this to https://github.com/andy5995/pinner |
Yes, my approach was for a different use case. I like to have a tab/document always in the visible area of the notebook tab list for easy access. The name of your plugin sounded like this to me in the beginning :). |
Couple of comments:
|
I'm happy to elaborate an idea or re-frame a goal if I haven't made myself clear to someone. In this case, I didn't know I wasn't being understood. Please let me know next time if you are confused by my description or feel I need to expand on it more.
I feel that's an unnecessarily rigid policy and I don't really plan to stop using them (when I believe it's appropriate) based on your demand. I believe that comparisons can be a useful tool when trying to describe something; but I acknowledge that sometimes comparisons aren't always adequate and shouldn't be solely relied upon to express a desired feature.
I don't know what that means.
I don't know what you mean. I work with documents when I use Geany. The plugin apparently uses a sidebar notebook (
I searched for I'm not accessing any GeanyDocument pointers passed through a callback. In one case, I pass the file_name member as a gchar, after it's been validated by another function. Due to #3770 I use this to validate the file_name after I enter a callback function:
|
I forgot to mention, based on your feedback @elextr , I expanded the README.md with hopefully a better explanation of the goal of the plugin, and added a link to a demo video. |
Yes, that was what I was asking, describing a feature as "I want it to work like Vscode" is unhelpful if the reader doesn't use Vscode or that feature of Vscode, whereas "I want it to do xyz when I click blah because I have found it useful in Vscode" is of course fine.
I was simply saying that I was making the above point as guidance ahead of you doing anything, not that it was a criticism of anything you had done in the past.
Sorry I meant The important thing was to beware that state can change between callbacks to your plugin, I saw a note that you made a list (of documents I think) global, thats fine, but if you are saving information between callbacks you have to check that the information in that list is valid every time your plugin is entered because any arbitrary changes could be made (documents opening/closing) between callbacks.
Or the problem of the description of the plugin. I had in mind "pin" as being locking the document tab to the left side of the notebook tabs, a feature available in several other applications. Your |
Sounds like we're in agreement in that case. ;)
I'll use that macro, thanks for pointing it out, but as I mentioned in geany/geany#3770 , if doc->is_valid is true, doc->file_name may not necessarily be valid, it may be NULL. This happens when the 'document' in front of the user is an 'untitled' document. Although there's no point in trying to "pin" an untitled document, it's better to prevent a segfault if a user accidentally tries to pin it (like I did).
Ok. I know I antipated that if a user closes a doc on the pin list and clicks the filename from the pin list later, the doc will be re-opened. Which isn't so terrible but it sounds like at some point I should implement checking the list as you said.
If you haven't already looked at the video, or had time to glance at my code, I'll inform you now that it has been implemented. ;) |
From what I can tell, as I'm just learning the Geany API and gtk3, I would now need to
I'm a bit lost on how to pass some values as functions though. I'm not too experienced with callback functions and some of my experiments have gone terribly awry.
I'll ask in a line comment...