Skip to content

Commit

Permalink
add threshold for comments of struct init fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 11, 2024
1 parent 522b06c commit a6cdc9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions examples/gg/path_finding_algorithm_visualizer/aStar.v
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ fn main() {

// setting values of app
app.gg = gg.new_context(
bg_color: gx.black // background color
width: window_width // window width
height: window_height // window height
create_window: true // this will create a different window
bg_color: gx.black // background color
width: window_width // window width
height: window_height // window height
create_window: true // this will create a different window
window_title: 'A* Path finding algorithm visusalizer' // title of the window
frame_fn: frame // this is frame function update the frame
event_fn: on_event // it calls on every event
init_fn: init_images // run at start of application
user_data: app // store user data
frame_fn: frame // this is frame function update the frame
event_fn: on_event // it calls on every event
init_fn: init_images // run at start of application
user_data: app // store user data
)
mut grid := initialise_grid() // initialize the grid variable and populate the matrix with each cell as empty
app.grid = grid // set grid to app attribute so you can access it by just passing app variable or with method of app
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/fmt/struct.v
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub fn (mut f Fmt) struct_init(node ast.StructInit) {
f.comments(node.update_expr_comments, same_line: true, has_nl: true, level: .keep)
}
mut value_align := new_field_align()
mut comment_align := new_field_align()
mut comment_align := new_field_align(use_threshold: true)
for init_field in node.init_fields {
value_align.add_info(init_field.name.len, init_field.pos.line_nr)
if init_field.comments.len > 0 {
Expand Down

0 comments on commit a6cdc9a

Please sign in to comment.