POE-ItemInfo icon indicating copy to clipboard operation
POE-ItemInfo copied to clipboard

Highlight items gets old values

Open Krzysiu opened this issue 5 years ago • 1 comments

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 avatar Nov 11 '18 00:11 Krzysiu

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

Krzysiu avatar Nov 11 '18 00:11 Krzysiu