Skip to content

Commit f3e0480

Browse files
committed
Minor fixes
1 parent 363bdda commit f3e0480

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

editor/imetooltip.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ func (i *IMETooltip) parsePreeditString(preeditStr string) {
169169
h := &Highlight{}
170170
g.foreground = i.s.ws.foreground
171171
g.background = i.s.ws.background
172-
if i.s.ws.screenbg == "dark" {
173-
h.foreground = warpColor(editor.colors.fg, 30)
174-
h.background = warpColor(editor.colors.bg, 30)
172+
if i.s.ws.screenbg == "light" {
173+
h.foreground = warpColor(i.s.ws.background, -30)
174+
h.background = warpColor(i.s.ws.foreground, -30)
175175
} else {
176-
h.foreground = warpColor(editor.colors.fg, -30)
177-
h.background = warpColor(editor.colors.fg, -30)
176+
h.foreground = warpColor(i.s.ws.foreground, 30)
177+
h.background = warpColor(i.s.ws.background, 30)
178178
}
179179
h.underline = true
180180

editor/workspace.go

+6
Original file line numberDiff line numberDiff line change
@@ -2815,6 +2815,12 @@ func (w *Workspace) InputMethodEvent(event *gui.QInputMethodEvent) {
28152815

28162816
// InputMethodQuery is
28172817
func (w *Workspace) InputMethodQuery(query core.Qt__InputMethodQuery) *core.QVariant {
2818+
if w.screen == nil {
2819+
return core.NewQVariant()
2820+
}
2821+
if w.screen.tooltip == nil {
2822+
return core.NewQVariant()
2823+
}
28182824
if !w.screen.tooltip.isShown {
28192825
return core.NewQVariant()
28202826
}

0 commit comments

Comments
 (0)