context: function refreshBufferList(n, src) {    // display only the current buffer (textarea)    // show labels for each buffer    // short-circuit if the buffer doesn't exist    if (getBuffer(n) == null)        return;    // labels are stored in divs in a table cell    var labelsNode = document.getElementById(g_cq_bufferlist_id);    removeChildNodes(labelsNode);    // create an explicit tbody for the DOM (Mozilla needs this)    var tableBody = document.createElement('tbody');    labelsNode.appendChild(tableBody);    // 0 will return false, will set to 0: ok    if (n == null) {        if (g_cq_buffer_current == null) {            n = g_cq_buffer_current;        } else {            n = 0;        }    }    var theBuffer = getBuffer();    // remember the current caret position    if (theBuffer.selectionStart) {        g_cq_carets[g_cq_buffer_current] = theBuffer.selectionStart;        debug.print("remembering buffer " + g_cq_buffer_current                    + " caret position " + g_cq_carets[i]);    }    // for gecko, handle disappearing-cursor weirdness?    // https://bugzilla.mozilla.org/show_bug.cgi?id=215724    theBuffer.blur();    // hide current, to avoid flashing    hide(theBuffer);    g_cq_buffer_current = n;    debug.print("refreshBufferList: from " + src                + ", show " + g_cq_buffer_current);    // parent of all the textareas    var theParent = document.getElementById(g_cq_buffers_area_id);    // childNodes.length will return some non-buffer elements, too!    for (var i = 0; i < theParent.childNodes.length; i++) {        //debug.print("refreshBufferList: i = " + i + " of " + theParent.childNodes.length);        theBuffer = getBuffer(i);        // not there? skip it        if (theBuffer != null) {          writeBufferLabel(tableBody, i);          // set up handlers to update line-number display          if (! theBuffer.onfocus)              theBuffer.onfocus = setLineNumberStatus;          if (! theBuffer.onclick)              theBuffer.onclick = setLineNumberStatus;          if (! theBuffer.onkeyup)              theBuffer.onkeyup = setLineNumberStatus;          // show the current buffer only, and put the cursor there          if (i == g_cq_buffer_current) {              show(theBuffer);              theBuffer.focus();              if (theBuffer.selectionStart) {                  if (g_cq_carets[i] == null) {                      g_cq_carets[i] = theBuffer.value.length;                  }                  debug.print("restoring caret position " + g_cq_carets[i]);                  theBuffer.selectionStart = g_cq_carets[i];                  theBuffer.selectionEnd = g_cq_carets[i];              }              setLineNumberStatus();          } else {              hide(theBuffer);          }        }    } // for buffers} // refreshBufferList
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/4a2633599ca5757bb9f9b09e8a112efe67781fe2/cq.js/buggy/cq.js