Community
Participate
Working Groups
Build Identifier: 20100917-0705 In preferences, if I check General/Editors/Text Editors -> Insert spaces for tabs the tab key has no effect in the JSP editor in a JSP Scriptlet (i.e. I hit it an the line isn't indented). If I uncheck Insert spaces for tabs, the tab key works in the JSP editor. The tab key appears to work correctly outside of the context of a scriptlet. Reproducible: Always Steps to Reproduce: 1. In preferences, check General/Editors/Text Editors -> Insert spaces for tabs 2. open a JSP file in the JSP editor, and edit a JSP Scriptlet (<% %>) 3. When the cursor is at the beginning of a line, try to indent a line in the scriptlet using the tab key. Nothing will happen. Also, 4. If you place the cursor before the first non-whitespace character on a line that was already indented with tabs, and press the tab key, the indentation will be removed. Note: the file I am trying to edit was originally indented with tabs.
This looks like a result of the JavaAutoIndentStrategy running on the indent. It collapses it to "correct" indent for what should be at that line. For example, if you have if (true) { [] } and a tab is inserted at [], the correct indentation will occur.
I should add, this runs in TextViewer#customizeDocumentCommand
Indeed this is caused do to JavaAutoIndentStrategy, when the text length of the command is higher than 1 (in this scenario the length is 4) it performs the a smartPaste, cutting the indent proposed. In order to confirm the statement, uncheck the "Adjust indentation" (Java>Editor>Typing) and notice that now it works correctly. Still investigating ..
i just created https://bugs.eclipse.org/bugs/show_bug.cgi?id=404190 to reported the new issue.
My mistake, sorry Please ignore the previous comment.
Adding a proposed patch, that marks the command to not be handled by avaAutoIndentStrategy, i already test that the behavior remains untouched. https://github.com/zalapa/webtools.sourceediting/commit/c9063af64eb154730cd58235d1e340ec6a20f33f
Created attachment 233764 [details] patch Nick, improving patch with your suggestions.
Yes, I am in compliance with the Certificate of Origin