Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate rendering logic, update virtualtext behaviour (#24)
Currently, most of the rendering logic is present in the main file (https://github.com/yardnsm/vim-import-cost/blob/404e9647b31a20940d09c943ba2c69e31d68e50d/autoload/import_cost.vim), both the scratch buffer logic and the virtual text logic. This PR separates these into their on files. ### Also in this PR The main change was the refactoring, but more nice stuff were updated. * Updated virtual text method to be more stable. * Added an `:ImportCostClear` command to clean the virtual text in a given range. * Dropped the "auto" mode for the virtual text. The reason behind this is due to make this plugin non-interruptible and making it available only on demand. Users who still want this behaviour can take a snippet from the README. * Update the documentation a bit. * Added a custom highlight group for the virtual text called `ImportCostVirtualText`, whose default value if `NonText` (which is more appropriate than `LineNr` previously). The `g:import_cost_virtualtext_hl_group` option was removed. * Change default virtualtext prefix to ` > ` . This PR also updates the script to emit events on the fly, meaning you don't have to wait for the script to finish in order to view the imports, similarly to the VS Code plugin! When running the plugin, This will only affect when the virtual text feature is on. See it for yourself! ![ezgif-4-30d9b6b2a33b](https://user-images.githubusercontent.com/11786506/51088864-cb3a9900-176d-11e9-8f13-9deaaadb8fb5.gif)
- Loading branch information