You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The diff popup cuts off the start of text when indenting using tabs.
When determining how much leading whitespace to trim, the diff popup converts tabs to spaces using the current Sublime tab width. However it doesn't convert these tabs to spaces when actually removing them. For example, if I have 2 leading tabs it will convert them to 8 spaces, then remove the 2 tabs and the next 6 characters.
Fix
This problem occurs in factory.py. It was first introduced in 90234a4
This can be fixed by changing line[min_indent:] to line.expandtabs(tab_width)[min_indent:] in the 3 places it occurs.
In order to correctly detect the visual indention mixed with `\t` and ` ` the
_get_min_indention() function expands tabs before calculation. The returned
value is always the indention in characters.
As tabs are not expanded when actually dedenting the lines, too much characters
are removed causing the text being cut off if code is indented by tabs.
Description
The diff popup cuts off the start of text when indenting using tabs.
When determining how much leading whitespace to trim, the diff popup converts tabs to spaces using the current Sublime tab width. However it doesn't convert these tabs to spaces when actually removing them. For example, if I have 2 leading tabs it will convert them to 8 spaces, then remove the 2 tabs and the next 6 characters.
Fix
This problem occurs in factory.py. It was first introduced in 90234a4
This can be fixed by changing
line[min_indent:]
toline.expandtabs(tab_width)[min_indent:]
in the 3 places it occurs.Support Info
Steps to Reproduce Issue
The text was updated successfully, but these errors were encountered: