Skip to content

Commit

Permalink
Expose replaceCodes for more complex uses.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrthomas committed Feb 18, 2013
1 parent bed3ef5 commit 3579c55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ h2. Usage
print(colors('%{bright red underlined}hello'))
</pre>

The @colors@ function makes sure that color attributes are reset at each end of the generated string. If you want to generate complex strings piece-by-piece, use @colors.replaceCodes@, which works exactly the same, but without adding the reset codes at each end of the string.

h2. Testing

This application uses telescope in order to perform the tests. Install telescope, and then execute
Expand Down
2 changes: 1 addition & 1 deletion ansicolors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ local function ansicolors( str )
end


return ansicolors
return setmetatable({replaceCodes = replaceCodes}, {__call = ansicolors})

0 comments on commit 3579c55

Please sign in to comment.