change variable char to character

This commit is contained in:
Ryan Mehta 2014-12-15 12:33:49 -08:00
commit dafa24d5e1

View file

@ -3,7 +3,7 @@
* *
* Copyright (c) 2010, Ajax.org B.V. * Copyright (c) 2010, Ajax.org B.V.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
@ -14,7 +14,7 @@
* * Neither the name of Ajax.org B.V. nor the * * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -46,15 +46,15 @@ var MouseHandler = function(editor) {
new DefaultHandlers(this); new DefaultHandlers(this);
new DefaultGutterHandler(this); new DefaultGutterHandler(this);
new DragdropHandler(this); new DragdropHandler(this);
var focusEditor = function(e) { var focusEditor = function(e) {
// because we have to call event.preventDefault() any window on ie and iframes // because we have to call event.preventDefault() any window on ie and iframes
// on other browsers do not get focus, so we have to call window.focus() here // on other browsers do not get focus, so we have to call window.focus() here
if (!document.hasFocus || !document.hasFocus()) if (!document.hasFocus || !document.hasFocus())
window.focus(); window.focus();
editor.focus(); editor.focus();
}; };
var mouseTarget = editor.renderer.getMouseEventTarget(); var mouseTarget = editor.renderer.getMouseEventTarget();
event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click")); event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"));
event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove")); event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"));
@ -85,12 +85,12 @@ var MouseHandler = function(editor) {
editor.on("mousemove", function(e){ editor.on("mousemove", function(e){
if (_self.state || _self.$dragDelay || !_self.$dragEnabled) if (_self.state || _self.$dragDelay || !_self.$dragEnabled)
return; return;
var char = editor.renderer.screenToTextCoordinates(e.x, e.y); var character = editor.renderer.screenToTextCoordinates(e.x, e.y);
var range = editor.session.selection.getRange(); var range = editor.session.selection.getRange();
var renderer = editor.renderer; var renderer = editor.renderer;
if (!range.isEmpty() && range.insideStart(char.row, char.column)) { if (!range.isEmpty() && range.insideStart(character.row, character.column)) {
renderer.setCursorStyle("default"); renderer.setCursorStyle("default");
} else { } else {
renderer.setCursorStyle(""); renderer.setCursorStyle("");