fixed fucking git fuckup... fuck that shit.. uhg

This commit is contained in:
Allen Webster 2016-10-27 02:58:37 -04:00
parent ff08a6ea24
commit a6a6957ba9
6 changed files with 50 additions and 117 deletions

View File

@ -170,8 +170,6 @@ CUSTOM_COMMAND_SIG(write_name_of_font){
if (font_len != 0){ if (font_len != 0){
write_string(app, &view, &buffer, make_string(font_name, font_len)); write_string(app, &view, &buffer, make_string(font_name, font_len));
} }
print_message(app, literal("TRIED WRITING FONT NAME"));
} }
CUSTOM_COMMAND_SIG(newline_or_goto_position){ CUSTOM_COMMAND_SIG(newline_or_goto_position){

View File

@ -2087,7 +2087,6 @@ API_EXPORT int32_t
Buffer_Get_Font(Application_Links *app, Buffer_Summary *buffer, char *name_out, int32_t name_max) Buffer_Get_Font(Application_Links *app, Buffer_Summary *buffer, char *name_out, int32_t name_max)
{ {
Command_Data *cmd = (Command_Data*)app->cmd_context; Command_Data *cmd = (Command_Data*)app->cmd_context;
System_Functions *system = cmd->system;
Models *models = cmd->models; Models *models = cmd->models;
Editing_File *file = imp_get_file(cmd, buffer); Editing_File *file = imp_get_file(cmd, buffer);

View File

@ -282,7 +282,7 @@ view_file_display_width(View *view){
} }
inline f32 inline f32
view_file_minimum_base_width(View *view){ view_file_minimum_base__width(View *view){
Editing_File *file = view->file_data.file; Editing_File *file = view->file_data.file;
f32 result = (f32)file->settings.display_width; f32 result = (f32)file->settings.display_width;
return(result); return(result);
@ -1081,6 +1081,7 @@ wrap_state_consume_token(Code_Wrap_State *state, i32 fixed_end_point){
b32 skipping_whitespace = 0; b32 skipping_whitespace = 0;
if (i >= state->next_line_start){ if (i >= state->next_line_start){
state->x = state->wrap_x.paren_nesting[state->wrap_x.paren_safe_top];
state->x = state->wrap_x.paren_nesting[state->wrap_x.paren_safe_top]; state->x = state->wrap_x.paren_nesting[state->wrap_x.paren_safe_top];
skipping_whitespace = 1; skipping_whitespace = 1;
} }
@ -1819,6 +1820,7 @@ file_measure_wraps(System_Functions *system, Models *models, Editing_File *file,
if (line_shift < 0){ if (line_shift < 0){
line_shift = 0; line_shift = 0;
} }
} }
else{ else{
line_shift = 0.f; line_shift = 0.f;
@ -4329,8 +4331,7 @@ struct Single_Line_Mode{
}; };
internal Single_Line_Input_Step internal Single_Line_Input_Step
app_single_line_input_core(System_Functions *system, Working_Set *working_set, app_single_line_input_core(System_Functions *system, Working_Set *working_set, Key_Event_Data key, Single_Line_Mode mode){
Key_Event_Data key, Single_Line_Mode mode){
Single_Line_Input_Step result = {0}; Single_Line_Input_Step result = {0};
if (key.keycode == key_back){ if (key.keycode == key_back){
@ -4741,6 +4742,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
Assert(view->file_data.file); Assert(view->file_data.file);
Font_Set *font_set = models->font_set; Font_Set *font_set = models->font_set;
Font_Info *info = 0;
i16 i = 1, count = (i16)models->font_set->count + 1; i16 i = 1, count = (i16)models->font_set->count + 1;
@ -4759,7 +4761,7 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
i16 new_font_id = font_id; i16 new_font_id = font_id;
for (i = 1; i < count; ++i){ for (i = 1; i < count; ++i){
Font_Info *info = get_font_info(font_set, i); info = get_font_info(font_set, i);
id.id[0] = (u64)i; id.id[0] = (u64)i;
if (i != font_id){ if (i != font_id){
if (gui_do_font_button(target, id, i, info->name)){ if (gui_do_font_button(target, id, i, info->name)){

View File

@ -1257,7 +1257,8 @@ gui_do_jump(GUI_Target *target, GUI_View_Jump jump, GUI_Scroll_Vars vars){
internal void internal void
gui_standard_list(GUI_Target *target, GUI_id id, GUI_Scroll_Vars *vars, i32_Rect scroll_region, gui_standard_list(GUI_Target *target, GUI_id id, GUI_Scroll_Vars *vars, i32_Rect scroll_region,
Key_Summary *keys, i32 *list_i, GUI_Item_Update *update){ Key_Summary *keys, i32 *list_i, GUI_Item_Update *update,
i16 key_user_up = 0, i16 key_user_down = 0){
if (update->has_adjustment){ if (update->has_adjustment){
*list_i = update->adjustment_value; *list_i = update->adjustment_value;
@ -1274,18 +1275,15 @@ gui_standard_list(GUI_Target *target, GUI_id id, GUI_Scroll_Vars *vars, i32_Rect
b32 indirectly_activate = 0; b32 indirectly_activate = 0;
for (i32 j = 0; j < keys->count; ++j){ for (i32 j = 0; j < keys->count; ++j){
i16 key = keys->keys[j].keycode; i16 key = keys->keys[j].keycode;
switch (key){
case key_up: if (key == key_up || key == key_user_up){
--*list_i; --*list_i;
break; }
else if (key == key_down || key == key_user_down){
case key_down:
++*list_i; ++*list_i;
break; }
else if (key == '\n' || key == '\t'){
case '\n': case '\t':
indirectly_activate = 1; indirectly_activate = 1;
break;
} }
} }

View File

@ -89,12 +89,12 @@
; BEFORE I SHIP ; BEFORE I SHIP
; ;
; [X] query buffer font info ; [X] query buffer font info
; [X] issues with drive letters
; [] ad hoc call for setting up/down keys for interactive screens ; [] ad hoc call for setting up/down keys for interactive screens
; [] miblo's various number editors
; [] API docs have duplicate ids?
; [] option to not open *messages* every startup ; [] option to not open *messages* every startup
; [] issues with drive letters ; [] API docs have duplicate ids?
; [] strong options for indentation rules for text & presentation ; [] miblo's various number editors
; [] decent options for indentation rules for text & presentation
; ;
; TODOS ; TODOS
@ -165,9 +165,7 @@
; [X] word level wrapping ; [X] word level wrapping
; [X] ability to toggle virtual white space ; [X] ability to toggle virtual white space
; [X] home/end should go to the beginning/end of the visual line not the textual line ; [X] home/end should go to the beginning/end of the visual line not the textual line
; [] command for setting wrap positions in views directly ; [X] code level wrapping level 1
; [] ability to see the wrap position as a number/line and adjust graphically
; [] code level wrapping
; [X] handle basic scope indents ; [X] handle basic scope indents
; [X] handle parentheses ; [X] handle parentheses
; [X] handle preprocessor ; [X] handle preprocessor
@ -176,11 +174,14 @@
; [X] smarter wrap rule ; [X] smarter wrap rule
; [X] handle unclosed statements ; [X] handle unclosed statements
; [X] wrapped line indication ; [X] wrapped line indication
; [X] additional width for nesting?
; [X] special indent rules in preprocessor body ; [X] special indent rules in preprocessor body
; [X] handle comments ; [X] handle comments
; [] solve the comment lead whitespace problem ; [X] additional width for nesting?
; [] fix issues when relexing happens in parallel ; [X] fix issues when relexing happens in parallel
; [] command for setting wrap positions in views directly
; [] ability to see the wrap position as a number/line and adjust graphically
; [] code level wrapping level 2
; [] comment lead whitespace problem
; [] remeasure version of measure_wraps ; [] remeasure version of measure_wraps
; Buffer behavior cleanup ; Buffer behavior cleanup

View File

@ -162,11 +162,6 @@ enum CV_ID{
CV_COUNT CV_COUNT
}; };
typedef struct Drive_Strings{
char *prefix_[26];
char **prefix;
} Drive_Strings;
typedef struct Win32_Vars{ typedef struct Win32_Vars{
System_Functions system; System_Functions system;
App_Functions app; App_Functions app;
@ -214,8 +209,6 @@ typedef struct Win32_Vars{
b32 first; b32 first;
i32 running_cli; i32 running_cli;
Drive_Strings dstrings;
#if FRED_INTERNAL #if FRED_INTERNAL
CRITICAL_SECTION DEBUG_sysmem_lock; CRITICAL_SECTION DEBUG_sysmem_lock;
Sys_Bubble internal_bubble; Sys_Bubble internal_bubble;
@ -855,62 +848,17 @@ Sys_Set_File_List_Sig(system_set_file_list){
} }
} }
internal void
set_volume_prefix(Drive_Strings *dstrings, char *vol){
char c = vol[0];
if (dstrings->prefix[c]){
system_free_memory(dstrings->prefix[c]);
}
HANDLE hdir = CreateFile(
vol,
GENERIC_READ,
FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ,
0,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
0);
if (hdir != INVALID_HANDLE_VALUE){
char *s = 0;
DWORD len = GetFinalPathNameByHandle(hdir, 0, 0, 0);
len = len + 1;
s = (char*)system_get_memory(len);
len = GetFinalPathNameByHandle(hdir, s, len, 0);
s[len] = 0;
if (s[len-1] == '\\') s[len-1] = 0;
dstrings->prefix[c] = s + 4;
CloseHandle(hdir);
}
else{
dstrings->prefix[c] = 0;
}
}
internal void
win32_init_drive_strings(Drive_Strings *dstrings){
dstrings->prefix = dstrings->prefix_ - 'A';
char vol[4] = "A:\\";
for (char c = 'A'; c <= 'Z'; ++c){
vol[0] = c;
set_volume_prefix(dstrings, vol);
}
}
// NOTE(allen): This does not chase down symbolic links because doing so // NOTE(allen): This does not chase down symbolic links because doing so
// would require a lot of heavy duty OS calls. I've decided to give up // would require a lot of heavy duty OS calls. I've decided to give up
// a little ground on always recognizing files as equivalent in exchange // a little ground on always recognizing files as equivalent in exchange
// for the ability to handle them very quickly when nothing strange is // for the ability to handle them very quickly when nothing strange is
// going on. // going on.
internal int32_t internal int32_t
win32_canonical_ascii_name(Drive_Strings *dstrings, char *src, i32 len, char *dst, i32 max){ win32_canonical_ascii_name(char *src, i32 len, char *dst, i32 max){
char *wrt = dst; char *wrt = dst;
char *wrt_stop = dst + max; char *wrt_stop = dst + max;
char *src_stop = src + len; char *src_stop = src + len;
char c = 0; char c = 0;
char **prefix_array = dstrings->prefix;
char *prefix = 0;
if (len >= 2 && max > 0){ if (len >= 2 && max > 0){
c = src[0]; c = src[0];
@ -919,19 +867,11 @@ win32_canonical_ascii_name(Drive_Strings *dstrings, char *src, i32 len, char *ds
} }
if (c >= 'A' && c <= 'Z' && src[1] == ':'){ if (c >= 'A' && c <= 'Z' && src[1] == ':'){
prefix = prefix_array[c];
if (prefix){
for (;*prefix;){
*(wrt++) = *(prefix++);
if (wrt == wrt_stop) goto fail;
}
}
else{
*(wrt++) = c; *(wrt++) = c;
if (wrt == wrt_stop) goto fail; if (wrt == wrt_stop) goto fail;
*(wrt++) = ':'; *(wrt++) = ':';
if (wrt == wrt_stop) goto fail; if (wrt == wrt_stop) goto fail;
}
src += 2; src += 2;
for (; src < src_stop; ++src){ for (; src < src_stop; ++src){
@ -978,7 +918,7 @@ win32_canonical_ascii_name(Drive_Strings *dstrings, char *src, i32 len, char *ds
internal internal
Sys_Get_Canonical_Sig(system_get_canonical){ Sys_Get_Canonical_Sig(system_get_canonical){
i32 result = win32_canonical_ascii_name(&win32vars.dstrings, filename, len, buffer, max); i32 result = win32_canonical_ascii_name(filename, len, buffer, max);
return(result); return(result);
} }
@ -1974,11 +1914,6 @@ WinMain(HINSTANCE hInstance,
win32vars.coroutine_data[i].next = win32vars.coroutine_data + i + 1; win32vars.coroutine_data[i].next = win32vars.coroutine_data + i + 1;
} }
//
// Volume Initialization
//
win32_init_drive_strings(&win32vars.dstrings);
// //
// Memory Initialization // Memory Initialization
// //