Add treesitter-context
This commit is contained in:
17
lua/hardline/parts/treesitter-context.lua
Normal file
17
lua/hardline/parts/treesitter-context.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local ok, gps = pcall(require, "nvim-gps")
|
||||
if not ok then gps = nil end
|
||||
|
||||
local function get_context()
|
||||
if not gps or not gps.is_available() then
|
||||
return ""
|
||||
end
|
||||
return gps.get_location()
|
||||
end
|
||||
|
||||
local function get_item()
|
||||
return get_context()
|
||||
end
|
||||
|
||||
return {
|
||||
get_item = get_item,
|
||||
}
|
||||
Reference in New Issue
Block a user