mirror of
https://github.com/dragonish/obsidian-heading-decorator.git
synced 2026-07-22 05:42:05 +00:00
fix(editing): fix last line in editing view not rendered
This commit is contained in:
parent
acac8fe60b
commit
9a599ef1e5
1 changed files with 4 additions and 4 deletions
|
|
@ -117,12 +117,12 @@ export class HeadingViewPlugin implements PluginValue {
|
|||
if (ordered && orderedIgnoreSingle) {
|
||||
const queier = new Querier(orderedAllowZeroLevel);
|
||||
const heading = new Heading();
|
||||
for (let lineIndex = 1; lineIndex < doc.lines; lineIndex++) {
|
||||
for (let lineIndex = 1; lineIndex <= doc.lines; lineIndex++) {
|
||||
const line = doc.line(lineIndex);
|
||||
const lineText = line.text;
|
||||
const nextLineIndex = lineIndex + 1;
|
||||
const nextLineText =
|
||||
nextLineIndex < doc.lines ? doc.line(nextLineIndex).text : "";
|
||||
nextLineIndex <= doc.lines ? doc.line(nextLineIndex).text : "";
|
||||
const level = heading.handler(lineIndex, lineText, nextLineText);
|
||||
if (level === -1) {
|
||||
continue;
|
||||
|
|
@ -147,12 +147,12 @@ export class HeadingViewPlugin implements PluginValue {
|
|||
});
|
||||
|
||||
const heading = new Heading();
|
||||
for (let lineIndex = 1; lineIndex < doc.lines; lineIndex++) {
|
||||
for (let lineIndex = 1; lineIndex <= doc.lines; lineIndex++) {
|
||||
const line = doc.line(lineIndex);
|
||||
const lineText = line.text;
|
||||
const nextLineIndex = lineIndex + 1;
|
||||
const nextLineText =
|
||||
nextLineIndex < doc.lines ? doc.line(nextLineIndex).text : "";
|
||||
nextLineIndex <= doc.lines ? doc.line(nextLineIndex).text : "";
|
||||
const level = heading.handler(lineIndex, lineText, nextLineText);
|
||||
if (level === -1) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue