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