mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-10 17:40:59 +00:00
Merge pull request #389 from dsnet/master
fix offset calculation for column ruler
This commit is contained in:
commit
095e6993a8
1 changed files with 3 additions and 5 deletions
|
|
@ -38,7 +38,7 @@ type View struct {
|
|||
// Specifies whether or not this view holds a help buffer
|
||||
Type ViewType
|
||||
|
||||
// Actual with and height
|
||||
// Actual width and height
|
||||
width int
|
||||
height int
|
||||
|
||||
|
|
@ -831,15 +831,13 @@ func (v *View) DisplayView() {
|
|||
}
|
||||
if screenX-v.x-v.leftCol+i >= v.lineNumOffset {
|
||||
colorcolumn := int(v.Buf.Settings["colorcolumn"].(float64))
|
||||
if colorcolumn != 0 && screenX-v.leftCol+i == colorcolumn-1 {
|
||||
if colorcolumn != 0 && screenX-v.lineNumOffset+i == colorcolumn-1 {
|
||||
if style, ok := colorscheme["color-column"]; ok {
|
||||
fg, _, _ := style.Decompose()
|
||||
lineStyle = lineStyle.Background(fg)
|
||||
}
|
||||
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
|
||||
} else {
|
||||
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
|
||||
}
|
||||
v.drawCell(screenX-v.leftCol+i, screenY, ' ', nil, lineStyle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue