Skip to content

class WrapCache public

A cache that stores the results of WrapStream. Utiltiy methods are provided to quickly fetch a subset of tokens Based on a given window's coordinates (canvas)

.diff public

returns range denoting the index of the changed lines

from 2 different strings.

#<<(token) public

Adds a token

Arguments

  • token - Hokusai::Util::Wrapped

Returns

Returns nothing

#selected_area_for_tokens(tokens, selector, options) public

Gets the area coordinates for a selection

to draw a text selection background.

Arguments

  • tokens - the result of WrapCache#tokens_for
  • selector - a Hokusai::Util::Selection object
  • options - kwargs options copy - boolean to copy selected tokens padding - a Hokusai::Padding object

Returns

Returns Hokusai::Util::WrapCachePayload

#tokens_for(canvas) public

Get cached tokens for a given Hokusai::Canvas

Arguments

  • canvas - a Hokusai::Canvas

Returns

Return Array(Hokusai::Util::Wrapped)