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

Bug when pasting multiple lines into a textfield #4

Closed
doekman opened this issue Sep 3, 2020 · 1 comment
Closed

Bug when pasting multiple lines into a textfield #4

doekman opened this issue Sep 3, 2020 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@doekman
Copy link
Owner

doekman commented Sep 3, 2020

Pashua has a bug, when you paste multiple lines into a textfield (see: BlueM/Pashua#19).

Pashua will choke on it, when a secundary line contains an empty line or starts with an equal-sign. Error text 1 thru -1 of "" kan niet worden opgevraagd.

And it will return some nonsense entries otherwise. Paste this text (without the last line ending) into a control named name:

Line one
Line two
Line=three
name=four

This will return the following partial record:

{
    |line|:"three",
    |line two|:"Line two",
    |name|:"four"
}

An additional line without equal-sign will have the same key as value (line two). When a key-name already exists (name), it will get overwritten. Otherwise the handling is normal (line).

Expected behaviour

Since I can't change Pashua, I think the best course of action is to ignore lines without a key (including lines starting with an equal-sign), and don't overwrite entries in the dictionary (Pashua normally wouldn't output duplicate keys).

An other way to handle this, is to supply a set of expected control id's. Or to generate them from the input. I hope that won't be necessary.

@doekman doekman added the bug Something isn't working label Sep 3, 2020
@doekman doekman added this to the v0.5 milestone Sep 3, 2020
@doekman
Copy link
Owner Author

doekman commented Sep 3, 2020

Fixed. The result partial record is now:

{
    |line|:"three",
    |name|:"Line one"
}

The line Line=three will produce a record-entry. Not to big of a problem. The control wil return the first line.

@doekman doekman closed this as completed Sep 3, 2020
doekman added a commit that referenced this issue Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant