boolean (Editor editor, int visibleWidthInPixels, int visibleHeightInPixels, int charWidthInPixels, boolean useCustomSoftWrapIndent) { editor.getSettings().setUseSoftWraps(true); editor.getSettings().setUseCustomSoftWrapIndent(useCustomSoftWrapIndent); SoftWrapModelImpl model = (SoftWrapModelImpl)editor.getSoftWrapModel(); model.setSoftWrapPainter(new SoftWrapPainter() { @Override public int paint(@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { return charWidthInPixels; } @Override public int getDrawingHorizontalOffset(@NotNull Graphics g, @NotNull SoftWrapDrawingType drawingType, int x, int y, int lineHeight) { return charWidthInPixels; } @Override public int getMinDrawingWidth(@NotNull SoftWrapDrawingType drawingType) { return charWidthInPixels; } @Override public boolean canUse() { return true; } @Override public void reinit() {} }); model.reinitSettings(); SoftWrapApplianceManager applianceManager = model.getApplianceManager(); applianceManager.setWidthProvider(new TestWidthProvider(visibleWidthInPixels)); setEditorVisibleSizeInPixels(editor, visibleWidthInPixels, visibleHeightInPixels); applianceManager.registerSoftWrapIfNecessary(); return !model.getRegisteredSoftWraps().isEmpty(); }