Closed sepich closed 8 years ago
Is the code excerpt you provided the one you actually used to produce this output?
The USER_BASE
constant serves as a reference for the plugin developer to define a new category.
Categories are declared on a per plugin base so the only rule is not to define a new category with an ID that's in the reserved range (i.e. new id must be in [USER_BASE, USER_MAX]
).
@sepich Is the code excerpt you provided the one you actually used to produce this output?
Yes, why? Complete file and ini if that matters: https://gist.github.com/sepich/f428cb55360d8fbc0aa1dd1d7cd5d0f9
Because the problem you exposed cannot be. Here is the output I got with v2.9.5 and the source code you shared:
Cat.Cat(26): DEBUG: On Start
Cat.Cat(29): DEBUG: On Catalog
Cat.Cat(38): DEBUG: 1002
Cat.Cat(51): DEBUG: On App Activated
Cat.Cat(43): DEBUG: On Suggest "t" (items_chain[0])
Cat.Cat(43): DEBUG: On Suggest "te" (items_chain[0])
Cat.Cat(43): DEBUG: On Suggest "tes" (items_chain[0])
Cat.Cat(43): DEBUG: On Suggest "test" (items_chain[0])
Cat.Cat(43): DEBUG: On Suggest "testc" (items_chain[0])
Cat.Cat(43): DEBUG: On Suggest "" (items_chain[1])
Cat.Cat(43): DEBUG: On Suggest "testc" (items_chain[0])
Cat.Cat(47): DEBUG: On Execute "test cat" (category: 1002)
And a dump of the item created by your plugin (Alt+Enter
):
Item properties:
label: test cat
args:
short_desc:
target: test
category: #1002 (1002)
args_hint: accepted
hit_hint: noargs
plugin: Cat.Cat
item_id: 12875778517861910943
loop_on_suggest: false
data_bag:
Just wanted to report a bug, but as you wish
21:12:41.957 Plugin loaded: Cat.Cat (instance #2)
21:12:41.992 Cat.Cat(26): DEBUG: On Start
21:12:41.996 Cat.Cat(29): DEBUG: On Catalog
21:12:41.997 Cat.Cat(38): DEBUG: 1002
21:12:44.078 Cat.Cat(51): DEBUG: On App Activated
21:12:47.656 Cat.Cat(43): DEBUG: On Suggest "t" (items_chain[0])
21:12:47.783 Cat.Cat(43): DEBUG: On Suggest "te" (items_chain[0])
21:12:47.998 Cat.Cat(43): DEBUG: On Suggest "tes" (items_chain[0])
21:12:48.087 Cat.Cat(43): DEBUG: On Suggest "test" (items_chain[0])
21:12:49.449 Cat.Cat(47): DEBUG: On Execute "test cat" (category: 1001)
21:12:49.462 Cat.Cat(54): DEBUG: On App Deactivated
21:12:52.428 Cat.Cat(51): DEBUG: On App Activated
21:12:52.703 Cat.Cat(43): DEBUG: On Suggest "t" (items_chain[0])
21:12:52.829 Cat.Cat(43): DEBUG: On Suggest "te" (items_chain[0])
21:12:53.006 Cat.Cat(43): DEBUG: On Suggest "tes" (items_chain[0])
21:12:54.951 Item properties:
label: test cat
args:
short_desc:
target: test
category: #1001 (1001)
args_hint: accepted
hit_hint: noargs
plugin: Cat.Cat
item_id: 10613152646933304601
loop_on_suggest: false
data_bag:
Item with category 1001
probably comes from the history, in which case you are testing the wrong item, in which case if you fully type the label of the item in the LaunchBox, you'll see 2 test cat
items.
Confirming that, after renaming Keypirinha.history
it started return 1002.
{
"args_hint" : "accepted",
"category" : "#1001",
"hit_hint" : "noargs",
"id" : 10613152646933304601,
"label" : "test cat",
"loop_on_suggest" : false,
"plugin" : "Cat.Cat",
"short_desc" : "",
"target" : "test"
}
That was unexpected. So choice is:
Ctrl+Del
might come handy during your tests.
Steps to reproduce: copy test plugin and fix methods like this
Result in console:
Desired result:
It would be nice to add more details to docs about those USER_BASE/USER_MAX. Novice questions per your note in #95