private List<FieldElement> convertToFieldElements(Program program, List<String> comments,
			AttributedString prefix, int row) {

		List<FieldElement> fieldElements = new ArrayList<>();
		if (comments.isEmpty()) {
			return fieldElements;
		}

		for (int commentRow = 0; commentRow < comments.size(); commentRow++) {
			int offsetRow = row + commentRow;
			fieldElements.add(CommentUtils.parseTextForAnnotations(comments.get(commentRow),
				program, prefix, offsetRow));
		}

		if (isWordWrap) {
			int lineWidth = showSemicolon ? width - prefix.getStringWidth() : width;
			fieldElements = FieldUtils.wrap(fieldElements, lineWidth);
		}

		if (showSemicolon) {
			for (int i = 0; i < fieldElements.size(); i++) {
				RowColLocation startRowCol =
					fieldElements.get(i).getDataLocationForCharacterIndex(0);
				int encodedRow = startRowCol.row();
				int encodedCol = startRowCol.col();
				FieldElement prefixElement = new TextFieldElement(prefix, encodedRow, encodedCol);
				fieldElements.set(i,
					new CompositeFieldElement(List.of(prefixElement, fieldElements.get(i))));
			}
		}
		return fieldElements;
	}
Set the max number of lines to display for EOL comments.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolCommentFieldFactory.java