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

`tco -d` error #3

Closed
brandonpittman opened this Issue Apr 2, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@brandonpittman

brandonpittman commented Apr 2, 2014

Method missing error for tco -d

undefined method `-' for nil:NilClass

@pazdera

This comment has been minimized.

Show comment
Hide comment
@pazdera

pazdera Apr 2, 2014

Owner

Hi Brandon, thanks for your bug report. I've looked into that an I think I know what that is. I'll push the fix probably tonight :-). I'll let you know when it's done.

Owner

pazdera commented Apr 2, 2014

Hi Brandon, thanks for your bug report. I've looked into that an I think I know what that is. I'll push the fix probably tonight :-). I'll let you know when it's done.

@pazdera pazdera added the bug label Apr 2, 2014

@pazdera pazdera self-assigned this Apr 2, 2014

@chip

This comment has been minimized.

Show comment
Hide comment
@chip

chip Apr 4, 2014

Contributor

I haven't had time to debug it yet, but it appears that c is nil on line 123 of Tco.display_palette.

Using pry I was able to get this:

undefined method `-' for nil:NilClass
/Users/chip/code/tco/lib/tco.rb:123:in `block in display_palette'
/Users/chip/code/tco/lib/tco.rb:119:in `times'
/Users/chip/code/tco/lib/tco.rb:119:in `display_palette'
./bin/tco:100:in `<main>'

I hope that helps.

Contributor

chip commented Apr 4, 2014

I haven't had time to debug it yet, but it appears that c is nil on line 123 of Tco.display_palette.

Using pry I was able to get this:

undefined method `-' for nil:NilClass
/Users/chip/code/tco/lib/tco.rb:123:in `block in display_palette'
/Users/chip/code/tco/lib/tco.rb:119:in `times'
/Users/chip/code/tco/lib/tco.rb:119:in `display_palette'
./bin/tco:100:in `<main>'

I hope that helps.

@pazdera

This comment has been minimized.

Show comment
Hide comment
@pazdera

pazdera Apr 4, 2014

Owner

Hi Chip,
Thank you for your insights! The problem is that the part of the palette with the ANSI colours is not initialised. That is because they're values are configurable in most terminal and people often change them. Tco cannot use them, the colour matching would be very inaccurate when you don't know the exact values of the colours used.

Normally not configuring them means, that they're not considered for matching at all, but this part of the code requests explicitly displaying all the colours in the palette.

If you would like to get around the issue before it gets fix, you can set the ANSI colours in the ~/.tco.conf file to the values you use in your terminal:

---
palette: "extended"

colour_values:
    "@0": "#3b3b3b"
    "@1": "#cf6a4c"
    "@2": "#99ad6a"
    "@3": "#d8ad4c"
    "@4": "#597bc5"
    "@5": "#a037b0"
    "@6": "#71b9f8"
    "@7": "#adadad"

    "@8": "#555555"
    "@9": "#ff5555"
    "@10": "#55ff55"
    "@11": "#ffff55"
    "@12": "#5555ff"
    "@13": "#ff55ff"
    "@14": "#55ffff"
    "@15": "#ffffff"
Owner

pazdera commented Apr 4, 2014

Hi Chip,
Thank you for your insights! The problem is that the part of the palette with the ANSI colours is not initialised. That is because they're values are configurable in most terminal and people often change them. Tco cannot use them, the colour matching would be very inaccurate when you don't know the exact values of the colours used.

Normally not configuring them means, that they're not considered for matching at all, but this part of the code requests explicitly displaying all the colours in the palette.

If you would like to get around the issue before it gets fix, you can set the ANSI colours in the ~/.tco.conf file to the values you use in your terminal:

---
palette: "extended"

colour_values:
    "@0": "#3b3b3b"
    "@1": "#cf6a4c"
    "@2": "#99ad6a"
    "@3": "#d8ad4c"
    "@4": "#597bc5"
    "@5": "#a037b0"
    "@6": "#71b9f8"
    "@7": "#adadad"

    "@8": "#555555"
    "@9": "#ff5555"
    "@10": "#55ff55"
    "@11": "#ffff55"
    "@12": "#5555ff"
    "@13": "#ff55ff"
    "@14": "#55ffff"
    "@15": "#ffffff"
@chip

This comment has been minimized.

Show comment
Hide comment
@chip

chip Apr 4, 2014

Contributor

@pazdera - Thanks, that worked! 👍

Contributor

chip commented Apr 4, 2014

@pazdera - Thanks, that worked! 👍

@pazdera pazdera closed this in a3bff18 Apr 24, 2014

@pazdera

This comment has been minimized.

Show comment
Hide comment
@pazdera

pazdera Apr 24, 2014

Owner

I finally got around to fix this one. Sorry about the delay. I also pushed out 0.1.1 with this fix, so it should work when you update :-).

Owner

pazdera commented Apr 24, 2014

I finally got around to fix this one. Sorry about the delay. I also pushed out 0.1.1 with this fix, so it should work when you update :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment