Skip to content

🐛 --show-themes errs with Pattern not found (press RETURN) #587

@vassudanagunta

Description

@vassudanagunta

I'm invoking delta as follows:

git --no-pager diff SQUASHED^^^^ SQUASHED^^^ | delta --show-themes

This results in:

Screen Shot 2021-05-04 at 2 24 56 PM

If I press RETURN or any other key, it enters an empty pager.

raw `git diff`
git --no-pager diff SQUASHED^^^^ SQUASHED^^^ 

diff --git a/textplain/blockTreeParser.ts b/textplain/blockTreeParser.ts
index 9e2f3ac..228cac3 100644
--- a/textplain/blockTreeParser.ts
+++ b/textplain/blockTreeParser.ts
@@ -111,7 +111,7 @@ export class BlockTreeParser {
         this._parseFront = new ParseFront(src, this._irRoot)
     }
 
-    get currentContainer (): ir.Block {
+    get currentIRContainer (): ir.Block {
         return this._parseFront.curPContainer.irContainer
     }
 
@@ -127,7 +127,7 @@ export class BlockTreeParser {
             // uncomment and use this line to trigger the debugger at a certain line
             //if (this._parseFront.lineRemainingContent() === '- * * *\n') debugger
 
-            this.parseContainerContinuation()
+            this.parsePContainerContinuation()
 
             if (front.curLineResolved()) {
                 // continue
@@ -223,7 +223,7 @@ export class BlockTreeParser {
      * If lazy continuation is enabled, it sets `_curLazyContainer` as
      * appropriate.
      */
-    parseContainerContinuation (): void {
+    parsePContainerContinuation (): void {
         const line = this._parseFront.curLine
 
         // match (non-lazy) continuing containers
@@ -361,7 +361,7 @@ export class BlockTreeParser {
             console.log(`new chunk: style=${chunkStyle.name}  ire=${(chunkStyle.irNode.type)}`);
             (result.irBlock.source as ptss.Block).lineStart = firstLine.num;
             (result.irBlock.source as ptss.Block).lineEnd = result.endLine.num
-            appendBlockContent(this.currentContainer, result.irBlock)
+            appendBlockContent(this.currentIRContainer, result.irBlock)
         }
         if (result.irRef) {
             console.log('new ref:', result.irRef)
@@ -392,7 +392,7 @@ export class BlockTreeParser {
         console.log(`new container: style=${containerStyle.name}  ire=${containerStyle.irNode.type}`);
         (result.irBlock.source as ptss.Block).lineStart = firstLine.num;
         (result.irBlock.source as ptss.Block).lineEnd = result.endLine.num
-        appendBlockContent(this.currentContainer, result.irBlock)
+        appendBlockContent(this.currentIRContainer, result.irBlock)
 
         if (result.irRef) {
             console.log('new ref:', result.irRef)
@@ -548,7 +548,7 @@ export class BlockTreeParser {
 
         console.log(`contentIndent:${contentIndent} offset:${line.ptr}`)
 
-        let irList = this.currentContainer.lastBodyBlock
+        let irList = this.currentIRContainer.lastBodyBlock
         if (!irList || irList.type != 'list' || !ptss.continuesList(irList, listOrdered, bulletChar, delimiter)) {
             const ptList = new ptss.Block(listStyle)
             ptList.listBulletChar = bulletChar
@@ -566,7 +566,7 @@ export class BlockTreeParser {
             irList.hints['commonmark.list.tight'] = true
 
             console.log(`starting new List: ordered:${listOrdered} bullet:${bulletChar} delim:${delimiter} start:${startNum}`)
-            appendBlockContent(this.currentContainer, irList)
+            appendBlockContent(this.currentIRContainer, irList)
         } else {
             console.log('adding to existing list')
 
@@ -574,11 +574,11 @@ export class BlockTreeParser {
             //  as a full fledged container in the ContainerStack. If
             //  it were, this logic would be taken care of in the normal
             //  this._parseFront.appendBlockContent call.
-            if ((this.currentContainer.source as ptss.Block).lastLineBlank) {
+            if ((this.currentIRContainer.source as ptss.Block).lastLineBlank) {
                 console.log('  set commonmark.list.tight to FALSE for list starting on line',
-                    (this.currentContainer.source as ptss.Block).lineStart)
+                    (this.currentIRContainer.source as ptss.Block).lineStart)
                 irList.hints['commonmark.list.tight'] = false;
-                (this.currentContainer.source as ptss.Block).lastLineBlank = false
+                (this.currentIRContainer.source as ptss.Block).lastLineBlank = false
             }
         }
 
@@ -622,7 +622,7 @@ export class BlockTreeParser {
 
         (result.irBlock.source as ptss.Block).lineStart = firstLine.num;
         (result.irBlock.source as ptss.Block).lineEnd = result.endLine.num
-        appendBlockContent(this.currentContainer, result.irBlock)
+        appendBlockContent(this.currentIRContainer, result.irBlock)
 
         // mark line resolved
         front.curLineConsume()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions