Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor positioning #33971

Closed
Pok-Pok opened this issue Sep 7, 2017 · 6 comments
Closed

Cursor positioning #33971

Pok-Pok opened this issue Sep 7, 2017 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-rendering Editor rendering issues linux Issues with VS Code on Linux verified Verification succeeded
Milestone

Comments

@Pok-Pok
Copy link

Pok-Pok commented Sep 7, 2017

  • VSCode Version: Code 1.15.1 (41abd21, 2017-08-16T17:16:27.618Z)
  • OS Version: Linux x64 4.4.75
  • Extensions:
Extension Author (truncated) Version
xml Dot 1.9.2
EditorConfig Edi 0.10.1
format-indent Kas 1.3.0
material-icon-theme PKi 2.2.0
code-settings-sync Sha 2.8.3
html-css-class-completion Zig 1.9.0
html-snippets abu 0.1.0
project-manager ale 0.20.0
vscode-color ans 0.4.5
code-gnu-global aus 0.2.2
plsql cas 0.0.3
vscode-eslint dba 1.2.11
jquerysnippets don 0.0.1
python don 0.7.0
php-debug fel 1.11.1
CppSnippets har 0.0.12
rest-client hum 0.15.2
vscode-JS-CSS-HTML-formatter lon 0.2.3
VBScript lug 0.0.2
MagicPython mag 1.0.12
Runner mat 0.1.14
vscode-todo-parser min 1.9.1
HTMLHint mka 0.3.3
prettify-json moh 0.0.3
Arduino moo 0.0.4
cpptools ms- 0.12.3
view-in-browser qin 0.0.5
python tht 0.2.3
cmake twx 0.0.17
JavaScriptSnippets xab 1.4.1

(3 theme extensions excluded)


Steps to Reproduce:

  1. Set up code to use Courier New as font
  2. Add javascript code that contains square or curly braces.
  3. Cursor and selection are not painted/displayed at actual position withing a line for positions after the braces; the more braces to bigger the offset.
  4. Changing the font to a default one (Droid Sans Mono) solves the problem.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Sep 7, 2017
@alexdima alexdima added linux Issues with VS Code on Linux bug Issue identified by VS Code Team member as probable bug labels Sep 28, 2017
@alexdima alexdima added this to the On Deck milestone Sep 28, 2017
@alexdima
Copy link
Member

alexdima commented Dec 6, 2017

I cannot reproduce. I've tried on Ubuntu 16.04

image

@alexdima alexdima added info-needed Issue requires more information from poster editor-rendering Editor rendering issues and removed editor editor-core Editor basic functionality bug Issue identified by VS Code Team member as probable bug labels Dec 6, 2017
@Pok-Pok
Copy link
Author

Pok-Pok commented Dec 6, 2017

I can reproduce on every version starting 1.14 through current, even 1.19.0-insider.
B.t.w, are you implying that Visual Studio Code only runs on Ubuntu and not Linux?

@alexdima
Copy link
Member

alexdima commented Dec 6, 2017

@Pok-Pok I am saying I cannot reproduce on my installation of Ubuntu 16.04. Can you please provide more information for me to try to reproduce, such as what is your distro, what customizations you have done to VS Code, etc.

@Pok-Pok
Copy link
Author

Pok-Pok commented Dec 6, 2017

I use Slackware64 14.2, latest patches.
I installed a single plug-in into VSCode: ESLint, but it is disables.
Other than that I have the following options set:

// Place your settings in this file to overwrite the default settings
{
	"editor.detectIndentation": false,
	"editor.fontFamily": "'Courier New', 'Droid Sans Mono', 'Courier New'",
	"editor.fontSize": 11,
	"editor.formatOnSave": false,
	"editor.insertSpaces": false,
	"editor.tabSize": 6,
	"terminal.integrated.fontSize": 9,
	"window.zoomLevel": 0,
	"workbench.colorTheme": "Default Light+",
	"workbench.iconTheme": "material-icon-theme",

	"javascript.format.insertSpaceAfterConstructor": true,
	"javascript.format.placeOpenBraceOnNewLineForFunctions": true,

	"typescript.check.npmIsInstalled": false,
	"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
	"typescript.format.placeOpenBraceOnNewLineForFunctions": true,

	"javascript.format.insertSpaceBeforeFunctionParenthesis": true
}

That is all I have customized.

@Pok-Pok
Copy link
Author

Pok-Pok commented Dec 25, 2017

In the mean-time I have found that this is not confined to one font (Courier New); it also manifests itself with Droid Sans Mono, only the effect is much smaller: it requires a lot more braces on the same line for the effect to be noticeable.

@alexdima
Copy link
Member

alexdima commented Jan 22, 2018

I can reproduce with the following settings:

{
    "editor.fontFamily": "Hack",
    "editor.fontSize": 16,
    "editor.lineHeight": 25,
    "editor.renderWhitespace": "boundary",
    "workbench.colorTheme": "Quiet Light"
}

The font and the theme settings are relevant because the theme ends up in the creation of many distinct color regions (each character gets a different color) with the following snippet:

var arr = [

    ['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x'],['x']

]

When changing the file-type to .txt, there is no such problem (the number of spans is reduced). I believe it must be some sort of rounding error in Chromium, where each span holds in a lossy way its width.

screenshot from 2018-01-22 11-29-16

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jan 22, 2018
@alexdima alexdima modified the milestones: On Deck, January 2018 Jan 22, 2018
@rebornix rebornix added the verified Verification succeeded label Feb 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-rendering Editor rendering issues linux Issues with VS Code on Linux verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants