Skip to content

Commit

Permalink
[doc] Fix promptVal example
Browse files Browse the repository at this point in the history
avoid <Runtime error: Attribute 'promptval' not found on Obj>
  • Loading branch information
wbob authored Jan 14, 2025
1 parent b6570ae commit c76d669
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/ref/chap-type-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,8 @@ An API the wraps the `$PS1` language. For example, to simulate `PS1='\w\$ '`:

func renderPrompt(io) {
var parts = []
call parts->append(io.promptval('w')) # pass 'w' for \w
call parts->append(io.promptval('$')) # pass '$' for \$
call parts->append(io.promptVal('w')) # pass 'w' for \w
call parts->append(io.promptVal('$')) # pass '$' for \$
call parts->append(' ')
return (join(parts))
}
Expand Down

0 comments on commit c76d669

Please sign in to comment.