void refreshEditor() { int pageLength = (BYTES * COLS) * (H - 1); int visibleLength = _pos->row * (BYTES * COLS) + pageLength; int contentLength = pageLength; if (_len < visibleLength) { contentLength = pageLength + (_len - visibleLength); } char *content = (char*) malloc(sizeof(char) * contentLength); memcpy(content, _fileBuffer + (_pos->row * (BYTES * COLS)), contentLength); renderContent(content, contentLength); renderStatusbar(_filename, _len, _pos); }
void ContentWindowRenderer::render() { if(!window_) return; bool showWindowBorders = true; bool showZoomContext = false; if(g_configuration) { showWindowBorders = g_configuration->getOptions()->getShowWindowBorders(); showZoomContext = g_configuration->getOptions()->getShowZoomContext(); } renderContent(showZoomContext); if(showWindowBorders || window_->selected()) renderWindowBorder(); }