-
Notifications
You must be signed in to change notification settings - Fork 0
lua format #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chetmancini
wants to merge
1
commit into
master
Choose a base branch
from
keen-cheetah-071
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
lua format #41
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 +1,20 @@ | ||
| require("git"):setup() | ||
|
|
||
|
|
||
| require("full-border"):setup { | ||
| -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED | ||
| type = ui.Border.ROUNDED, | ||
| } | ||
|
|
||
| require("full-border"):setup({ | ||
| -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED | ||
| type = ui.Border.ROUNDED, | ||
| }) | ||
|
|
||
| function Linemode:size_and_mtime() | ||
| local time = math.floor(self._file.cha.mtime or 0) | ||
| if time == 0 then | ||
| time = "" | ||
| elseif os.date("%Y", time) == os.date("%Y") then | ||
| time = os.date("%b %d %H:%M", time) | ||
| else | ||
| time = os.date("%b %d %Y", time) | ||
| end | ||
| local time = math.floor(self._file.cha.mtime or 0) | ||
| if time == 0 then | ||
| time = "" | ||
| elseif os.date("%Y", time) == os.date("%Y") then | ||
| time = os.date("%b %d %H:%M", time) | ||
| else | ||
| time = os.date("%b %d %Y", time) | ||
| end | ||
|
|
||
| local size = self._file:size() | ||
| return string.format("%s %s", size and ya.readable_size(size) or "-", time) | ||
| local size = self._file:size() | ||
| return string.format("%s %s", size and ya.readable_size(size) or "-", time) | ||
| end | ||
|
|
This file contains hidden or 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,43 +1,43 @@ | ||
| --- @since 25.2.26 | ||
|
|
||
| local function setup(_, opts) | ||
| local type = opts and opts.type or ui.Border.ROUNDED | ||
| local old_build = Tab.build | ||
|
|
||
| Tab.build = function(self, ...) | ||
| local bar = function(c, x, y) | ||
| if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "│" then | ||
| return ui.Bar(ui.Edge.TOP) | ||
| end | ||
|
|
||
| return ui.Bar(ui.Edge.TOP) | ||
| :area( | ||
| ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) } | ||
| ) | ||
| :symbol(c) | ||
| end | ||
|
|
||
| local c = self._chunks | ||
| self._chunks = { | ||
| c[1]:pad(ui.Pad.y(1)), | ||
| c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)), | ||
| c[3]:pad(ui.Pad.y(1)), | ||
| } | ||
|
|
||
| local style = th.mgr.border_style | ||
| self._base = ya.list_merge(self._base or {}, { | ||
| ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), | ||
| ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style), | ||
| ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style), | ||
|
|
||
| bar("┬", c[1].right - 1, c[1].y), | ||
| bar("┴", c[1].right - 1, c[1].bottom - 1), | ||
| bar("┬", c[2].right, c[2].y), | ||
| bar("┴", c[2].right, c[2].bottom - 1), | ||
| }) | ||
|
|
||
| old_build(self, ...) | ||
| end | ||
| local type = opts and opts.type or ui.Border.ROUNDED | ||
| local old_build = Tab.build | ||
|
|
||
| Tab.build = function(self, ...) | ||
| local bar = function(c, x, y) | ||
| if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "│" then | ||
| return ui.Bar(ui.Edge.TOP) | ||
| end | ||
|
|
||
| return ui.Bar(ui.Edge.TOP) | ||
| :area( | ||
| ui.Rect({ x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) }) | ||
| ) | ||
| :symbol(c) | ||
| end | ||
|
|
||
| local c = self._chunks | ||
| self._chunks = { | ||
| c[1]:pad(ui.Pad.y(1)), | ||
| c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)), | ||
| c[3]:pad(ui.Pad.y(1)), | ||
| } | ||
|
|
||
| local style = th.mgr.border_style | ||
| self._base = ya.list_merge(self._base or {}, { | ||
| ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), | ||
| ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style), | ||
| ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style), | ||
|
|
||
| bar("┬", c[1].right - 1, c[1].y), | ||
| bar("┴", c[1].right - 1, c[1].bottom - 1), | ||
| bar("┬", c[2].right, c[2].y), | ||
| bar("┴", c[2].right, c[2].bottom - 1), | ||
| }) | ||
|
|
||
| old_build(self, ...) | ||
| end | ||
| end | ||
|
|
||
| return { setup = setup } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this workflow section,
JohnnyMorganz/stylua-action@v4is being used as an installer before the explicitmake stylua-checkstep, but the action's documented contract makesargsthe command it runs and says to useargs: falsefor install-only usage. Without that input, this step invokesstyluabefore line 43 rather than just adding it to PATH, so the smoke job can fail at the install step or mutate the workspace before the intended check. Addargs: falsehere, or pass the full--check ...arguments directly to this action.Useful? React with 👍 / 👎.