delta: šŸ› `--show-themes` errs with `Pattern not found (press RETURN)`

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()

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Great. plus-color and minus-color went through a ā€œdeprecation periodā€ for a year or so (at least in my mind, and for anyone paying attention to delta’s help text!) and are no longer supported: they are now plus-style and minus-style.

Incidentally, I think there’s a little flaw in the show-themes logic. I believe it’s only listing themes that specify the light or dark key. Perhaps all themes should do that, but I believe this issue is causing show-themes not to show all themes. If anyone feels like a bit of Rust development, do feel free to jump in there.

Ah, right. It’s occurring because you don’t have any themes loaded. You need to include the themes via your gitconfig; see https://dandavison.github.io/delta/custom-themes.html

I’ll re-open this to fix that output.