fix issue in junk token highlighting

This commit is contained in:
Allen Webster 2016-08-30 22:18:47 -04:00
parent 1b2c236b57
commit efd7f19000
2 changed files with 10 additions and 4 deletions

View File

@ -5379,11 +5379,12 @@ draw_file_loaded(View *view, i32_Rect rect, b32 is_active, Render_Target *target
u32 mark_color = style->main.mark_color; u32 mark_color = style->main.mark_color;
Buffer_Render_Item *item = items; Buffer_Render_Item *item = items;
Buffer_Render_Item *item_end = item + count;
i32 prev_ind = -1; i32 prev_ind = -1;
u32 highlight_color = 0; u32 highlight_color = 0;
u32 highlight_this_color = 0; u32 highlight_this_color = 0;
for (i32 i = 0; i < count; ++i, ++item){ for (; item < item_end; ++item){
i32 ind = item->index; i32 ind = item->index;
highlight_this_color = 0; highlight_this_color = 0;
if (tokens_use && ind != prev_ind){ if (tokens_use && ind != prev_ind){
@ -5402,7 +5403,7 @@ draw_file_loaded(View *view, i32_Rect rect, b32 is_active, Render_Target *target
} }
if (current_token.type == CPP_TOKEN_JUNK && if (current_token.type == CPP_TOKEN_JUNK &&
i >= current_token.start && i < current_token.start + current_token.size){ ind >= current_token.start && ind < current_token.start + current_token.size){
highlight_color = style->main.highlight_junk_color; highlight_color = style->main.highlight_junk_color;
} }
else{ else{

View File

@ -12,7 +12,7 @@
#include <assert.h> #include <assert.h>
#include "4ed_defines.h" #include "4ed_defines.h"
#if FRED_SUPER #if defined(FRED_SUPER)
# define FSTRING_IMPLEMENTATION # define FSTRING_IMPLEMENTATION
# define FSTRING_C # define FSTRING_C
@ -2022,7 +2022,7 @@ WinMain(HINSTANCE hInstance,
// Custom Layer Linkage // Custom Layer Linkage
// //
#ifdef FRED_SUPER #if defined(FRED_SUPER)
char *custom_file_default = "4coder_custom.dll"; char *custom_file_default = "4coder_custom.dll";
char *custom_file = 0; char *custom_file = 0;
if (win32vars.settings.custom_dll) custom_file = win32vars.settings.custom_dll; if (win32vars.settings.custom_dll) custom_file = win32vars.settings.custom_dll;
@ -2055,6 +2055,11 @@ WinMain(HINSTANCE hInstance,
#endif #endif
} }
if (win32vars.custom_api.get_bindings == 0){
OutputDebugStringA("Error: 4coder_custom.dll is missing\n");
exit(1);
}
#else #else
win32vars.custom_api.get_bindings = (Get_Binding_Data_Function*)get_bindings; win32vars.custom_api.get_bindings = (Get_Binding_Data_Function*)get_bindings;
#endif #endif