I have user menu items of the following which have the following form <something>%M%C<something else> for example (%M%C) This should mean that if text is selected when triggered, the text selection is surrounded by the insertions and the cursor is placed just after the selection. For example ab should become (ab<cursor here>) If no text is selected, I should get (<cursor here>) This pattern is reflected in the example.xml which uses it for small-caps with-or-without-selected-text. \textsc{%M%C} However, whether my menu items or small-caps from example.xml, what actually happens is that, if text is selected, %M<something>%M%C<something else> is inserted into the document. So, rather than (ab<cursor here>) you get ab(ab<cursor here>) This doesn't happen if you require text to be selected. However, then you can't use the item without a selection. This is a regression: it worked just fine with user tags in previous versions of Kile.
Git commit 0a08fcaca53bd1535113435ced489cce4db99903 by Michel Ludwig. Committed on 21/01/2018 at 17:04. Pushed by mludwig into branch 'master'. User menu: make 'replace text selection' independent of 'require text selection' Also, fix cursor positioning with '%C' in combination with '%M'. M +4 -6 src/dialogs/usermenu/usermenudialog.cpp M +13 -18 src/usermenu/usermenu.cpp https://commits.kde.org/kile/0a08fcaca53bd1535113435ced489cce4db99903