Skip to content

Commit bd78862

Browse files
committed
fix compilation with latest V
1 parent 76039b5 commit bd78862

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/chunkview.v

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ fn (mut c ParaChunk) update_line_height(cv &ChunkView) {
215215
mut lh := 0
216216
mut style, mut left := '', ''
217217
for content in c.content {
218-
if content.index_after(para_style_delim, 0) == 0 {
219-
content_start := content.index_after(para_style_delim, 1)
218+
if content.index_after(para_style_delim, 0) or { -1 } == 0 {
219+
content_start := content.index_after(para_style_delim, 1) or { -1 }
220220
if content_start > 1 { // empty style means same style
221221
style = content[1..content_start]
222222
}
@@ -247,8 +247,8 @@ fn (mut c ParaChunk) update_chunks(cv &ChunkView) {
247247
mut add_chunk := cv.has_scrollview // false
248248

249249
for content in c.content {
250-
if content.index_after(para_style_delim, 0) == 0 {
251-
content_start := content.index_after(para_style_delim, 1)
250+
if content.index_after(para_style_delim, 0) or { -1 } == 0 {
251+
content_start := content.index_after(para_style_delim, 1) or { -1 }
252252
if content_start > 1 { // empty style means same style
253253
style = content[1..content_start]
254254
}
@@ -495,8 +495,8 @@ fn (mut c VerticalAlignChunk) update_line_height(cv &ChunkView) {
495495
mut lh := 0
496496
mut style, mut left := '', ''
497497
for content in c.content {
498-
if content.index_after(para_style_delim, 0) == 0 {
499-
content_start := content.index_after(para_style_delim, 1)
498+
if content.index_after(para_style_delim, 0) or { -1 } == 0 {
499+
content_start := content.index_after(para_style_delim, 1) or { -1 }
500500
if content_start > 1 { // empty style means same style
501501
style = content[1..content_start]
502502
}
@@ -517,7 +517,7 @@ fn (mut c VerticalAlignChunk) init_line_chunks(cv &ChunkView) {
517517
mut contents := [][]string{}
518518
mut lines := []string{}
519519
for content in c.content {
520-
if content.index_after(para_style_delim, 0) == 0 {
520+
if content.index_after(para_style_delim, 0) or { -1 } == 0 {
521521
if lines.len > 0 && lines[0] == 'br' {
522522
contents << lines
523523
lines = []string{}
@@ -553,8 +553,8 @@ fn (mut c VerticalAlignChunk) init_line_chunks(cv &ChunkView) {
553553
c.line_chunks << chunks
554554
for content in line_content {
555555
// TextChunk
556-
if content.index_after(para_style_delim, 0) == 0 {
557-
content_start := content.index_after(para_style_delim, 1)
556+
if content.index_after(para_style_delim, 0) or { -1 } == 0 {
557+
content_start := content.index_after(para_style_delim, 1) or { -1 }
558558
if content_start > 1 { // empty style means same style
559559
style = content[1..content_start]
560560
}

0 commit comments

Comments
 (0)