Changeset 4959

Show
Ignore:
Timestamp:
11/01/09 14:14:07 (4 weeks ago)
Author:
auno
Message:

Fixed for linefeed cursor position. BugzID#102872

Location:
branches/greyhound/mt-static/codemirror
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • branches/greyhound/mt-static/codemirror/htmltest.html

    r4158 r4959  
    4646    path: "js/", 
    4747    continuousScanning: 500, 
    48     lineNumbers: true, 
    49     textWrapping: false 
     48    lineNumbers: true 
    5049  }); 
    5150</script> 
  • branches/greyhound/mt-static/codemirror/index.html

    r4932 r4959  
    7979<h2>Releases</h2> 
    8080 
    81 <p class="rel"><em>23-09-2009</em>: <a 
     81<p class="rel"><em>23-10-2009</em>: <a 
    8282href="http://marijn.haverbeke.nl/codemirror/codemirror-0.64.zip">Version 
    83830.64</a>: Solves some issues introduced by the paste-handling changes 
     
    158158release</a> or the current <a 
    159159href="http://marijn.haverbeke.nl/codemirror/codemirror-latest.zip">development 
    160 snapshot</a> as zip files, or use the <a 
    161 href="http://www.darcs.net/">darcs</a> version control system to get 
    162 the repository:</p> 
     160snapshot</a> as zip files, or use <a 
     161href="http://git-scm.com/">git</a> to get the repository:</p> 
    163162 
    164 <pre class="code">darcs get http://marijn.haverbeke.nl/codemirror</pre> 
     163<pre class="code">git clone http://marijn.haverbeke.nl/codemirror/.git</pre> 
    165164 
    166165<p>This second method is recommended if you are planning to hack on 
    167 CodeMirror &#x2015; it makes it easy to record your patches and share them 
    168 with me. To see the repository online, visit the <a 
    169 href="http://marijn.haverbeke.nl/darcsweb.cgi?r=CodeMirror">CodeMirror 
    170 darcsweb</a>.</p> 
     166CodeMirror &#x2015; it makes it easy to record your patches and share 
     167them with me. CodeMirror can also be found on GitHub: <a 
     168href="http://github.com/marijnh/CodeMirror">http://github.com/marijnh/CodeMirror</a>.</p> 
    171169 
    172170<h2>Support</h2> 
  • branches/greyhound/mt-static/codemirror/js/codemirror.js

    r4948 r4959  
    2727  // their meaning. 
    2828  setDefaults(CodeMirrorConfig, { 
     29    lang: "en", 
    2930    stylesheet: "", 
    3031    path: "", 
     
    114115      options.stylesheet = [options.stylesheet]; 
    115116 
    116     var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head>"]; 
     117    var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html lang=\""+options.lang+"\"><head>"]; 
    117118    // Hack to work around a bunch of IE8-specific problems. 
    118119    html.push("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>"); 
  • branches/greyhound/mt-static/codemirror/js/editor.js

    r4948 r4959  
    446446      container.style.whiteSpace = "nowrap"; 
    447447    } 
    448    } 
     448  } 
    449449 
    450450  function isSafeKey(code) { 
     
    458458      this.history.push(null, null, asEditorLines(code)); 
    459459      this.history.reset(); 
     460      this.contentChanged(); 
    460461    }, 
    461462 
     
    532533                        content); 
    533534      this.addDirtyNode(line); 
     535      this.contentChanged(); 
    534536      this.scheduleHighlight(); 
    535537    }, 
     
    563565      } 
    564566      this.addDirtyNode(line); 
     567      this.contentChanged(); 
    565568      this.scheduleHighlight(); 
    566569    }, 
     
    632635      var end = this.history.nodeAfter(to.node); 
    633636      this.history.push(from.node, end, lines); 
     637      this.contentChanged(); 
    634638      return {node: this.history.nodeBefore(end), 
    635639              offset: lastLine.length}; 
     
    779783    keyUp: function(event) { 
    780784      this.cursorActivity(isSafeKey(event.keyCode)); 
    781       if (event.keyCode == 13) 
    782         this.scheduleHighlight(); 
    783785    }, 
    784786 
     
    852854      if (this.highlight(pos, endOfLine(to, this.container), true, 20) === false) 
    853855        return false; 
     856      select.selectMarked(); 
    854857      return true; 
    855858    }, 
     
    10261029        this.selectionSnapshot = select.getBookmark(this.container); 
    10271030      } 
    1028       if (window.frameElement && window.frameElement.CodeMirror.updateNumbers) { 
    1029         window.frameElement.CodeMirror.updateNumbers(); 
    1030       } 
    10311031 
    10321032      var activity = this.options.cursorActivity; 
     
    10371037        if (activity) activity(cursor); 
    10381038        if (!safe) { 
     1039          this.contentChanged(); 
    10391040          this.addDirtyNode(cursor); 
    10401041        } 
     1042      } 
     1043    }, 
     1044 
     1045    contentChanged: function() { 
     1046      if (window.frameElement && window.frameElement.CodeMirror.updateNumbers) { 
     1047        window.frameElement.CodeMirror.updateNumbers(); 
    10411048      } 
    10421049    }, 
  • branches/greyhound/mt-static/codemirror/js/undo.js

    r4948 r4959  
    189189  notifyDirty: function(nodes) { 
    190190    forEach(nodes, method(this.editor, "addDirtyNode")) 
     191    this.editor.contentChanged(); 
    191192    this.editor.scheduleHighlight(); 
    192193  }, 
  • branches/greyhound/mt-static/codemirror/manual.html

    r4932 r4959  
    270270      This is most easily done by giving them both the same font and 
    271271      an absolute ('pt' or 'px') font size. This option defaults to 
    272       <code>false</code>. When enabling this, you have to disable 
    273       <code>textWrapping</code>, since the line numbers don't take 
    274       wrapped lines into account. Changeable with the 
     272      <code>false</code>. Changeable with the 
    275273      <code>setLineNumbers(on)</code> method.</dd> 
     274 
     275      <dt><code>lineNumberDelay</code>, 
     276      <code>lineNumberTime</code></dt><dd>When both line numbers are 
     277      and text wrapping are turned on, updating line numbers can be 
     278      expensive. These settings can be used to control how fast the 
     279      updating happens &#x2015; they work in the same way as 
     280      <code>passDelay</code> and <code>passTime</code>.</dd> 
    276281 
    277282      <dt><code>indentUnit</code></dt><dd>An integer that specifies