When read_config_synchronously = false, as the actions are often
generated before the JSON is read, when an action is executed,
it could overwrite an existing JSON config with a default one due to
opts.cspell being empty.
So first of all, this patch makes a fresh query to CONFIG_INFO_BY_CWD,
which allows actions to correctly reuse it if the async reading is done.
If the async reading is still in-progress, the misspelled word is cached
in CACHED_JSON_WORDS, and gets added with other cached words once the
reading is done.
When read_config_synchronously = false, as the actions are often generated before the JSON is read, when an action is executed, it could overwrite an existing JSON config with a default one due to opts.cspell being empty.
So first of all, this patch makes a fresh query to CONFIG_INFO_BY_CWD, which allows actions to correctly reuse it if the async reading is done.
If the async reading is still in-progress, the misspelled word is cached in CACHED_JSON_WORDS, and gets added with other cached words once the reading is done.