simple-im: don't emit newline in pre-edit
This commit is contained in:
parent
43171a14b3
commit
c0e70a1d6d
1 changed files with 9 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ use {
|
|||
wl_surface::zwp_input_popup_surface_v2::ZwpInputPopupSurfaceV2,
|
||||
},
|
||||
keyboard::KeyboardState,
|
||||
utils::{clonecell::CloneCell, smallmap::SmallMap},
|
||||
utils::{clonecell::CloneCell, debug_fn::debug_fn, smallmap::SmallMap},
|
||||
wire::ZwpInputPopupSurfaceV2Id,
|
||||
},
|
||||
kbvm::{
|
||||
|
|
@ -154,7 +154,14 @@ impl UnicodeInput {
|
|||
let _ = write!(self.text, "U+{:x}", self.cp);
|
||||
self.cursor = self.text.len() as _;
|
||||
if let Some(char) = char::from_u32(self.cp) {
|
||||
let _ = write!(self.text, " = {}", char);
|
||||
let s = debug_fn(|f| {
|
||||
if char == '\n' {
|
||||
f.write_str("\\n")
|
||||
} else {
|
||||
f.write_char(char)
|
||||
}
|
||||
});
|
||||
let _ = write!(self.text, " = {}", s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue