private static int countLineOfCharPosition(int charPosition, String text) {
    int line = 0;
    int indexOf = 0;
    while ((indexOf = text.indexOf('\n', indexOf + 1)) > -1) {
      if (indexOf > charPosition) {
        break;
      }
      line++;
    }
    return line;
  }
Remove all markers
@param wrapTextComponent OtrosJTextWithRulerScrollPane
olv-gui/src/main/java/pl/otros/swing/rulerbar/RulerBarHelper.java