Issue 2022: Diff view calculates column width wrong when code contains tabs
Status:  New
Owner: ----
Reported by higeo...@gmail.com, Jul 19, 2013
When code uses tabs for indentation the diff view will calculate the column width wrong, resulting in a page that is far to wide.

Affected Version: 2.6.1

What steps will reproduce the problem?
1. Show diff for a file that is indented with tab characters
2. In Preferences, set Tab Width: 4 and Columns: 30, Show Tabs: checked

What is the expected output? What do you see instead?

This setting should give a view where all lines are at most 30 characters long. However, lines that contain tabs are longer. When changing the tab width, the line breaks should change. Instead they are always the same because Gerrit counts the tab character as 1 character regardless of the tab width setting.

It works correctly if the tab width is set to 1, but that is a pretty pointless setting.


Expected.png
13.7 KB   View   Download
Actual.png
13.8 KB   View   Download
Jul 19, 2013
#1 higeo...@gmail.com
Expected.png shows the behaviour with TabWidth=1. If TabWidth is set to a larger value we should get something similar.
Jul 19, 2013
#2 higeo...@gmail.com
This happens only if "Syntax Coloring" is checked.