!91 修复 BUG 出现滚动条后,退格可能会导致行号错位
Merge pull request !91 from 格物方能致知/fix-I7UK2L
This commit is contained in:
commit
28db9f2950
4
pom.xml
4
pom.xml
@ -6,9 +6,9 @@
|
||||
|
||||
<groupId>org.jcnc</groupId>
|
||||
<artifactId>JNotepad</artifactId>
|
||||
<version>1.11.2-SNAPSHOT</version>
|
||||
<version>1.1.3-bate</version>
|
||||
<name>JNotepad</name>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
@ -25,7 +25,13 @@ import java.util.Map;
|
||||
public class PluginManager {
|
||||
private static final PluginManager INSTANCE = new PluginManager();
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
/**
|
||||
* 插件集合
|
||||
*/
|
||||
private final List<Plugin> plugins = new ArrayList<>();
|
||||
/**
|
||||
* 插件类别
|
||||
*/
|
||||
private final Map<String, List<String>> categories = new HashMap<>();
|
||||
|
||||
private PluginManager() {
|
||||
|
||||
@ -79,7 +79,6 @@ public class LineNumberTextArea extends BorderPane {
|
||||
|
||||
// 初始化监听器,用于处理事件
|
||||
initListeners();
|
||||
|
||||
// 将主文本区域设置为中央内容,将行号区域设置为左侧内容
|
||||
setCenter(mainTextArea);
|
||||
setLeft(lineNumberArea);
|
||||
@ -202,10 +201,13 @@ public class LineNumberTextArea extends BorderPane {
|
||||
// 循环迭代,生成行号文本,
|
||||
for (int i = 1; i <= numOfLines; i++) {
|
||||
// 将行号和换行符添加到字符串中
|
||||
lineNumberText.append(i).append("\n");
|
||||
lineNumberText.append(i);
|
||||
if (i != numOfLines) {
|
||||
lineNumberText.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
// 将生成的行号文本设置到行号区域
|
||||
// 将生成的行号文本设置到 行号区域
|
||||
lineNumberArea.setText(lineNumberText.toString());
|
||||
|
||||
// 恢复主文本区域的垂直滚动位置
|
||||
|
||||
@ -4,19 +4,21 @@
|
||||
-fx-vbar-policy: as-needed;
|
||||
}
|
||||
|
||||
/* 不显示滚动条 */
|
||||
/*!* 不显示滚动条 *!*/
|
||||
/*.text-line-number .content {*/
|
||||
/* -fx-cursor: text;*/
|
||||
/* -fx-padding: 8px 1px 8px 5px;*/
|
||||
/*}*/
|
||||
.text-line-number .content {
|
||||
-fx-cursor: text;
|
||||
-fx-padding: 8px 1px 8px 5px;
|
||||
}
|
||||
|
||||
.text-line-number .scroll-bar:vertical {
|
||||
-fx-pref-width: 1;
|
||||
-fx-opacity: 0;
|
||||
}
|
||||
|
||||
.text-line-number .scroll-bar:horizontal {
|
||||
-fx-pref-height: 1;
|
||||
-fx-pref-height: 10;
|
||||
-fx-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user