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

Dealing with empty files #7

Open
romainrichard opened this issue Mar 21, 2017 · 0 comments
Open

Dealing with empty files #7

romainrichard opened this issue Mar 21, 2017 · 0 comments

Comments

@romainrichard
Copy link

Right now hicat doesn't handle empty files correctly while cat does:

$ touch some_file
$ cat some_file 
$ hicat some_file 
/usr/local/lib/node_modules/hicat/index.js:38
  if (!out || !out.value) throw new Error("failed to highlight");
                          ^

Error: failed to highlight
    at hicat (/usr/local/lib/node_modules/hicat/index.js:38:33)
    at /usr/local/lib/node_modules/hicat/bin/hicat:82:20
    at Array.forEach (native)
    at /usr/local/lib/node_modules/hicat/bin/hicat:77:9
    at read (/usr/local/lib/node_modules/hicat/lib/read.js:59:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/hicat/bin/hicat:75:1)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)

Would be great if this use case could be fixed.

@rstacruz rstacruz reopened this Apr 29, 2021
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

2 participants