forked from vladimir-kotikov/clink-completions
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[git] Colored completions for
git checkout ...
with Clink v1.1.12 p…
…opup list (vladimir-kotikov#135) * [git] Optionally color the `*` in checkout completions. In Clink v1.1.9 and higher a match display filter can provide colored text. The `git checkout` match display filter now applies a color to the `*` next to preferred branch names. This change is written to be compatible with all versions of Clink. * [git] `git stash ...` works with `clink-popup-complete`. In Clink v1.1.12 and higher `clink.ondisplaymatches` lets a match generator supply descriptions associated with matches. This makes it possible for the `clink-popup-complete` command to show stash descriptions next to the stash IDs. This change is written to be compatible with all versions of Clink. * Add a version module and color helper. * Busted runs the modules scripts outside of Clink. The version module is meant to encapsulate Clink versioning, but it must do so without relying on Clink being present. * Restructure code to satisfy code coverage. It uses the short circuiting `and` operator to try to trick code coverage analysis into considering the line to have been executed even though it's impossible to execute. I could invest in building a mock infrastructure for this repo, but that's more cost than I'm willing to invest for this scenario. * Address additional PR feedback: - Rename the version module. - Compute all version checks during script exec and cache the results. - Add comment about Clink's color setting format being SGR params. * Exclude the renamed version module from codecov. * Address additional PR feedback: - Factor the colored star construction differently. * Fix typo. Somehow I renamed version module name in the require(), but accidentally undid the change in this copy of the file.
- Loading branch information
1 parent
a9b3134
commit dc590e8
Showing
6 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
return { | ||
include = { "modules/*" }, | ||
exclude = { "lua_modules/*", ".lua/*" }, | ||
exclude = { "lua_modules/*", ".lua/*", "modules/clink_version.lua" }, | ||
deletestats = false, | ||
runreport = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
local exports = {} | ||
|
||
-- Busted runs these modules scripts *outside* of Clink. | ||
-- So these Clink scripts have to work without any Clink APIs being available. | ||
clink = clink or {} | ||
|
||
local clink_version_encoded = clink.version_encoded or 0 | ||
|
||
exports.supports_display_filter_description = (clink_version_encoded >= 10010012) | ||
exports.supports_color_settings = (clink_version_encoded >= 10010009) | ||
exports.supports_query_rl_var = (clink_version_encoded >= 10010009) | ||
|
||
return exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters