detached 1ba02a9

GIR: Use OverrideX and GetX as callback override functions

commit
1ba02a9f53bd1a1b749e08c8668063d9f5097060
author
Felicitas Pojtinger · · 2025-10-09 04:40 UTC
committer
Jeroen Wijenbergh · · 2025-10-16 13:39 UTC
parent
c965cb3
signature
unsigned
1 file · +6 -6
M templates/go +6 -6
@@ -84,9 +84,9 @@ func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} {
8484 {{end}}
8585
8686 {{range .CallbackAccessors -}}
87-{{if .Doc}}// SetCallback{{.Name}} sets the callback function.
88-{{.Doc}}{{else}}// SetCallback{{.Name}} sets the callback function.{{end}}
89-func (x *{{$outer.Name}}) SetCallback{{.Name}}(cb {{.CallbackType}}) {
87+{{if .Doc}}// Override{{.Name}} sets the callback function.
88+{{.Doc}}{{else}}// Override{{.Name}} sets the callback function.{{end}}
89+func (x *{{$outer.Name}}) Override{{.Name}}(cb {{.CallbackType}}) {
9090 if cb == nil {
9191 x.x{{.Name}} = 0
9292 } else {
@@ -100,9 +100,9 @@ func (x *{{$outer.Name}}) SetCallback{{.Name}}(cb {{.CallbackType}}) {
100100 }
101101 }
102102
103-{{if .Doc}}// GetCallback{{.Name}} gets the callback function.
104-{{.Doc}}{{else}}// GetCallback{{.Name}} gets the callback function.{{end}}
105-func (x *{{$outer.Name}}) GetCallback{{.Name}}() {{.CallbackType}} {
103+{{if .Doc}}// Get{{.Name}} gets the callback function.
104+{{.Doc}}{{else}}// Get{{.Name}} gets the callback function.{{end}}
105+func (x *{{$outer.Name}}) Get{{.Name}}() {{.CallbackType}} {
106106 if x.x{{.Name}} == 0 {
107107 return nil
108108 }
@@ -84,9 +84,9 @@ func (x *{{$outer.Name}}) {{.Name}}({{conv .Args.API.Full}}) {{.Ret.Return}} {
84 {{end}}84 {{end}}
85 85
86 {{range .CallbackAccessors -}}86 {{range .CallbackAccessors -}}
87-{{if .Doc}}// SetCallback{{.Name}} sets the callback function.87+{{if .Doc}}// Override{{.Name}} sets the callback function.
88-{{.Doc}}{{else}}// SetCallback{{.Name}} sets the callback function.{{end}}88+{{.Doc}}{{else}}// Override{{.Name}} sets the callback function.{{end}}
89-func (x *{{$outer.Name}}) SetCallback{{.Name}}(cb {{.CallbackType}}) {89+func (x *{{$outer.Name}}) Override{{.Name}}(cb {{.CallbackType}}) {
90 if cb == nil {90 if cb == nil {
91 x.x{{.Name}} = 091 x.x{{.Name}} = 0
92 } else {92 } else {
@@ -100,9 +100,9 @@ func (x *{{$outer.Name}}) SetCallback{{.Name}}(cb {{.CallbackType}}) {
100 }100 }
101 }101 }
102 102
103-{{if .Doc}}// GetCallback{{.Name}} gets the callback function.103+{{if .Doc}}// Get{{.Name}} gets the callback function.
104-{{.Doc}}{{else}}// GetCallback{{.Name}} gets the callback function.{{end}}104+{{.Doc}}{{else}}// Get{{.Name}} gets the callback function.{{end}}
105-func (x *{{$outer.Name}}) GetCallback{{.Name}}() {{.CallbackType}} {105+func (x *{{$outer.Name}}) Get{{.Name}}() {{.CallbackType}} {
106 if x.x{{.Name}} == 0 {106 if x.x{{.Name}} == 0 {
107 return nil107 return nil
108 }108 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close