mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: change all '$expr' to '${expr}' (#16428)
This commit is contained in:
@ -75,7 +75,7 @@ pub fn init(cfg Config) &Context {
|
||||
}
|
||||
|
||||
if ctx.cfg.window_title != '' {
|
||||
print('\x1b]0;$ctx.cfg.window_title\x07')
|
||||
print('\x1b]0;${ctx.cfg.window_title}\x07')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ fn (mut ctx Context) parse_events() {
|
||||
}
|
||||
w := sb.srWindow.Right - sb.srWindow.Left + 1
|
||||
h := sb.srWindow.Bottom - sb.srWindow.Top + 1
|
||||
utf8 := '($ctx.window_width, $ctx.window_height) -> ($w, $h)'
|
||||
utf8 := '(${ctx.window_width}, ${ctx.window_height}) -> (${w}, ${h})'
|
||||
if w != ctx.window_width || h != ctx.window_height {
|
||||
ctx.window_width, ctx.window_height = w, h
|
||||
mut event := &Event{
|
||||
|
@ -78,7 +78,7 @@ fn (mut ctx Context) termios_setup() ! {
|
||||
}
|
||||
|
||||
if ctx.cfg.window_title != '' {
|
||||
print('\x1b]0;$ctx.cfg.window_title\x07')
|
||||
print('\x1b]0;${ctx.cfg.window_title}\x07')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ fn (mut ctx Context) termios_setup() ! {
|
||||
C.tcsetattr(C.STDIN_FILENO, C.TCSAFLUSH, &termios)
|
||||
// feature-test the SU spec
|
||||
sx, sy := get_cursor_position()
|
||||
print('$bsu$esu')
|
||||
print('${bsu}${esu}')
|
||||
flush_stdout()
|
||||
ex, ey := get_cursor_position()
|
||||
if sx == ex && sy == ey {
|
||||
|
@ -13,7 +13,7 @@ pub:
|
||||
}
|
||||
|
||||
pub fn (c Color) hex() string {
|
||||
return '#$c.r.hex()$c.g.hex()$c.b.hex()'
|
||||
return '#${c.r.hex()}${c.g.hex()}${c.b.hex()}'
|
||||
}
|
||||
|
||||
// Synchronized Updates spec, designed to avoid tearing during renders
|
||||
@ -54,7 +54,7 @@ pub fn (mut ctx Context) bold() {
|
||||
// set_cursor_position positions the cusor at the given coordinates `x`,`y`.
|
||||
[inline]
|
||||
pub fn (mut ctx Context) set_cursor_position(x int, y int) {
|
||||
ctx.write('\x1b[$y;${x}H')
|
||||
ctx.write('\x1b[${y};${x}H')
|
||||
}
|
||||
|
||||
// show_cursor will make the cursor appear if it is not already visible
|
||||
@ -115,7 +115,7 @@ pub fn (mut ctx Context) clear() {
|
||||
// set_window_title sets the string `s` as the window title.
|
||||
[inline]
|
||||
pub fn (mut ctx Context) set_window_title(s string) {
|
||||
print('\x1b]0;$s\x07')
|
||||
print('\x1b]0;${s}\x07')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user