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

Incorrect selection is picked #17

Open
shivakumargn opened this issue Nov 22, 2013 · 4 comments
Open

Incorrect selection is picked #17

shivakumargn opened this issue Nov 22, 2013 · 4 comments
Labels

Comments

@shivakumargn
Copy link

I am using chrome, often click is needed in a row below the actual symbol to be selected.

I have also seen instances where the click is 2 to 3 rows below the actual code section select for highlighting !

@fzipp
Copy link
Owner

fzipp commented Nov 22, 2013

Can you give me an example file where this happens and which symbol in which row/column you are trying to select?

@shivakumargn
Copy link
Author

pythia_bug

Image attached. The click was on Unlock(), but the "Describe" brought up a stack which on clicking highlights an unrelated data structure (1-2 lines above)

@fzipp
Copy link
Owner

fzipp commented Nov 27, 2013

Thanks. The problem seems to be Windows/DOS line endings (\r\n) vs. Unix line endings (\n), which results in the calculation of the wrong byte offsets. When I converted a source file to Windows line endings I was able to reproduce the bug on a Mac. The problem itself is browser independent.

@fzipp
Copy link
Owner

fzipp commented Nov 27, 2013

The browser loses the \r characters as soon as the source code is inserted via the .html() method:

var text = '1\r\n2\r\n3\r\n4\r\n5\r\n';
text.length == 15;

$('#src').html(text);
$('#src').text().length == 10;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants