{"action":"created","issue":{"url":"https://api.github.com/repos/geany/geany/issues/1144","repository_url":"https://api.github.com/repos/geany/geany","labels_url":"https://api.github.com/repos/geany/geany/issues/1144/labels{/name}","comments_url":"https://api.github.com/repos/geany/geany/issues/1144/comments","events_url":"https://api.github.com/repos/geany/geany/issues/1144/events","html_url":"https://github.com/geany/geany/pull/1144","id":166579193,"number":1144,"title":"Add features for sorting editor tabs","user":{"login":"konsolebox","id":329497,"avatar_url":"https://avatars.githubusercontent.com/u/329497?v=3","gravatar_id":"","url":"https://api.github.com/users/konsolebox","html_url":"https://github.com/konsolebox","followers_url":"https://api.github.com/users/konsolebox/followers","following_url":"https://api.github.com/users/konsolebox/following{/other_user}","gists_url":"https://api.github.com/users/konsolebox/gists{/gist_id}","starred_url":"https://api.github.com/users/konsolebox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konsolebox/subscriptions","organizations_url":"https://api.github.com/users/konsolebox/orgs","repos_url":"https://api.github.com/users/konsolebox/repos","events_url":"https://api.github.com/users/konsolebox/events{/privacy}","received_events_url":"https://api.github.com/users/konsolebox/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/geany/geany/labels/enhancement","name":"enhancement","color":"207de5"},{"url":"https://api.github.com/repos/geany/geany/labels/work%20in%20progress","name":"work in progress","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-07-20T13:19:26Z","updated_at":"2016-07-23T21:33:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/geany/geany/pulls/1144","html_url":"https://github.com/geany/geany/pull/1144","diff_url":"https://github.com/geany/geany/pull/1144.diff","patch_url":"https://github.com/geany/geany/pull/1144.patch"},"body":"This PR is about adding features to make it possible to sort the tabs in the editor area.  It includes the following changes:\r\n\r\n04eb16b Add capability to automatically sort editor tabs\r\n138dd09 Add keybindings for sorting editor tabs\r\n803d6a6 Add capability to sort editor tabs\r\na64749e Allow document_get_notebook_child() to be used globally\r\n\r\nI chose to place them in one PR so everything can be discussed in one place.   Each update depends on the other update that comes earlier than it.  Which means, if the last update is wanted (`04eb16b`), all other updates that came before it should be included, but if only `803d6a6` is wanted, it would only require `a64749e`.\r\n\r\nHere are the snapshots:\r\n\r\nhttp://imgur.com/6uYVd72\r\nhttp://imgur.com/G4Fi9iV\r\nhttp://imgur.com/VNOJaVv\r\nhttp://imgur.com/Pb00zIK\r\n\r\nThe first 2 updates (`803d6a6` and `138dd09`) made a fair amount of changes in the code, but the last update had to be a little aggressive since the only way to get it done properly is to alter the codes that call `document_open_file()`.  Modifying `document_open_file()` itself would mean that every file opened would cause the order of tabs in the notebook widget to be recalculated and rearranged.\r\n\r\nThis could cause significant slowdown during startup time especially when opening a lot of files.  That's why the only proper way to do it is to make changes on the calling functions instead, where we could only allow a function like `notebook_auto_sort_tabs()` to be called once after multiple files are opened.\r\n\r\nWe can also create a wrapper function like `document_open_file_and_auto_sort_tabs()` but it would only apply to calling functions that only open a file once everytime they are called.\r\n\r\nIt's unlikely for the last update to be merged because of that, but please also consider the first two (`803d6a6` and `138dd09`).  I can create another PR for those if wanted.\r\n"},"comment":{"url":"https://api.github.com/repos/geany/geany/issues/comments/234741679","html_url":"https://github.com/geany/geany/pull/1144#issuecomment-234741679","issue_url":"https://api.github.com/repos/geany/geany/issues/1144","id":234741679,"user":{"login":"b4n","id":793526,"avatar_url":"https://avatars.githubusercontent.com/u/793526?v=3","gravatar_id":"","url":"https://api.github.com/users/b4n","html_url":"https://github.com/b4n","followers_url":"https://api.github.com/users/b4n/followers","following_url":"https://api.github.com/users/b4n/following{/other_user}","gists_url":"https://api.github.com/users/b4n/gists{/gist_id}","starred_url":"https://api.github.com/users/b4n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b4n/subscriptions","organizations_url":"https://api.github.com/users/b4n/orgs","repos_url":"https://api.github.com/users/b4n/repos","events_url":"https://api.github.com/users/b4n/events{/privacy}","received_events_url":"https://api.github.com/users/b4n/received_events","type":"User","site_admin":false},"created_at":"2016-07-23T21:33:22Z","updated_at":"2016-07-23T21:33:22Z","body":"> My concern was that: having the sort function called from a one-call-per-file function means that the sort function would be called everytime a file is opened, even in a batch operation when it should only be called once.\r\n\r\nMmmokay, but that's probably also premature optimization, it's not likely to be *that* slow.\r\n\r\nAnd as said in an inline comment, you could avoid sorting everything and only sort the new document's tab.\r\n\r\n> >  should use Stash for new settings!\r\n>\r\n>I just followed how other things were arranged, but I'll see how that can necessarily be done.\r\n\r\nat the top of `save_dialog_prefs()` you can read `/* new settings should be added in init_pref_groups() */` ;)\r\n\r\n> As I examined it right now, `show_tab_bar_popup_menu()` doesn't even create any hooks or signals that would allow plugins to create their own menu items.\r\n\r\nNo indeed, that's not currently possible AFAIK.\r\n\r\n> I can consider converting this to a plugin if it's necessary, but personally I'd prefer that it becomes part of Geany and not a plugin, since it directly affects the main behavior of the UI, and not just something that alters the content of the document, or adds another tab in the sidebar. If this is created as a plugin, the plugin would possibly require to be highly adaptive to changes in the UI code.\r\n\r\nPossibly fair point."}}
{"actor":{"display_login":"b4n"}}