Skip to content

Commit 33e3810

Browse files
committed
fix: row height seems to be broken in 3.0 #368
1 parent 43a9157 commit 33e3810

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ sourceSets {
5757
apply plugin: 'idea'
5858
idea {
5959
project {
60-
jdkName = JavaVersion.VERSION_11
61-
languageLevel = JavaVersion.VERSION_11
60+
jdkName = JavaVersion.VERSION_17
61+
languageLevel = JavaVersion.VERSION_17
6262
vcs = 'Git'
6363
}
6464
module {
@@ -79,7 +79,7 @@ apply plugin: 'org.jetbrains.intellij'
7979
intellij {
8080
version = idea_version
8181
type = System.getenv().getOrDefault('IDEA_TYPE', 'IC')
82-
pluginName = 'CSVEditor'
82+
pluginName = 'CSV Editor'
8383
updateSinceUntilBuild = true
8484
sameSinceUntilBuild = true
8585
downloadSources = Boolean.parseBoolean(System.getenv().getOrDefault('IDEA_SOURCES', "true"))

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@SuppressWarnings("all")
2525
public class CsvEditorSettings implements PersistentStateComponent<CsvEditorSettings.OptionSet> {
2626

27-
public static final int TABLE_EDITOR_ROW_HEIGHT_MIN = 10;
27+
public static final int TABLE_EDITOR_ROW_HEIGHT_MIN = 20;
2828
public static final int TABLE_EDITOR_ROW_HEIGHT_MAX = 100;
2929
public static final int TABLE_EDITOR_ROW_HEIGHT_DEFAULT = 48;
3030
public static final int TABLE_AUTO_MAX_COLUMN_WIDTH_DEFAULT = 300;
@@ -188,14 +188,13 @@ public void showTableEditorInfoPanel(boolean showInfoPanel) {
188188
}
189189

190190
public int getTableEditorRowHeight() {
191+
// ensure the current state of row height fits the boundaries (which is checked in the setTableEditorRowHeight method
192+
setTableEditorRowHeight(getState().TABLE_EDITOR_ROW_HEIGHT);
191193
return getState().TABLE_EDITOR_ROW_HEIGHT;
192194
}
193195

194196
public void setTableEditorRowHeight(int rowHeight) {
195-
int finalRowHeight = rowHeight;
196-
if (finalRowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX) finalRowHeight = TABLE_EDITOR_ROW_HEIGHT_MAX;
197-
if (finalRowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN) finalRowHeight = TABLE_EDITOR_ROW_HEIGHT_MIN;
198-
getState().TABLE_EDITOR_ROW_HEIGHT = finalRowHeight;
197+
getState().TABLE_EDITOR_ROW_HEIGHT = rowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX || rowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN ? TABLE_EDITOR_ROW_HEIGHT_DEFAULT : rowHeight;
199198
}
200199

201200
public boolean isQuotingEnforced() {

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProvider.form

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
132132
</constraints>
133133
<properties>
134-
<text value="Default row height (10-100):"/>
134+
<text value="Default row height in px (20-100):"/>
135135
</properties>
136136
</component>
137137
<hspacer id="48a70">
@@ -162,7 +162,7 @@
162162
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
163163
</constraints>
164164
<properties>
165-
<text value="Default column width (10 - 10000):"/>
165+
<text value="Default column width in px (10 - 10000):"/>
166166
</properties>
167167
</component>
168168
<component id="15921" class="javax.swing.JFormattedTextField" binding="tfDefaultColumnWidth" custom-create="true">
@@ -193,7 +193,7 @@
193193
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
194194
</constraints>
195195
<properties>
196-
<text value="Maximum column width (0 = no maximum):"/>
196+
<text value="Maximum column width in px (0 = no maximum):"/>
197197
</properties>
198198
</component>
199199
<component id="8554c" class="javax.swing.JFormattedTextField" binding="tfMaxColumnWidth" custom-create="true">

0 commit comments

Comments
 (0)