In ST3 build 3059,
view.show_popup_menu() can show popup, it's great.
But the selecting behavior and popup makes something wrong.
Select text, show popup, then close/cancel popup, selection will be restored forcely.
the reproducible step is below.
2.wrap that region manually
3.when the stored region wrapped by selection(click red dot), fire "view.show_popup_menu()" internally.
4.popup appeared. choose something or cancel
6.the selection is still there (it's not problem yet.)
7.run view.sel().clear(), but it does not work. selections are still there.
after popup disappeared + view.sel.clear(), selection is still there.
when moving cursor, selection moves too. like "move cursor with shift key pressed".
Is this valid behavior?
I tried to arrange the order of API.
run no.7's operation via text_command,
but no effect.
finally I could clear selection like below.
1.store region by select text (same
2.wrap that region manually (same
3.when the stored region wrapped by selection(select dot), fire "view.sel.clear()"
4.wait 10 milli sec. selection disappeared in time.
6.choose something or cancel
8.no selection survive. nothing selected. looks good.
This only work fine with no.4. If no wait, produces pattern A.
It's too tricky but OK….
popup is verrrrry good feature.