Created attachment 48735 [details] Patch to make align action an edit only action Version: SVN (using KDE 4.4.4) OS: Linux Kateparts now hints at the configuration of the TAB key at the possibility to bind TAB to emacs like behavior. However, currently, the "align" action is a global action, and binding TAB the align action makes it impossible to move around UI elements (like e.g. when using the "replace" interface ). It would be nice if the align action could be made an event that is only handled when the editor has the focus. Reproducible: Always Steps to Reproduce: 1. Bind TAB key to the "align" action 2. open e.g. the "replace" interface and enter something e.g. in the search field and then press TAB to move to next field Actual Results: Source code is aligned in the current editor view although another UI element has the focus. Expected Results: move focus to next UI element (of course only if the editor doesn't have the focus) I reported this issue before, https://bugs.kde.org/show_bug.cgi?id=237490 and was told this is expected behavior because shortcuts are global. Nevertheless, at least to me "align" is not something that should be initiated at global scope and that's why I created a patch against the current git version of part/view/kateview.cpp that would implement this change and it seems to work for me. However, if you think that the current behavior is better, then you should probably extent the hint in the configuration dialog that configuring TAB to get Emacs like indention behavior makes the tab key unusable for the interaction with the UI. Many thanks.
this is probably true for many more actions, and we should investigate all actions and make sure that they are a) assigned to the editor views widgets b) have the correct shorcutContext set (WidgetWithChildrenShortcut or similar)
For some few actions this is indeed true. Do you know a way to achieve this? QAction::setShortcutContext(Qt::WidgetWithChildrenShortcut) does not work, probably because of KActionCollection along with XMLGUI doing some magic...
Well, somehow my patch seems to do the trick (although I only tested above scenario before submitting it). I moved the add action code from setupActions() to setupEditActions() and it was important to add the line "m_editActions << a;" after the action is added and connected. However, I'm really not an expert here, because so far I neither programmed with QT nor with KDE. I just followed the general layout of the code and deducted that this change might work.
As far as I can see the reason for this is that the edit-actions are enabled/disabled when the view gets/looses focus. Hence they're not available if the focus is elsewhere in the hosting app. And yes, apparently either the ambiguity-check is wrong or its xmlgui thats wrong in adding all actions from an xmlgui client to the xmlgui host object (which means they're "global" actions.
The xmlgui thing should be raised with David Faure to see what his opinion is on this.
Created attachment 108796 [details] Make tools_align an edit action Coming back to this bug I just thought I might update the patch, since binding TAB to tools_align still is considered to be a global action (which it should not be). The attached patch is an update to the older patch to version 5.37.0. The consideration for this patch is that "tools_align" is an edit action (i.e. it changes the text), hence it should be treated as such, which means it should not be added if the loaded file is in read-only mode, and it should only be enabled when the text editor widget has the focus. One desired side effect is that it makes it possible to move around other widgets with TAB also when tools_align is bound to the TAB key. (Obviously it is not possible to use TAB to move away from the editor widget in this case ). Thanks for considering to apply this patch, Gert
Dear user, this wish list item is now closed, as it wasn't touched in the last year and no contributor stepped up to implement it. The Kate/KTextEditor team is small and we can just try to keep up with fixing bugs. Therefore wishes that show no activity for a years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users. If you want your feature to be implemented, please step up to provide some patch for it. If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in a year again. We have a nice website https://kate-editor.org that provides all the information needed to contribute, please make use of it. Patches can be handed in via https://phabricator.kde.org/differential/ Greetings Christoph Cullmann