-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add a converter specified shortcut #625
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -373,6 +373,12 @@ const ( | |||||||||||||||||||||||
|
||||||||||||||||||||||||
var Shrink rune = '…' | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
// RawF is specifies converter shortcut for raw. | ||||||||||||||||||||||||
var RawF bool | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
// AlignF is specifies converter shortcut for align. | ||||||||||||||||||||||||
var AlignF bool | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need tgem to be exported |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
var ( | ||||||||||||||||||||||||
// ErrOutOfRange indicates that value is out of range. | ||||||||||||||||||||||||
ErrOutOfRange = errors.New("out of range") | ||||||||||||||||||||||||
|
@@ -700,6 +706,13 @@ func (root *Root) prepareRun(ctx context.Context) error { | |||||||||||||||||||||||
root.Screen.EnableMouse(MouseFlags) | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
if RawF { | ||||||||||||||||||||||||
root.General.Converter = convRaw | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
if AlignF { | ||||||||||||||||||||||||
root.General.Converter = convAlign | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic is strange to read. So AlignF "wins" vs RawF when present, right? Maybe this?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your comment. |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
if root.Config.ShrinkChar != "" { | ||||||||||||||||||||||||
Shrink = []rune(root.Config.ShrinkChar)[0] | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
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.