!76 修复 BUG 修复当打开关联文件时多出一行行号的问题
Merge pull request !76 from 格物方能致知/fix-I7ZE89
This commit is contained in:
commit
40e17cbe8c
@ -113,7 +113,10 @@ public class OpenFile implements EventHandler<ActionEvent> {
|
|||||||
StringBuilder textBuilder = new StringBuilder();
|
StringBuilder textBuilder = new StringBuilder();
|
||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
textBuilder.append(line).append("\n");
|
if (!textBuilder.isEmpty()) {
|
||||||
|
textBuilder.append("\n");
|
||||||
|
}
|
||||||
|
textBuilder.append(line);
|
||||||
}
|
}
|
||||||
String text = textBuilder.toString();
|
String text = textBuilder.toString();
|
||||||
LogUtil.getLogger(this.getClass()).info("已调用读取文件功能");
|
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 mainTextAreaScrollTop = mainTextArea.getScrollTop();
|
||||||
double lineNumberAreaScrollTop = lineNumberArea.getScrollTop();
|
double lineNumberAreaScrollTop = lineNumberArea.getScrollTop();
|
||||||
|
|
||||||
int numOfLines = mainTextArea.getParagraphs().size();
|
int numOfLines = mainTextArea.getParagraphs().size();
|
||||||
StringBuilder lineNumberText = new StringBuilder();
|
StringBuilder lineNumberText = new StringBuilder();
|
||||||
for (int i = 1; i <= numOfLines; i++) {
|
for (int i = 1; i <= numOfLines; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user