Fix text item text issues

It behaved incorrectly if e.g. it was consisted from several leading
spaces. Now I calculate and force set the width and left margin, which
solves that problem.

Also it solves the problem with left-aligning CodeMirror. Now the text
from CodeMirror and the text rendered by React should always match