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:
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
- --show-themes exit with error when no themes Fixes #587 — committed to dandavison/delta by dandavison 5 months ago
- --show-themes exit with error when no themes (#1611) Fixes #587 — committed to dandavison/delta by dandavison 5 months ago
Great.
plus-colorandminus-colorwent 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 nowplus-styleandminus-style.Incidentally, I think thereās a little flaw in the
show-themeslogic. I believe itās only listing themes that specify thelightordarkkey. Perhaps all themes should do that, but I believe this issue is causingshow-themesnot 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.