Bug 514159 - Some tabs collapsed on 4k monitor with Consolas font in certain zoom
Summary: Some tabs collapsed on 4k monitor with Consolas font in certain zoom
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-03-24 04:32 EDT by Jiri Fornous CLA
Modified: 2020-04-03 17:43 EDT (History)
4 users (show)

See Also:


Attachments
Default zoom - indent problems (1.01 MB, image/jpeg)
2017-03-27 03:40 EDT, Jiri Fornous CLA
no flags Details
One plus zoom - problems (1.07 MB, image/jpeg)
2017-03-27 03:40 EDT, Jiri Fornous CLA
no flags Details
Two plus zoom - no problem (1.18 MB, image/jpeg)
2017-03-27 03:41 EDT, Jiri Fornous CLA
no flags Details
One minus zoom - no problem (898.46 KB, image/jpeg)
2017-03-27 03:42 EDT, Jiri Fornous CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Fornous CLA 2017-03-24 04:32:05 EDT
I use Eclipse on one computer plugged into two monitors - one at work (full hd), one at home (4k). The font choosen is standard Consolas. Eclipse is scaling well. The only problem is this:

- on 4k monitor in some files (not all) some of the tabs seems collapsed into zero width character
- it happens in default zoom. If I zoom in (ctrl + +) once, the problems persist. If I zoom in twice, problems disappear. If I zoom out (ctrl + -) the problems also disappear.
- when moving cursor using arrow key over the collapsed tab - it behaves like the tab is there (cursor stay at the position for two key strokes)
- the same files on the full hd monitor cause no trouble
- visual tab width is set to 3 in my preferences

-- Screenshots of behavior in certain zoom levels
https://1drv.ms/f/s!AqMNcE_I2xjAhY4y9mriTGP3khHdsg
Comment 1 Jiri Fornous CLA 2017-03-24 04:34:56 EDT
Adding my exact configuration

-- Configuration Details --
Product: Eclipse 4.6.2.20161208-0625 (org.eclipse.epp.package.jee.product)Installed Features:
 org.eclipse.platform 4.6.2.v20161124-1529
Comment 2 Jiri Fornous CLA 2017-03-24 09:11:00 EDT
The problem cause is definitely the calculated tab width. I tried to change the visual tab width in preferences from 3 to 4 and it worked well.

If there are only tabs at the beginning of the line, everything is alright. Only mix of tabs and spaces causes the problem.

I tried different monospace fonts and the problem persisted, so it is not cause.

I have these settings for my monitor:

- os: windows 10 version 1607
- display resolution: 3840x2160
- the size of text: 175%
Comment 3 Andrey Loskutov CLA 2017-03-24 09:28:32 EDT
Can you please attach some screenshots?
Comment 4 Jiri Fornous CLA 2017-03-24 10:00:30 EDT
Yes, here are 4 different levels of zoom:


https://1drv.ms/f/s!AqMNcE_I2xjAhY4y9mriTGP3khHdsg
Comment 5 Dani Megert CLA 2017-03-24 10:50:44 EDT
(In reply to Jiri Fornous from comment #4)
> Yes, here are 4 different levels of zoom:
> 
> 
> https://1drv.ms/f/s!AqMNcE_I2xjAhY4y9mriTGP3khHdsg

Please attach the files here, so that this bug is self-contained.

Do you also see the problem in the Eclipse Text or Java editor?
Comment 6 Jiri Fornous CLA 2017-03-27 03:40:08 EDT
Created attachment 267474 [details]
Default zoom - indent problems
Comment 7 Jiri Fornous CLA 2017-03-27 03:40:51 EDT
Created attachment 267475 [details]
One plus zoom - problems
Comment 8 Jiri Fornous CLA 2017-03-27 03:41:30 EDT
Created attachment 267476 [details]
Two plus zoom - no problem
Comment 9 Jiri Fornous CLA 2017-03-27 03:42:01 EDT
Created attachment 267477 [details]
One minus zoom - no problem
Comment 10 Jiri Fornous CLA 2017-03-27 03:42:32 EDT
I have just uploaded the files as attachments.
Comment 11 Dani Megert CLA 2017-03-27 09:35:39 EDT
Do you also see the problem in the Eclipse Text or Java editor?
Comment 12 Jiri Fornous CLA 2017-03-28 05:18:08 EDT
The same for the build-in plain text editor.
Comment 13 Jiri Fornous CLA 2017-03-28 05:47:44 EDT
It works this way (suppose I have three letters tab width):

- start at the line beginning
- write one space and tab -> everything ok

- start at the line beginning
- write two spaces and tab -> everything ok

- start at the line beginning
- write three spaces and tab -> wrong (collapsed tab)

It happens when number of spaces is divisible by the tab width in settings - but only for odd numbers (1,3,5,7,...). For even numbers works well.

I think there is incorrect calculation of the real visual tab width depending on the number of typed letters (it is the same with other characters than spaces).

Expected behavior:
- you type 1 character + tab and caret is on third column
- you type 2 characters + tab and caret is on third column 
- you type 3 characters + tab and caret is on sixth column (three character width tab)

Observed behavior:
- you type 3 characters + tab and caret is on third position
Comment 14 Eclipse Genie CLA 2020-04-03 17:43:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.