eclipse / tm4e

TextMate support in Eclipse IDE
https://projects.eclipse.org/projects/technology.tm4e
Eclipse Public License 2.0
89 stars 56 forks source link

Paste into editor (JS) adding extra tabs #788

Closed jridge-ezclocker closed 3 weeks ago

jridge-ezclocker commented 3 weeks ago

NOTE: This could be related to a similar issue reported at: https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/issues/1525

Searched around but didn't find an issue that seemed to match so forgive me if it is fixed in a future release or already reported :)

Main Issue: Paste Adds Unnecessary Tabs

When pasting code from another file into the editor additional unnecessary tabs get added. Example below:

1) Starting with a basic JS class: initial

2) Copy a property with getter/setter from another class (could also just be a method or code within a method): copy-from-different-file

3) Paste the copied code into the initial file: past-into-initial-file

Notice the tabbing that is applied during the paste.

4) From the cursor position after the initial paste, paste the code again paste-again-into-initial-file

Notice the additional tabbing that is applied during the paste.

5) Formatting the code in the initial file does fixe most of the tab issues, however, the comments never get formatted properly: format-after-paste

Secondary Issue

Finally, an (I'm assuming) related issue involves adding a new line to a method (example), and backspacing to the beginning of the line, at that point the tab key does nothing at all:

1) Add a New Line to the Method add-new-line

2) Backspace (twice in this case) to the beginning of the line back-space-back-space-cannot-tab

3) Pressing the tab key does nothing in the editor (cursor remains on the first column of line)

To get the tab key to function again I have to type at least one character and then go back to the beginning of the line to use the tab. Formatting normally fixes the issues as well unless a template literal multi-line string was entered (since formatting will ignore the template literal string formatting).

Just let me know if you would like the last item reported separately.

Eclipse Environment

Select Plugin/Feature Versions

More Eclipse Environment Detail

sebthom commented 3 weeks ago

This might be triggered by an indentation rule. Please try to disable them for the JS content type:

image

jridge-ezclocker commented 3 weeks ago

Thanks for the time - Can confirm that unchecking that box doesn't result in extra tabs during paste. I'll close the defect.