🐛 修复 BUG 修复当打开关联文件时多出一行行号的问题
This commit is contained in:
parent
dd096bf448
commit
8da72722f0
@ -113,7 +113,10 @@ public class OpenFile implements EventHandler<ActionEvent> {
|
||||
StringBuilder textBuilder = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
textBuilder.append(line).append("\n");
|
||||
if (!textBuilder.isEmpty()) {
|
||||
textBuilder.append("\n");
|
||||
}
|
||||
textBuilder.append(line);
|
||||
}
|
||||
String text = textBuilder.toString();
|
||||
LogUtil.getLogger(this.getClass()).info("已调用读取文件功能");
|
||||
|
||||
@ -135,6 +135,7 @@ public class TopMenuBar extends MenuBar {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化菜单栏
|
||||
*/
|
||||
|
||||
@ -122,7 +122,6 @@ public class LineNumberTextArea extends BorderPane {
|
||||
*/
|
||||
double mainTextAreaScrollTop = mainTextArea.getScrollTop();
|
||||
double lineNumberAreaScrollTop = lineNumberArea.getScrollTop();
|
||||
|
||||
int numOfLines = mainTextArea.getParagraphs().size();
|
||||
StringBuilder lineNumberText = new StringBuilder();
|
||||
for (int i = 1; i <= numOfLines; i++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user