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

Using forward slash when editing PHP crashes script. #42

Closed
CharlieSheather opened this issue Mar 15, 2011 · 1 comment
Closed

Using forward slash when editing PHP crashes script. #42

CharlieSheather opened this issue Mar 15, 2011 · 1 comment

Comments

@CharlieSheather
Copy link

In the PHP demo here : http://codemirror.net/2/mode/php/ the following things happen around typing a forward slash:

  1. Outside of any code tags a forward slash will remove any indenting you have (tabs or spaces).
  2. When inside a tag (not php) a forward slash will:
    IF:
    Indentation in the above line is only using the tab character:
    Apply the same indentation of the above line to the current line.
    ELSE IF:
    Indentation in the above line has either spaces or both spaces and tabs:
    Apply what seems to be a random indentation depending somewhat on the line above.
    END.
  3. When inside a php tag if the auto indent tab character is already there and a forward slash is typed, indentation on that line is removed.
  4. When inside a php tag if YOU indent the code (either spaces or tab character or both) then type a forward slash the script crashes the page.

Google Chrome 10.0.648.133 (Official Build 77742) beta
WebKit 534.16 (branches/chromium/648@80788)
V8 3.0.12.30
User Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16

Cheers
Charlie
charlie@csent.org

@marijnh
Copy link
Member

marijnh commented Mar 15, 2011

Hi Charlie,

I found two indentation-related bugs (06540e3 and 6dc5d31) that were in play here, which caused the hangs and the weird indentation. The reaction to the slash key is caused by the fact that that key is considered 'electric' by the xml mode, meaning it might change the indentation of the current line, so the line is reindented when you type a slash. To turn this off, set the electricChars option to false.

Let me know whether this solved you problems.

Best,
Marijn

@marijnh marijnh closed this as completed Mar 17, 2011
alltom pushed a commit to alltom/CodeMirror that referenced this issue Aug 23, 2012
Make sure we remove the inline widget from our list of widgets before de...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants