JSyntaxHighlighter/LineNumbers.java
protected void checkLines(String text) {
		        int lines = 0;
		        int index = -1;
		
		        do {
		              lines++;
		              index = text.indexOf('\n', index + 1);
		        } while (index >= 0);
		                
		        if (lines != currentLines) {
		              currentLines = lines;
		              repaint();
		        }else{
		        	repaint();
		        }
		  }
/**
		   * Called by the DocumentListener methods to check if the number of lines
		   * has changed, and if it has, it updates the display.
		   *
		   * @param text the text to compare to the current text
		   */
Called by the DocumentListener methods to check if the number of lines
has changed, and if it has, it updates the display.

@param text the text to compare to the current text
Called by the DocumentListener methods to check if the number of lines has changed and if it has it updates the display . @param text the text to compare to the current text
protected void checkLines(String text) {
		        int lines = 0;
		        int index = -1;
		        do {
		              lines++;
		              index = text.indexOf('\n', index + 1);
		        } while (index >= 0);
		        if (lines != currentLines) {
		              currentLines = lines;
		              repaint();
		        }else{
		        	repaint();
		        }
		  }
protected void checkLines ( String text ) { int lines = 0 ; int index = - 1 ; do { lines ++ ; index = text . indexOf ( '\n' , index + 1 ) ; } while ( index >= 0 ) ; if ( lines != currentLines ) { currentLines = lines ; repaint ( ) ; } else { repaint ( ) ; } }
Called by the DocumentListener methods to check if the number of lines
 has changed, and if it has, it updates the display.
Called by the DocumentListener methods to check if the number of lines has changed and if it has it updates the display .