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

Problem in diff for lines starting with % #92

Open
PierreRust opened this issue Mar 27, 2019 · 4 comments
Open

Problem in diff for lines starting with % #92

PierreRust opened this issue Mar 27, 2019 · 4 comments

Comments

@PierreRust
Copy link

When displaying a diff (in status view), the output is wrong if the line starts with % .
This happens quite lot when editing latex files, whose comments start with %

For example, when adding a line like this :

% Simple Comment in a .tex file

grv displays this as a diff

%!S(MISSING)imple Comment in a .tex file

This seems to be an issue with go:fmt which tries to interpret % as a formatting command.

@PierreRust
Copy link
Author

I forgot to mention : this happens both with fancy and git diff-display modes

@vphantom
Copy link

vphantom commented Apr 3, 2019

It doesn't have to be at the beginning of a line. I have two mid-line examples of this:

  • "cut:x%" is displayed as "cut:x%!"(MISSING)
  • /^\s*cut:\s*([0-9.,]+)\s*(%)\s*$/; is displayed as /^\s*cut:\s*([0-9.,]+)\s*(%!)(MISSING)\s*$/;

My theory is the same as @PierreRust's.

@rgburke
Copy link
Owner

rgburke commented Apr 28, 2019

Thanks for reporting this issue. You're correct that it's due to a Sprintf interpreting anything starting with a % as a format specifier. This should now be fixed on master.

@vphantom
Copy link

Thanks @rgburke for looking into this. Is there any chance this fixed version could be released? I don't have a Go compilation environment.

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

3 participants