mirror of
https://github.com/akiyosi/goneovim.git
synced 2025-08-29 14:18:15 +02:00
go fmt
This commit is contained in:
parent
39eedc665c
commit
d15b0bb770
5 changed files with 70 additions and 69 deletions
|
@ -805,14 +805,14 @@ func (e *Editor) convertKey(event *gui.QKeyEvent) string {
|
||||||
c := ""
|
c := ""
|
||||||
if text == "" {
|
if text == "" {
|
||||||
|
|
||||||
if key == int(core.Qt__Key_Alt ) ||
|
if key == int(core.Qt__Key_Alt) ||
|
||||||
key == int(core.Qt__Key_AltGr ) ||
|
key == int(core.Qt__Key_AltGr) ||
|
||||||
key == int(core.Qt__Key_CapsLock) ||
|
key == int(core.Qt__Key_CapsLock) ||
|
||||||
key == int(core.Qt__Key_Control ) ||
|
key == int(core.Qt__Key_Control) ||
|
||||||
key == int(core.Qt__Key_Meta ) ||
|
key == int(core.Qt__Key_Meta) ||
|
||||||
key == int(core.Qt__Key_Shift ) ||
|
key == int(core.Qt__Key_Shift) ||
|
||||||
key == int(core.Qt__Key_Super_L ) ||
|
key == int(core.Qt__Key_Super_L) ||
|
||||||
key == int(core.Qt__Key_Super_R ) {
|
key == int(core.Qt__Key_Super_R) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
text = string(key)
|
text = string(key)
|
||||||
|
|
|
@ -693,7 +693,7 @@ func (w *Window) drawIndentguide(p *gui.QPainter, row, rows int) {
|
||||||
|
|
||||||
doPaintIndent := false
|
doPaintIndent := false
|
||||||
for mm := y; mm < len(w.content); mm++ {
|
for mm := y; mm < len(w.content); mm++ {
|
||||||
if drawIndents[[2]int{x+1, mm}] {
|
if drawIndents[[2]int{x + 1, mm}] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,8 +769,8 @@ func (w *Window) drawIndentguide(p *gui.QPainter, row, rows int) {
|
||||||
if !doPaintIndent {
|
if !doPaintIndent {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if !drawIndents[[2]int{x+1, mm}] {
|
if !drawIndents[[2]int{x + 1, mm}] {
|
||||||
drawIndents[[2]int{x+1, mm}] = true
|
drawIndents[[2]int{x + 1, mm}] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -780,20 +780,20 @@ func (w *Window) drawIndentguide(p *gui.QPainter, row, rows int) {
|
||||||
// detect current block
|
// detect current block
|
||||||
currentBlock := make(map[IntInt]bool)
|
currentBlock := make(map[IntInt]bool)
|
||||||
for x := w.s.cursor[1]; x >= 0; x-- {
|
for x := w.s.cursor[1]; x >= 0; x-- {
|
||||||
if drawIndents[[2]int{x+1, w.s.cursor[0]}] {
|
if drawIndents[[2]int{x + 1, w.s.cursor[0]}] {
|
||||||
for y := w.s.cursor[0]; y >= 0; y-- {
|
for y := w.s.cursor[0]; y >= 0; y-- {
|
||||||
if drawIndents[[2]int{x+1, y}] {
|
if drawIndents[[2]int{x + 1, y}] {
|
||||||
currentBlock[[2]int{x+1, y}] = true
|
currentBlock[[2]int{x + 1, y}] = true
|
||||||
}
|
}
|
||||||
if !drawIndents[[2]int{x+1, y}] {
|
if !drawIndents[[2]int{x + 1, y}] {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for y := w.s.cursor[0]; y < len(w.content); y++ {
|
for y := w.s.cursor[0]; y < len(w.content); y++ {
|
||||||
if drawIndents[[2]int{x+1, y}] {
|
if drawIndents[[2]int{x + 1, y}] {
|
||||||
currentBlock[[2]int{x+1, y}] = true
|
currentBlock[[2]int{x + 1, y}] = true
|
||||||
}
|
}
|
||||||
if !drawIndents[[2]int{x+1, y}] {
|
if !drawIndents[[2]int{x + 1, y}] {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -805,10 +805,10 @@ func (w *Window) drawIndentguide(p *gui.QPainter, row, rows int) {
|
||||||
// draw indent guide
|
// draw indent guide
|
||||||
for y := row; y < len(w.content); y++ {
|
for y := row; y < len(w.content); y++ {
|
||||||
for x := 0; x < w.maxLenContent; x++ {
|
for x := 0; x < w.maxLenContent; x++ {
|
||||||
if !drawIndents[[2]int{x+1, y}] {
|
if !drawIndents[[2]int{x + 1, y}] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if currentBlock[[2]int{x+1, y}] {
|
if currentBlock[[2]int{x + 1, y}] {
|
||||||
w.drawIndentline(p, x+1, y, true)
|
w.drawIndentline(p, x+1, y, true)
|
||||||
} else {
|
} else {
|
||||||
w.drawIndentline(p, x+1, y, false)
|
w.drawIndentline(p, x+1, y, false)
|
||||||
|
@ -890,10 +890,10 @@ func (w *Window) drawFloatWindowBorder(p *gui.QPainter) {
|
||||||
width := float64(w.widget.Width())
|
width := float64(w.widget.Width())
|
||||||
height := float64(w.widget.Height())
|
height := float64(w.widget.Height())
|
||||||
|
|
||||||
left := core.NewQRectF4( 0, 0, 1, height)
|
left := core.NewQRectF4(0, 0, 1, height)
|
||||||
top := core.NewQRectF4( 0, 0, width, 1)
|
top := core.NewQRectF4(0, 0, width, 1)
|
||||||
right := core.NewQRectF4(width-1, 0, 1, height)
|
right := core.NewQRectF4(width-1, 0, 1, height)
|
||||||
bottom := core.NewQRectF4( 0, height-1, width, 1)
|
bottom := core.NewQRectF4(0, height-1, width, 1)
|
||||||
|
|
||||||
p.FillRect4(
|
p.FillRect4(
|
||||||
left,
|
left,
|
||||||
|
@ -2487,7 +2487,7 @@ func (w *Window) fillBackground(p *gui.QPainter, y int, col int, cols int) {
|
||||||
|
|
||||||
bg = highlight.bg()
|
bg = highlight.bg()
|
||||||
|
|
||||||
bounds := col+cols
|
bounds := col + cols
|
||||||
if col+cols > len(line) {
|
if col+cols > len(line) {
|
||||||
bounds = len(line)
|
bounds = len(line)
|
||||||
}
|
}
|
||||||
|
@ -2872,8 +2872,8 @@ func (w *Window) drawTextDecoration(p *gui.QPainter, y int, col int, cols int) {
|
||||||
start := float64(x) * font.truewidth
|
start := float64(x) * font.truewidth
|
||||||
end := float64(x+1) * font.truewidth
|
end := float64(x+1) * font.truewidth
|
||||||
|
|
||||||
space := float64(font.lineSpace)/3.0
|
space := float64(font.lineSpace) / 3.0
|
||||||
if space > font.ascent / 3.0 {
|
if space > font.ascent/3.0 {
|
||||||
space = font.ascent / 3.0
|
space = font.ascent / 3.0
|
||||||
}
|
}
|
||||||
descent := float64(font.height) - font.ascent
|
descent := float64(font.height) - font.ascent
|
||||||
|
@ -2912,7 +2912,7 @@ func (w *Window) drawTextDecoration(p *gui.QPainter, y int, col int, cols int) {
|
||||||
}
|
}
|
||||||
freq := 1.0
|
freq := 1.0
|
||||||
phase := 0.0
|
phase := 0.0
|
||||||
Y := float64(y*font.lineHeight+w.scrollPixels[1]) + float64(font.ascent + descent*0.3) + float64(font.lineSpace/2) + space
|
Y := float64(y*font.lineHeight+w.scrollPixels[1]) + float64(font.ascent+descent*0.3) + float64(font.lineSpace/2) + space
|
||||||
Y2 := Y + amplitude*math.Sin(0)
|
Y2 := Y + amplitude*math.Sin(0)
|
||||||
point := core.NewQPointF3(start, Y2)
|
point := core.NewQPointF3(start, Y2)
|
||||||
path := gui.NewQPainterPath2(point)
|
path := gui.NewQPainterPath2(point)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
"github.com/therecipe/qt/gui"
|
"github.com/therecipe/qt/gui"
|
||||||
|
@ -43,6 +43,7 @@ func ReflectToFloat(iface interface{}) float64 {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsZero determines if the value of interface{} is zero
|
// IsZero determines if the value of interface{} is zero
|
||||||
func IsZero(d interface{}) bool {
|
func IsZero(d interface{}) bool {
|
||||||
if d == nil {
|
if d == nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue