Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation is messed up when using --pager flag #658

Open
HamzaBow opened this issue Nov 28, 2024 · 0 comments
Open

Indentation is messed up when using --pager flag #658

HamzaBow opened this issue Nov 28, 2024 · 0 comments

Comments

@HamzaBow
Copy link

Describe the bug
Indentation is messed up when using --pager flag

Setup

  • OS: WSL2 Ubuntu 24.04 - Windows 11
  • Shell: fish
  • Terminal Emulator: Windows Terminal
  • Terminal Multiplexer: tmux
  • Locale: UTF-8

To Reproduce
Steps to reproduce the behavior:
create a file that has lines that contain varying levels of indentation, e.g. a file that contains golang code. running glow ./filename.go --pager produces different indentation levels for lines that are supposed to be at the same indentation level.

Source Code
below is the content of the file I used:

package main

import (
	"fmt"
	"strconv"
)

func main() {
	// Example with an integer
	num := 42
	str := strconv.Itoa(num) // Convert integer to string
	fmt.Println("The number as a string is: \n" + str + "\n")

	// Example with a float
	floatNum := 3.14
	strFloat := strconv.FormatFloat(floatNum, 'f', -1, 64) // Convert float to string
	fmt.Println("The float as a string is: \n" + strFloat + "\n")
}

Expected behavior
Using the --pager flag should not produced inconsistent indentations, and it should just add a pager to the same content that one would have got if they didn't use the -pager flag.

Screenshots
Without --pager flag:
image

With --pager flag:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant