@Override
	public ListingField getField(ProxyObj<?> proxy, int varWidth) {
		Object obj = proxy.getObject();
		int x = startX + varWidth;
		if (!enabled || !(obj instanceof CodeUnit)) {
			return null;
		}
		CodeUnit cu = (CodeUnit) obj;
		Program program = cu.getProgram();

		//
		// If this code unit is the outside of a data container, then do not display any
		// comments if open.  If this was allowed, then the comment would appear
		// on the outside data container and on the 1st internal member
		//
		if (cu instanceof Data) {
			Data data = (Data) cu;
			if (data.getNumComponents() > 0) {
				boolean isOpen = proxy.getListingLayoutModel().isOpen((Data) proxy.getObject());
				if (isOpen) {
					return null; // avoid double showing
				}
			}
		}

		EolComments comments = new EolComments(cu, codeUnitFormatOptions.followReferencedPointers(),
			maxDisplayLines, extraCommentsOption);

		// This Code Unit's End of Line Comment
		List<FieldElement> elementList = new ArrayList<>();
		AttributedString prefix = createPrefix(CommentStyle.EOL);
		List<String> eols = comments.getEOLComments();
		List<FieldElement> eolElements = convertToFieldElements(program, eols, prefix, 0);
		elementList.addAll(eolElements);

		if (comments.isShowingRepeatables()) {
			prefix = createPrefix(CommentStyle.REPEATABLE);
			int row = getNextRow(elementList);
			List<String> repeatables = comments.getRepeatableComments();
			List<FieldElement> elements = convertToFieldElements(program, repeatables, prefix, row);
			elementList.addAll(elements);
		}

		if (comments.isShowingRefRepeatables()) {
			prefix = createPrefix(CommentStyle.REF_REPEATABLE);
			List<RefRepeatComment> refRepeatables = comments.getReferencedRepeatableComments();
			for (RefRepeatComment comment : refRepeatables) {
				int row = getNextRow(elementList);
				String[] lines = comment.getCommentLines();
				List<FieldElement> elements =
					convertToRefFieldElements(lines, program, prefix, comment.getAddress(), row);
				elementList.addAll(elements);
			}
		}

		if (comments.isShowingAutoComments()) {
			prefix = createPrefix(CommentStyle.AUTO);
			int row = getNextRow(elementList);
			List<String> autos = comments.getAutomaticComment();
			List<FieldElement> elements = convertToFieldElements(program, autos, prefix, row);
			elementList.addAll(elements);
		}

		if (comments.isShowingOffcutComments()) {
			prefix = createPrefix(CommentStyle.OFFCUT);
			int row = getNextRow(elementList);
			List<String> offcuts = comments.getOffcutEolComments();
			List<FieldElement> elements = convertToFieldElements(program, offcuts, prefix, row);
			elementList.addAll(elements);
		}

		if (elementList.isEmpty()) {
			return null;
		}
		return ListingTextField.createMultilineTextField(this, proxy, elementList, x, width,
			maxDisplayLines, hlProvider);
	}
Set the max number of lines to display for EOL comments.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolCommentFieldFactory.java