From 8be1e685bf788c57a3e658c335246596e46a11db Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 23 Dec 2019 11:47:33 -0800 Subject: [PATCH] Fixed enclosure code to work on first byte of enclosure range --- bin/build_optimized.bat | 2 +- custom/4coder_helper.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/build_optimized.bat b/bin/build_optimized.bat index 6e8741f6..4069b540 100644 --- a/bin/build_optimized.bat +++ b/bin/build_optimized.bat @@ -1,3 +1,3 @@ @echo off -call build.bat /DOPT_BUILD \ No newline at end of file +call bin\build.bat /DOPT_BUILD diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index db627f48..d074e891 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -788,7 +788,7 @@ enclose_boundary(Application_Links *app, Buffer_ID buffer, Range_i64 range, range.min = new_min; } i64 new_max = func(app, buffer, Side_Max, Scan_Forward, range.max - 1); - i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max - 1); + i64 new_max_check = func(app, buffer, Side_Min, Scan_Forward, range.max); if (new_max_check >= new_max && new_max > range.max){ range.max = new_max; } @@ -1897,7 +1897,7 @@ push_token_or_word_under_pos(Application_Links *app, Arena *arena, Buffer_ID buf String_Const_u8 result = {}; Token *token = get_token_from_pos(app, buffer, pos); if (token != 0 && token->size > 0 && token->kind != TokenBaseKind_Whitespace){ - Range_i64 range = Ii64(token->pos, token->pos + token->size); + Range_i64 range = Ii64(token); result = push_buffer_range(app, arena, buffer, range); } return(result);