Skip to content

Commit

Permalink
Fix typo and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Sep 8, 2024
1 parent d4826a2 commit 44df926
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions oviewer/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ func (root *Root) ExpandColumn(ctx context.Context, cursor int) error {
// toggleColumnShrink shrinks or expands the current cursor column.
func (root *Root) toggleColumnShrink(ctx context.Context) {
cursor := root.Doc.columnCursor
shrink, err := root.Doc.isColumnShink(cursor)
shrink, err := root.Doc.isColumnShrink(cursor)
if err != nil {
root.setMessage(err.Error())
}
Expand All @@ -791,8 +791,8 @@ func (root *Root) toggleColumnShrink(ctx context.Context) {
}
}

// isColumnShink returns whether the specified column is shrink.
func (m *Document) isColumnShink(cursor int) (bool, error) {
// isColumnShrink returns whether the specified column is shrink.
func (m *Document) isColumnShrink(cursor int) (bool, error) {
if m.Converter != convAlign {
return false, ErrNotAlignMode
}
Expand Down
2 changes: 1 addition & 1 deletion oviewer/oviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ var (
// ErrEvictedMemory indicates that it has been evicted from memory.
ErrEvictedMemory = errors.New("evicted memory")
// ErrNotAlignMode indicates that it is not an align mode.
ErrNotAlignMode = errors.New("not align mode")
ErrNotAlignMode = errors.New("not an align mode")
// ErrNoColumnSelected indicates that no column is selected.
ErrNoColumnSelected = errors.New("no column selected")
)
Expand Down
1 change: 1 addition & 0 deletions oviewer/prepare_draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func (root *Root) setAlignConverter() {
}
m.alignConv.orgWidths = m.columnWidths
m.alignConv.maxWidths = maxWidths
// column attributes are inherited, so only the required columns are added.
for n := len(m.alignConv.columnAttrs); n < len(maxWidths)+1; n++ {
m.alignConv.columnAttrs = append(m.alignConv.columnAttrs, columnAttribute{})
}
Expand Down

0 comments on commit 44df926

Please sign in to comment.