id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c22200 | t.rview.SetView(view)
t.cview.SetView(view)
t.changed = true
} | |
c22201 | }
}
// Draw in reverse order -- if we clip, we will clip at the
// right side.
t.right.Draw()
t.center.Draw()
t.left.Draw()
} | |
c22202 | t.center.Resize()
t.right.Resize()
t.PostEventWidgetResize(t)
} | |
c22203 | wh > h {
h = wh
}
ww, wh = t.right.Size()
w += ww
if wh > h {
h = wh
}
return w, h
} | |
c22204 | ev.(type) {
case *EventWidgetContent:
t.changed = true
return true
}
return false
} | |
c22205 | := ColorValues[c]; ok {
return v
}
return -1
} | |
c22206 | 16) | ((g & 0xff) << 8) | (b & 0xff))
} | |
c22207 | i := range cb.cells {
cb.cells[i].lastMain = rune(0)
}
} | |
c22208 | {
return true
}
if c.lastStyle != c.currStyle {
return true
}
if len(c.lastComb) != len(c.currComb) {
return true
}
for i := range c.lastComb {
if c.lastComb[i] != c.currComb[i] {
return true
}
}
}
return false
} | |
c22209 | nc.currMain = oc.currMain
nc.currComb = oc.currComb
nc.currStyle = oc.currStyle
nc.width = oc.width
nc.lastMain = rune(0)
}
}
cb.cells = newc
cb.h = h
cb.w = w
} | |
c22210 | = r
c.currComb = nil
c.currStyle = style
c.width = 1
}
} | |
c22211 | == nil {
ww.watchers = make(map[tcell.EventHandler]struct{})
}
ww.watchers[handler] = struct{}{}
} | |
c22212 | != nil {
delete(ww.watchers, handler)
}
} | |
c22213 | listeners, ignoring return value.
watcher.HandleEvent(wev)
}
} | |
c22214 | &EventWidgetContent{}
ev.SetWidget(w)
ev.SetEventNow()
ww.PostEvent(ev)
} | |
c22215 | &EventWidgetResize{}
ev.SetWidget(w)
ev.SetEventNow()
ww.PostEvent(ev)
} | |
c22216 | &EventWidgetMove{}
ev.SetWidget(w)
ev.SetEventNow()
ww.PostEvent(ev)
} | |
c22217 | m.lines = append([]string{}, lines...)
for _, l := range lines {
if len(l) > m.width {
m.width = len(l)
}
}
ta.CellView.SetModel(m)
} | |
c22218 |
ta.model.cursor = on
} | |
c22219 | bool) {
ta.Init()
ta.model.hide = on
} | |
c22220 |
lines := strings.Split(strings.Trim(text, "\n"), "\n")
ta.SetLines(lines)
} | |
c22221 | ta.CellView.Init()
ta.CellView.SetModel(lm)
})
} | |
c22222 | t.align&VAlignBottom != 0 {
return height - len(t.lengths)
}
return 0
} | |
c22223 | t.align&HAlignRight != 0 {
return width - t.lengths[line]
}
return 0
} | |
c22224 | v.SetContent(x, y, r, comb, styl)
}
newline = true
w = 0
comb = nil
line++
y++
continue
}
if t.widths[i] == 0 {
comb = append(comb, l)
continue
}
if w != 0 {
v.SetContent(x, y, r, comb, styl)
x += w
}
r = l
w = t.widths[i]
styl = t.styles[i]
comb = nil
}
if w != 0 ... | |
c22225 | return t.width, t.height
}
return 0, 0
} | |
c22226 | align != t.align {
t.align = align
t.PostEventWidgetContent(t)
}
} | |
c22227 | copy(t.widths[i+1:], t.widths[i:])
t.widths[i] = 1
t.text = append(t.text, ' ')
copy(t.text[i+1:], t.text[i:])
t.text[i] = ' '
t.styles = append(t.styles, t.style)
copy(t.styles[i+1:], t.styles[i:])
t.styles[i] = t.style
length++
} else {
length += t.widths[i]
}
}
if length > 0 {
... | |
c22228 | < len(t.text); i++ {
if t.widths[i] != 0 {
t.styles[i] = t.style
}
}
t.PostEventWidgetContent(t)
} | |
c22229 | return tcell.StyleDefault
}
return t.styles[pos]
} | |
c22230 | string) {
s.initialize()
s.center.SetMarkup(m)
} | |
c22231 | != nil {
return e
} else if e = s.Init(); e != nil {
return e
} else {
screen = s
return nil
}
} | |
c22232 | := 0; row < h; row++ {
for col := 0; col < w; col++ {
screen.SetContent(col, row, ' ', nil, st)
}
}
} | |
c22233 | case OutputNormal, Output256, Output216, OutputGrayscale:
outMode = mode
return mode
default:
return outMode
}
} | |
c22234 |
return Event{Type: EventError, Err: errors.New("no raw events")}
} | |
c22235 | {
return &EventError{t: time.Now(), err: err}
} | |
c22236 | | styleFgSet))
}
return (s &^ Style(0x1ffffff00000000)) |
((Style(c) & 0x1ffffff) << 32) | styleFgSet
} | |
c22237 | (s &^ (0x1ffffff)) | (Style(c) & 0x1ffffff) | styleBgSet
} | |
c22238 | bg = Color(s & 0x1ffffff)
} else {
bg = ColorDefault
}
attr = AttrMask(s) & attrAll
return fg, bg, attr
} | |
c22239 | {
return s.setAttrs(Style(AttrBold), on)
} | |
c22240 | {
return s.setAttrs(Style(AttrBlink), on)
} | |
c22241 | {
return s.setAttrs(Style(AttrDim), on)
} | |
c22242 | {
return s.setAttrs(Style(AttrUnderline), on)
} | |
c22243 |
} else {
s = fmt.Sprintf("Key[%d,%d]", ev.key, int(ev.ch))
}
}
if len(m) != 0 {
if ev.mod&ModCtrl != 0 && strings.HasPrefix(s, "Ctrl-") {
s = s[5:]
}
return fmt.Sprintf("%s+%s", strings.Join(m, "+"), s)
}
return s
} | |
c22244 | }
// CIE94 is more accurate, but really really expensive.
nd := c1.DistanceCIE76(c2)
if math.IsNaN(nd) {
nd = math.Inf(1)
}
if match == ColorDefault || nd < dist {
match = d
dist = nd
}
}
return match
} | |
c22245 | srcv := acsstr[0]
dstv := string(acsstr[1])
if r, ok := vtACSNames[srcv]; ok {
t.acs[r] = t.ti.EnterAcs + dstv + t.ti.ExitAcs
}
acsstr = acsstr[2:]
}
} | |
c22246 | state++
case 4:
x = int(b[i]) - 32 - 1
state++
case 5:
y = int(b[i]) - 32 - 1
for i >= 0 {
buf.ReadByte()
i--
}
t.postMouseEvent(x, y, btn)
return true, true
}
}
return true, false
} | |
c22247 | {
b.cells[i].widget.Resize()
}
b.PostEventWidgetResize(b)
} | |
c22248 | b.style)
for i := range b.cells {
b.cells[i].widget.Draw()
}
} | |
c22249 | := range b.cells {
c.view.SetView(view)
}
} | |
c22250 | }
for _, c := range b.cells {
if c.widget.HandleEvent(ev) {
return true
}
}
return false
} | |
c22251 | view: NewViewPort(b.view, 0, 0, 0, 0),
}
widget.SetView(c.view)
b.cells = append(b.cells, c)
b.changed = true
widget.Watch(b)
b.layout()
b.PostEventWidgetContent(b)
} | |
c22252 |
if index < 0 {
index = 0
}
if index > len(b.cells) {
index = len(b.cells)
}
b.cells = append(b.cells, c)
copy(b.cells[index+1:], b.cells[index:])
b.cells[index] = c
widget.Watch(b)
b.layout()
b.PostEventWidgetContent(b)
} | |
c22253 |
}
if !changed {
return
}
b.changed = true
widget.Unwatch(b)
b.layout()
b.PostEventWidgetContent(b)
} | |
c22254 | 0, len(b.cells))
for _, c := range b.cells {
w = append(w, c.widget)
}
return w
} | |
c22255 | b.changed = true
b.PostEventWidgetContent(b)
}
} | |
c22256 | style
b.PostEventWidgetContent(b)
} | |
c22257 | | 0x0001)) != 0 {
mm |= ModAlt
}
// Any shift
if (cks & 0x0010) != 0 {
mm |= ModShift
}
return mm
} | |
c22258 | }
winLock.Unlock()
if vc, ok := vgaColors[c]; ok {
return vc
}
return 0
} | |
c22259 | << 4)
} else {
attr = fa
attr |= (ba << 4)
}
if a&AttrBold != 0 {
attr |= 0x8
}
if a&AttrDim != 0 {
attr &^= 0x8
}
if a&AttrUnderline != 0 {
// Best effort -- doesn't seem to work though.
attr |= 0x8000
}
// Blink is unsupported
return attr
} | |
c22260 | rune) tcell.Style {
return t.styles[r]
} | |
c22261 | ss.styles['U'] = tcell.StyleDefault.Underline(true)
ss.styles['B'] = tcell.StyleDefault.Bold(true)
return ss
} | |
c22262 | n(Vertical)
p.BoxLayout.Draw()
} | |
c22263 | nil {
p.RemoveWidget(p.title)
}
p.InsertWidget(0, w, 0.0)
p.title = w
} | |
c22264 | {
p.RemoveWidget(p.menu)
}
p.InsertWidget(index, w, 0.0)
p.menu = w
} | |
c22265 | != nil {
index++
}
if p.content != nil {
p.RemoveWidget(p.content)
}
p.InsertWidget(index, w, 1.0)
p.content = w
} | |
c22266 | if p.status != nil {
p.RemoveWidget(p.status)
}
p.InsertWidget(index, w, 0.0)
p.status = w
} | |
c22267 | vy := port.Size()
if ex < vx {
ex = vx
}
if ey < vy {
ey = vy
}
cx, cy, en, sh := a.model.GetCursor()
for y := 0; y < ey; y++ {
for x := 0; x < ex; x++ {
ch, style, comb, wid := model.GetCell(x, y)
if ch == 0 {
ch = ' '
style = a.style
}
if en && x == cx && y == cy && sh {
style = ... | |
c22268 | := a.model.GetCursor()
if enabled {
a.MakeVisible(x, y)
}
} | |
c22269 | case tcell.KeyPgDn:
a.keyPgDn()
return true
case tcell.KeyPgUp:
a.keyPgUp()
return true
case tcell.KeyEnd:
a.keyEnd()
return true
case tcell.KeyHome:
a.keyHome()
return true
}
}
return false
} | |
c22270 | 2x2 minimum square; we can scroll within that.
if w > 2 {
w = 2
}
if h > 2 {
h = 2
}
return w, h
} | |
c22271 | 0)
a.model = model
a.port.SetContentSize(w, h, true)
a.port.ValidateView()
a.PostEventWidgetContent(a)
} | |
c22272 | }
width, height := view.Size()
a.port.Resize(0, 0, width, height)
if a.model != nil {
w, h := a.model.GetBounds()
a.port.SetContentSize(w, h, true)
}
a.Resize()
} | |
c22273 | 0, width, height)
a.port.ValidateView()
a.MakeCursorVisible()
} | |
c22274 | {
a.cursorX = x
a.cursorY = y
a.model.SetCursor(x, y)
} | |
c22275 | int) {
a.SetCursor(x, a.cursorY)
} | |
c22276 | int) {
a.SetCursor(a.cursorX, y)
} | |
c22277 | a.port.MakeVisible(x, y)
} | |
c22278 | 0, 0, 0)
a.style = tcell.StyleDefault
})
} | |
c22279 | = "UTF-8"
}
s := &simscreen{charset: charset}
return s
} | |
c22280 | time.Now(), w: width, h: height}
} | |
c22281 | pb.out.String()
pb.lk.Unlock()
return s
} | |
c22282 | t.TParm(t.SetCursor, row, col)
} | |
c22283 | -= 8
}
if bi > 7 && bi < 16 {
bi -= 8
}
}
if t.Colors > fi && fi >= 0 {
rv += t.TParm(t.SetFg, fi)
}
if t.Colors > bi && bi >= 0 {
rv += t.TParm(t.SetBg, bi)
}
return rv
} | |
c22284 | {
terminfos[x] = t
}
dblock.Unlock()
} | |
c22285 | := NewTerminfoScreen(); s != nil {
return s, nil
} else {
return nil, e
}
} | |
c22286 | return app.err
}
app.screen.SetStyle(app.style)
}
return nil
} | |
c22287 |
if scr := app.screen; scr != nil {
go func() { scr.PostEventWait(ev) }()
}
} | |
c22288 |
if scr := app.screen; scr != nil {
go func() { scr.PostEventWait(ev) }()
}
} | |
c22289 |
if scr := app.screen; scr != nil {
go func() { scr.PostEventWait(ev) }()
}
} | |
c22290 | != nil {
go func() { scr.PostEventWait(ev) }()
}
} | |
c22291 | app.screen = scr
app.err = nil
}
} | |
c22292 | &EventMouse{t: time.Now(), x: x, y: y, btn: btn, mod: mod}
} | |
c22293 | if err != nil {
fmt.Printf("Unable to move coverprofile %s, %v\n", runner.CoverageFile, err)
return
}
}
} | |
c22294 | contents, err := ioutil.ReadFile(runner.CoverageFile)
if err != nil {
fmt.Printf("Unable to read coverage file %s to combine, %v\n", runner.CoverageFile, err)
return nil // non-fatal error
}
_, err = combined.Write(contents)
if err != nil {
fmt.Printf("Unable to append to coverprofile, %v\n", err)... | |
c22295 | bool, parallelTotal),
beforeSuiteData: types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending},
parallelTotal: parallelTotal,
}, nil
} | |
c22296 | {
defer request.Body.Close()
body, _ := ioutil.ReadAll(request.Body)
return body
} | |
c22297 | }
globalFailer.Skip(message, codelocation.New(skip+1))
panic(GINKGO_PANIC)
} | |
c22298 | body, types.FlagTypePending, codelocation.New(1))
return true
} | |
c22299 | types.FlagTypeFocused, codelocation.New(1))
return true
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.