adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.25k stars 7.63k forks source link

cursor position error when edit the jquery.min.js #8051

Closed hyingreborn closed 10 years ago

hyingreborn commented 10 years ago

file: jquery.min.js v1.11.1 i want to add some code in this file, Itself takes up a 5 lines in the bracket, And then I in the sixth row by pressing the enter key to start writing my code, then..... Interface appear a large amount of white space,

The location of the cursor is abnormal

This problem also happens in these files(min.js): jquery ui 1.10.1 ember 1.5.1 Modernizr 2.8.2 etc...

peterflynn commented 10 years ago

@hyingreborn Can you include a screenshot? I'm not seeing any problem when I do these steps:

  1. Open jquery-2.1.0.min.js
  2. Place cursor on line 5 (the blank line at the end of the file)
  3. Press Enter

I tried with with View > Word Wrap both turned on and turned off... no problem either way.

Can you try using Debug > Reload Without Extensions and see if the problem still happens?

hyingreborn commented 10 years ago

jquery-2.1.0.min.js haven't this problem....

you can use jquery.1.11.1.min.js, it has this problem url: http://code.jquery.com/jquery-1.11.1.min.js

aafter abefore

dangoor commented 10 years ago

Which version of Brackets are you using?

Reviewed low priority to @RaymondLim

peterflynn commented 10 years ago

Ok, I can reproduce this now with that exact file. It looks like a problem in the autoindent code, not a rendering issue -- when you press Enter on line 5 (the blank line at the end of the file), the new line 6 gets 9993 space characters prepended to it. If you Shift+Home, Delete to get rid of them, after that everything with the cursor looks fine to me.

dangoor commented 10 years ago

That makes sense. Perhaps we just need to not autoindent if the number of spaces would be ridiculous (more than 200?)

hyingreborn commented 10 years ago

This issue will have a long time ago, there still exist in sprint40

RaymondLim commented 10 years ago

Filed this issue https://github.com/marijnh/CodeMirror/issues/2688 with CM.

RaymondLim commented 10 years ago

Closing since this is already in since release 43.