Implement common number of opened documents

Implement common number of opened documents issue #194