SUMMARY When in inline math mode (i.e. in between two `$` characters), typing a single quote (') automatically adds two single quotes ('') instead. This is undesirable since several mathematical symbols I use are defined with a single ' character and not two. I would be very pleased if someone could suggest where in the source code this feature is written, so that I could tweak/patch it myself. I tried checking several files in `src/`, specifically `src/editorextension.cpp` and `src/codecompletion.cpp` but couldn't find the piece of code that adds automatic closing brackets and quotation marks. Thanks, Abhinav STEPS TO REPRODUCE 1. Enable Automatic Brackets in Settings-> Configure Kile-> Editing-> Auto Brackets->Enable automatic brackets 2. Go to math mode either through a shortcut or by typing `$ $` manually. Navigate to any cursor position between the $ signs and type `'`. OBSERVED RESULT Kile automatically adds two instances of the character (`''`). EXPECTED RESULT Inline math mode should behave the same as other modes: only a single character should be added. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Linux (x86_64) release 5.4.11-arch1-1 (available in About System) KDE Plasma Version: KDE Frameworks Version: KDE Frameworks 5.66.0 Qt Version: Qt 5.14.0 (built against 5.14.0) ADDITIONAL INFORMATION
I added a user-defined script that lets me work around this. The script is activated when I press the key `'`. If anyone else is interested, here it is: document.editBegin(); var range = view.selectionRange(); if ( range.isValid() ) { view.clearSelection(); document.insertText(range.end,"'"); var c = view.cursorPosition(); document.insertText(range.start,"'"); c.column = c.column + 1; view.setCursorPosition(c); } else { document.insertText("'"); } document.editEnd();