-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
WIP: Add support for vertical header #679
Closed
+80
−15
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
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 |
---|---|---|
|
@@ -100,6 +100,11 @@ type SCR struct { | |
// sectionHeaderEnd is the end of the section header. | ||
sectionHeaderEnd int | ||
|
||
// numWidth is the width of the number. | ||
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. This comment is so bad, haha I hope it's an AI generated one 🤞 I'm sure something better than this could be suggested |
||
numberWidth int | ||
// verticalHeader is the width of the vertical header. | ||
verticalHeader int | ||
|
||
// x1, y1, x2, y2 are the coordinates selected by the mouse. | ||
x1 int | ||
y1 int | ||
|
@@ -147,6 +152,8 @@ type general struct { | |
TabWidth int | ||
// Header is number of header lines to be fixed. | ||
Header int | ||
// VerticalHeader is the number of vertical header lines. | ||
VerticalHeader int | ||
// SkipLines is the rows to skip. | ||
SkipLines int | ||
// WatchInterval is the watch interval (seconds). | ||
|
@@ -246,6 +253,9 @@ type Config struct { | |
StyleOverStrike OVStyle | ||
// StyleOverLine is a style that applies to overstrike underlines. | ||
StyleOverLine OVStyle | ||
// StyleVerticalHeader is a style that applies to the vertical header. | ||
StyleVerticalHeader OVStyle | ||
|
||
// General represents the general behavior. | ||
General general | ||
// BeforeWriteOriginal specifies the number of lines before the current position. | ||
|
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.
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.
Could you explain me this pattern?
The field is an integer, and so here you tell viper to complete the field will the value
1
, why 1? Why not []string{}Is it a way to complete with something that will help user to understand it's a number that is expected?
I had already looked at the code and I was surprised to see this
Here you are doing it again, either on purpose or by copy pasting code.
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.
This is still a temporary option, so it doesn't make much sense.
This indicates that an option argument requires numerical values (1 or more).
I thought that the blank ("") wouldn't know what to specify.
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.
I'll have to make my own test because it looks strange to me