mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Use runtime knowledge of OS for OS-specific text editing (#3840)
How text editing behaves depends on what OS we are running on. `target_os` is a compile-time check, but `ctx.os()` is a runtime check, that works also on web.
This commit is contained in:
@@ -66,6 +66,15 @@ def lint_lines(filepath, lines_in):
|
||||
)
|
||||
lines_out.append("#[inline]")
|
||||
|
||||
if (
|
||||
"(target_os" in line
|
||||
and filepath.startswith("./crates/egui/")
|
||||
and filepath != "./crates/egui/src/os.rs"
|
||||
):
|
||||
errors.append(
|
||||
f"{filepath}:{line_nr}: Don't use `target_os` - use ctx.os() instead."
|
||||
)
|
||||
|
||||
lines_out.append(line)
|
||||
|
||||
prev_line = line
|
||||
|
||||
Reference in New Issue
Block a user