def _paint_margins(self, event):
font = QtGui.QFont(self.editor.font_name, self.editor.font_size +<EOL>self.editor.zoom_level)<EOL>metrics = QtGui.QFontMetricsF(font)<EOL>painter = QtGui.QPainter(self.editor.viewport())<EOL>for pos, pen in zip(self._positions, self._pens):<EOL><INDENT>if pos < <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>offset = self.editor.contentOffset().x() +self.editor.document().documentMargin()<EOL>x_pos = round(metrics.width('<STR_LIT:U+0020>') * pos) + offset<EOL>painter.setPen(pen)<EOL>painter.drawLine(x_pos, <NUM_LIT:0>, x_pos, <NUM_LIT:2> ** <NUM_LIT:16>)<EOL><DEDENT>
Paints the right margin after editor paint event.