{"comment":{"url":"https://api.github.com/repos/pik/geany/comments/10792503","html_url":"https://github.com/pik/geany/commit/0242f951aa6c493d513734f1a6094db637e496f7#commitcomment-10792503","id":10792503,"user":{"login":"pik","id":10236920,"avatar_url":"https://avatars.githubusercontent.com/u/10236920?v=3","gravatar_id":"","url":"https://api.github.com/users/pik","html_url":"https://github.com/pik","followers_url":"https://api.github.com/users/pik/followers","following_url":"https://api.github.com/users/pik/following{/other_user}","gists_url":"https://api.github.com/users/pik/gists{/gist_id}","starred_url":"https://api.github.com/users/pik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pik/subscriptions","organizations_url":"https://api.github.com/users/pik/orgs","repos_url":"https://api.github.com/users/pik/repos","events_url":"https://api.github.com/users/pik/events{/privacy}","received_events_url":"https://api.github.com/users/pik/received_events","type":"User","site_admin":false},"position":97,"line":2383,"path":"src/keybindings.c","commit_id":"0242f951aa6c493d513734f1a6094db637e496f7","created_at":"2015-04-19T14:29:38Z","updated_at":"2015-04-19T14:29:38Z","body":"\r\n\r\n@b4n I would have preferred a switch as well but it won't really work here - since `doc->editor->sci`  was switched to `focusw`.\r\n```if (doc == NULL || !IS_SCINTILLA(focusw))\r\nreturn TRUE;```\r\n(The above was going to misbehave).\r\nThe verbose version would have to be something like this: \r\n\r\n```\r\nstatic gboolean cb_func_select_action(guint key_id)\r\n{\r\n\tGeanyDocument *doc;\r\n\tGtkWidget *focusw; \r\n\r\n\tif (key_id == GEANY_KEYS_SELECT_ALL)\r\n    {\r\n\t\ton_menu_select_all1_activate(NULL, NULL);\r\n        return TRUE;\r\n\t}\r\n    doc = document_get_current();\r\n    if (doc != NULL) {\r\n        if (key_id == GEANY_KEYS_SELECT_LINE) {\r\n            editor_select_lines(doc->editor, FALSE);\r\n            return TRUE; \r\n        }\r\n        else if (key_id == GEANY_KEYS_SELECT_PARAGRAPH) {\r\n            editor_select_paragraph(doc->editor);\r\n            return TRUE; \r\n        }\r\n    }\r\n    focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window);\r\n    if (IS_SCINTILLA(focusw)) {\r\n        if (key_id == GEANY_KEYS_SELECT_WORDPARTLEFT)\r\n            sci_send_command(SCINTILLA(focusw), SCI_WORDPARTLEFTEXTEND); \r\n        else if (key_id == GEANY_KEYS_SELECT_WORDPARTRIGHT)\r\n            sci_send_command(SCINTILLA(focusw), SCI_WORDPARTRIGHTEXTEND);\r\n    }\r\n    return TRUE; \r\n}\r\n```"}}