My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2022: Diff view calculates column width wrong when code contains tabs
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
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.
Sign in to add a comment

Powered by Google Project Hosting