Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/jmeter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,9 @@ beanshell.server.file=../extras/startup.bsh
#jsyntaxtextarea.codefolding=true
# Set 0 to disable undo feature in JSyntaxTextArea
#jsyntaxtextarea.maxundos=50
#jsyntaxtextarea.font.family=Hack
#jsyntaxtextarea.font.size=14


# Set this to false to disable the use of JSyntaxTextArea for the Console Logger panel
#loggerpanel.usejsyntaxtext=true
Expand Down
6 changes: 6 additions & 0 deletions src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

package org.apache.jmeter.gui.util;

import java.awt.Font;
import java.util.Properties;

import javax.swing.UIManager;

import org.apache.jmeter.util.JMeterUtils;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
Expand All @@ -39,6 +42,8 @@ public class JSyntaxTextArea extends RSyntaxTextArea {
private static final boolean LINE_WRAP = JMeterUtils.getPropDefault("jsyntaxtextarea.linewrap", true);
private static final boolean CODE_FOLDING = JMeterUtils.getPropDefault("jsyntaxtextarea.codefolding", true);
private static final int MAX_UNDOS = JMeterUtils.getPropDefault("jsyntaxtextarea.maxundos", 50);
private static final String USER_FONT_FAMILY = JMeterUtils.getPropDefault("jsyntaxtextarea.font.family", JSyntaxTextArea.getDefaultFont().getName());
private static final int USER_FONT_SIZE = JMeterUtils.getPropDefault("jsyntaxtextarea.font.size", JSyntaxTextArea.getDefaultFont().getSize());

@Deprecated
public JSyntaxTextArea() {
Expand Down Expand Up @@ -90,6 +95,7 @@ public JSyntaxTextArea(int rows, int cols, boolean disableUndo) {
super.setLineWrap(LINE_WRAP);
super.setWrapStyleWord(WRAP_STYLE_WORD);
this.disableUndo = disableUndo;
setFont(new Font(USER_FONT_FAMILY, Font.PLAIN, USER_FONT_SIZE));
if(disableUndo) {
// We need to do this to force recreation of undoManager which
// will use the disableUndo otherwise it would always be false
Expand Down