From e8a8350a37e675218d824567b90cca4afc51c480 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 5 Mar 2022 15:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtxt=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E5=8F=A5=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 5 +++++ .../java/io/legado/app/model/localBook/TextFile.kt | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 3b012ddbe..bb2d81d28 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,6 +11,11 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! +**2022/03/06** + +* 导入本地书籍界面添加排序功能 +* 修复txt最后一句不显示的bug + **2022/03/04** * 修复web端添加同步阅读配置导致的bug diff --git a/app/src/main/java/io/legado/app/model/localBook/TextFile.kt b/app/src/main/java/io/legado/app/model/localBook/TextFile.kt index 04625c2a5..1f52bdd4e 100644 --- a/app/src/main/java/io/legado/app/model/localBook/TextFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/TextFile.kt @@ -114,10 +114,12 @@ class TextFile(private val book: Book) { ).also { length = it } > 0 ) { var end = bufferStart + length - for (i in bufferStart + length - 1 downTo 0) { - if (buffer[i] == blank) { - end = i - break + if (end == bufferSize) { + for (i in bufferStart + length - 1 downTo 0) { + if (buffer[i] == blank) { + end = i + break + } } } //将数据转换成String, 不能超过length