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

Topic/fix var diff string #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LFSaw
Copy link
Contributor

@LFSaw LFSaw commented Oct 30, 2019

interface to Steno requires prevTokens to be of type [Char].

Copy link
Collaborator

@telephon telephon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the long run, it would probably better to keep them in the same format instead of converting them fore and back. Would this be too much of a change?

@telephon
Copy link
Collaborator

telephon commented Nov 2, 2019

The thing is that in Steno, the tokens can also be words, not only chars. So the assumption that this is a string is problematic in the VarDiffString class.

@LFSaw
Copy link
Contributor Author

LFSaw commented Nov 2, 2019

I think you're right but I currently do not have the headspace to dive into this fairly complex code... In the long run, I'd prefer to not use the CLI diff at all but use Ron's versions (probably diff2 as a default...)

@LFSaw
Copy link
Contributor Author

LFSaw commented Nov 2, 2019

The thing is that in Steno, the tokens can also be words, not only chars. So the assumption that this is a string is problematic in the VarDiffString class.

Curious: How does one operate on non-char tokens with the Steno interface (t.("hello"))?

@telephon
Copy link
Collaborator

telephon commented Nov 3, 2019

You define a different preProcessor

t.preProcessor = nil; // remove default shortcuts
t.diff.tokenizer = { |str| str.split($ ) };

// then you can write

t.value("hello word word");

There is an example under preProcessor in the Steno helpfile.

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

Successfully merging this pull request may close these issues.

2 participants