Flush up to the current matchStart (match start is relative to the start of the current chunk so it's negative counting from the end of the buffer)
345072
function flush(writeTo) {
    var outputTo = bufferLen + matchStart - chunkLength;

    while (outputTo > 0 && outputTo > bufferStart) {
      if (outputTo > buffer[0].length-1) {
        var part = buffer.shift();
        outputBuffer.push(part.slice(bufferStart));

        bufferStart = Math.max(0, bufferStart - part.length);
        bufferLen -= part.length;
        outputTo -= part.length;
      } else {
        outputBuffer.push(buffer[0].slice(bufferStart, outputTo));
        bufferStart = outputTo;
        break;
      }
    }
    if (writeTo) {
      // Output everything ready as one chunk
      writeTo.push(outputBuffer.join(''));
      outputBuffer.length = 0;
    }
  }
951197
def _flush(self):
        
        # Flush buffer to specified range
        buffer = self._get_buffer()
        start = self._buffer_size * (self._seek - 1)
        end = start + len(buffer)

        future = self._workers.submit(
            self._flush_range, buffer=buffer, start=start, end=end)
        self._write_futures.append(future)
        future.add_done_callback(partial(self._update_size, end))
700352
function chunk(start, end) {
                // Slice, unescape and push onto result array.
                res.push(str.slice(start, end).replace(/\\\\/g, '\\').replace(/\\\./g, '.'));
                // Set starting position of next chunk.
                pos = end + 1;
            }
327356
def beginning_of_line(event):
    "  "
    buff = event.current_buffer
    buff.cursor_position += buff.document.get_start_of_line_position(after_whitespace=False)
1192049
def get_sync_start_position(self, document, lineno):
        "  "
        pattern = self._compiled_pattern
        lines = document.lines

        # Scan upwards, until we find a point where we can start the syntax
        # synchronisation.
        for i in range(lineno, max(-1, lineno - self.MAX_BACKWARDS), -1):
            match = pattern.match(lines[i])
            if match:
                return i, match.start()

        # No synchronisation point found. If we aren't that far from the
        # beginning, start at the very beginning, otherwise, just try to start
        # at the current line.
        if lineno < self.FROM_START_IF_NO_SYNC_POS_FOUND:
            return 0, 0
        else:
            return lineno, 0
1131905
def text_after(self, start, match_on):
        """"""
        text = ""
        index = start - 1
        while index > 0:
            text = self.code[index:start]
            if text.startswith(match_on):
                return text.lstrip(match_on)
            index -= 1

        return text.lstrip(match_on)
1267104
function flush () {
            var i = 0;
            while (i < fnQueueLen) {
                fn(fnQueue[i], fnQueue[i + 1]);
                fnQueue[i++] = $undefined;
                fnQueue[i++] = $undefined;
            }

            fnQueueLen = 0;
            if (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;
        }
322893
def erase_start_of_line (self): # <ESC>[1K
        ''''''

        self.fill_region (self.cur_r, 1, self.cur_r, self.cur_c)
1202698
def flush(max = nil)
      if ! @seekable
        toWrite = @buffer.length
        toWrite = max if max && max < @buffer.length
        numWritten = 0
        while toWrite > 0
          numWritten = @io.write_nonblock(@buffer[0,toWrite])
          raise Errno::EAGAIN if numWritten == 0
          @buffer = @buffer[numWritten,@buffer.length]
          toWrite -= numWritten
        end
      else
        while @buffer.length > 0
          @io.seek @buffer.first[0], IO::SEEK_SET
          while @buffer.first[1].length > 0
            numWritten = @io.write_nonblock(@buffer.first[1])
            raise Errno::EAGAIN if numWritten == 0
            @buffer.first[1] = @buffer.first[1][numWritten,@buffer.first[1].length]
          end
          # This chunk has been fully written. Remove it
          @buffer.shift
        end
      end
    end
670070
function flush() {
  if (queue.length) {
    let bench = queue[0]
    process.nextTick(() => {
      run(bench).then(() => {
        queue.shift()
        flush()
      }, console.error)
    })
  }
}
515184
private void checkInUseChunk(long p) {
    if (VALIDATING) {
      checkAnyChunk(p);
      if (!isInUse(p))
        throw new AssertionError("Chunk at " + p + " is not in use");
      if (!nextPreviousInUse(p))
        throw new AssertionError("Chunk after " + p + " does not see this chunk as in use");
      /* If not pinuse previous chunk has OK offset */
      if (!previousInUse(p) && nextChunk(prevChunk(p)) != p)
        throw new AssertionError("Previous chunk to " + p + " is marked free but has an incorrect next pointer");
    }
  }
1110436
def flush(flush = Zlib::SYNC_FLUSH)
      run '', flush unless flush == Zlib::NO_FLUSH

      detatch_output
    end
978129
private void skipPayload(int numBytes)
            throws IOException
    {
        while (true) {
            int bufferRemaining = buffer.size() - position;
            if (bufferRemaining >= numBytes) {
                position += numBytes;
                return;
            }
            else {
                position += bufferRemaining;
                numBytes -= bufferRemaining;
            }
            nextBuffer();
        }
    }
1193726
private void initHashArea()
    {
        /* Let's use small hash area of size 4, and one spill; don't
         * want too big (need to clear up room), nor too small (only
         * collisions)
         */
        mAttrHashSize = mAttrSpillEnd = 4;
        if (mAttrMap == null || mAttrMap.length < mAttrHashSize) {
            mAttrMap = new int[mAttrHashSize+1];
        }
        mAttrMap[0] =  mAttrMap[1] = mAttrMap[2] = mAttrMap[3] = 0;
        allocBuffers();
    }
1230738
function(newinput, bestmatch) {
		var matches = this._matches,
			oldindex = -1,
			oldrating = -1,
			newrating = edb.InputPlugin._rateone(newinput.type, bestmatch);
		matches.forEach(function oldbestmatch(match, i) {
			oldrating = edb.InputPlugin._rateone(match.type, bestmatch);
			if (oldrating > -1 && oldrating <= newrating) {
				oldindex = i;
			}
		});
		if (oldindex > -1) {
			matches[oldindex] = newinput;
		} else {
			matches.push(newinput);
		}
	}
925083
@Override
  protected void flushAndSync(boolean durable) throws IOException {
    if (fp == null) {
      throw new IOException("Trying to use aborted output stream");
    }
    preallocate(); // preallocate file if necessary
    if (doubleBuf.isFlushed()) {
      return;
    }
    doubleBuf.flushTo(fp);
    if (durable) {
      fc.force(false); // metadata updates not needed
    }
    fc.position(fc.position() - 1); // skip back the end-of-file marker
  }
1222853
def flush(self):
        '''
        
        '''
        # return if empty
        if self.__bufferidx == 0:
            return 
        # send here the data
        self.conn.send("%s\r\n" % hex(self.__bufferidx)[2:])
        self.conn.send("%s\r\n" % ''.join(self.__buffer[0:self.__bufferidx]))
        # reset buffer index = 0 (beginning of the buffer)
        self.__bufferidx = 0