fixed unnecessary buffer creation

GoDoc keeps creating new buffers even when the buffer to reuse is already in place. This should fix this problem.