-
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.
- Loading branch information
1 parent
0c1e37b
commit 80508a4
Showing
11 changed files
with
121 additions
and
124 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
Binary file not shown.
Binary file not shown.
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
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,18 +1,18 @@ | ||
local M = {} | ||
local highlights = require('slimline.highlights') | ||
local utils = require('slimline.utils') | ||
local config = require('slimline').config | ||
|
||
--- @param config table | ||
--- @param sep {left: string, right: string} | ||
--- @return string | ||
function M.render(config, sep) | ||
function M.render(sep) | ||
local mode = utils.get_mode() | ||
local render = mode | ||
if config.verbose_mode == false then | ||
render = string.sub(mode, 1, 1) | ||
end | ||
local content = ' ' .. render .. ' ' | ||
return highlights.hl_content(content, highlights.get_mode_hl(mode), sep.left, sep.right) | ||
local hl = highlights.get_mode_hl(mode) | ||
return highlights.hl_component({ primary = render }, hl, sep, 'right') | ||
end | ||
|
||
return M |
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,20 +1,19 @@ | ||
local M = {} | ||
local highlights = require('slimline.highlights') | ||
local config = require('slimline').config | ||
|
||
--- @param config table | ||
--- @param sep {left: string, right: string} | ||
--- @return string | ||
function M.render(config, sep) | ||
local file = highlights.hl_content(' ' .. vim.fn.expand('%:t') .. ' %m%r', highlights.hls.primary.text, sep.left) | ||
file = file .. highlights.hl_content(config.sep.right, highlights.hls.primary.sep_transition) | ||
function M.render(sep) | ||
local file = vim.fn.expand('%:t') .. '%m%r' | ||
|
||
local path = vim.fs.normalize(vim.fn.expand('%:.:h')) | ||
if #path == 0 then | ||
return '' | ||
end | ||
path = highlights.hl_content(' ' .. config.icons.folder .. path .. ' ', highlights.hls.secondary.text, nil, sep.right) | ||
path = config.icons.folder .. path | ||
|
||
return file .. path | ||
return highlights.hl_component({primary = file, secondary = path}, highlights.hls, sep, 'right') | ||
end | ||
|
||
return M |
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
Oops, something went wrong.