Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Highlight items gets old values #121

Open
Krzysiu opened this issue Nov 11, 2018 · 1 comment
Open

Highlight items gets old values #121

Krzysiu opened this issue Nov 11, 2018 · 1 comment

Comments

@Krzysiu
Copy link

Krzysiu commented Nov 11, 2018

I don't know where exactly the problem lies, but often I got such problem:

  1. highlight X item
  2. X gets highlighted
  3. highlight Y item
  4. Y gets highlighted
  5. highlight Z item
  6. X (sic!) gets highlighted

There's some code which is described as "This prevents the highlighting function to fill search fields with data from previous item parsings", but that apparently doesn't work.

While I didn't find exact place where it's happening, I'm sure it's because the variable is global - the clipboard is replaced in 3rd point, so script somehow keeps info from 1st (and somewhere in between parsing/getting clipboard fails, so the old data is not replaced by new one). As this variable (parsed data/clipobard contents) is needed only to process it and then paste it into box, it should end its life when the function routine ends - there's no reason to pollute mainspace. As it's global, it persists and causes that problem.

The half-assed solution which would make use of global variable is just to "destroy" it (in fact impossible in AHK, so either empty contents [foo :=] or unallocate it [VarSetCapacity(foo,0)]) before use - this way even if other functions interfere, then it would be clean with every routine execution.

@Krzysiu
Copy link
Author

Krzysiu commented Nov 11, 2018

Additional note: sometimes it seems to use text which was copied outside POE and POE TM. I've just encountered something like that:

  1. copy "foo" to clipboard
  2. highlight X item
  3. "foo" is in the search box
  4. hl Y item
  5. X item is in the search box
  6. hl Z item
  7. Y is in the search box

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant