ludic.ui: a hole's text found by its pieces in the memo (built only when it first reads that way), avals left for the attributes read as text, a class's [root] made once, and a dev build's reload lets go of every file it read only to compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6c663cc87b
commit
ea5eedb5a5
10 changed files with 76 additions and 18 deletions
|
|
@ -5,7 +5,11 @@ export function ui_reload(ui_st: mut UiState) -> bool {
|
|||
var changed = uc_reload(ui_st)
|
||||
for i in 0 .. len(ui_st.lib_files) {
|
||||
let f = ui_st.lib_files[i]
|
||||
if f.disk and lib_text(ui_st, f.path) != f.src { changed = true }
|
||||
if f.disk {
|
||||
let now = lib_text(ui_st, f.path)
|
||||
if now != f.src { changed = true }
|
||||
rl_let_go(now) # read only to compare; a change is read again below
|
||||
}
|
||||
}
|
||||
if not changed { return false }
|
||||
ui_st.ui_errs = new []string
|
||||
|
|
@ -31,3 +35,8 @@ export function ui_reload(ui_st: mut UiState) -> bool {
|
|||
print(`ui: templates reloaded`)
|
||||
return true
|
||||
}
|
||||
# a text read from disk only to be compared, given back (never a literal: lib_text's "" is not freed)
|
||||
function rl_let_go(s: string) -> void {
|
||||
if s == null or len(s) == 0 { return }
|
||||
unsafe { free(s) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue