diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index be457ddb..b4a1a667 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -1,5 +1,10 @@ /* -The implementation for the custom API +* Mr. 4th Dimention - Allen Webster + * + * ??.??.???? + * + * Implementation of the API functions. + * */ // TOP @@ -188,8 +193,8 @@ API_EXPORT bool32 Exec_System_Command(Application_Links *app, View_Summary *view, Buffer_Identifier buffer, char *path, int32_t path_len, char *command, int32_t command_len, Command_Line_Interface_Flag flags) /* DOC_PARAM(view, If the view parameter is non-null it specifies a view to display the command's output buffer, otherwise the command will still work but if there is a buffer capturing the output it will not automatically be displayed.) -DOC_PARAM(buffer, The buffer the command will output to is specified by the buffer parameter. See Buffer_Identifier for information on how this type specifies a buffer. The command will cause a crash if no file is specified.) -DOC_PARAM(path, The path parameter specifies the path in which the command shall be executed. The string need not be null terminated.) +DOC_PARAM(buffer, The buffer the command will output to is specified by the buffer parameter. See Buffer_Identifier for information on how this type specifies a buffer. The command will cause a crash if no buffer is specified.) +DOC_PARAM(path, The path parameter specifies the current working directory in which the command shall be executed. The string need not be null terminated.) DOC_PARAM(path_len, The parameter path_len specifies the length of the path string.) DOC_PARAM(command, The command parameter specifies the command that shall be executed. The string need not be null terminated.) DOC_PARAM(command_len, The parameter command_len specifies the length of the command string.) diff --git a/4ed_os_comp_cracking.h b/4ed_os_comp_cracking.h new file mode 100644 index 00000000..9231da2b --- /dev/null +++ b/4ed_os_comp_cracking.h @@ -0,0 +1,46 @@ +/* + * Mr. 4th Dimention - Allen Webster + * + * 31.03.2017 + * + * OS & Compiler cracking for 4coder + * + */ + +// TOP + +#if !defined(FRED_OS_COMP_CRACKING_H) +#define FRED_OS_COMP_CRACKING_H + +#if defined(_MSC_VER) + +# define IS_CL + +# define snprintf _snprintf + +# if defined(_WIN32) +# define IS_WINDOWS +# pragma comment(lib, "Kernel32.lib") +# else +# error This compiler/platform combo is not supported yet +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) + +# define IS_GCC + +# if defined(__gnu_linux__) +# define IS_LINUX +# else +# error This compiler/platform combo is not supported yet +# endif + +#else +#error This compiler is not supported yet +#endif + + +#endif + +// BOTTOM + diff --git a/4tech_defines.h b/4tech_defines.h index c100a969..c0f9ced3 100644 --- a/4tech_defines.h +++ b/4tech_defines.h @@ -9,13 +9,7 @@ Created 21.01.2017 (dd.mm.yyyy) #if !defined(FTECH_DEFINES) #define FTECH_DEFINES -#if defined(_MSC_VER) -#define IS_CL -#elif __GNUC__ -#define IS_GCC -#else -#error unknown compiler -#endif +#include "4ed_os_comp_cracking.h" #include diff --git a/project.4coder b/project.4coder index f237a873..9545d00a 100644 --- a/project.4coder +++ b/project.4coder @@ -10,7 +10,7 @@ fkey_command_win[6] = {"run_profile.bat", "*profile*", false, true }; fkey_command_win[12] = {"package.bat", "*package*", false, true }; fkey_command_linux[1] = {"echo build: x64 & ./build.sh", "*compilation*", true , true }; -fkey_command_linux[2] = {"site/build.sh", "*compilation*", true , true }; +fkey_command_linux[2] = {"site/build.sh", "*site*", false , true }; fkey_command_linux[4] = {"echo build: x86 & ./build.sh -DDEV_BUILD_X86", "*compilation*", true, true }; fkey_command_linux[5] = {"../build/4ed", "*run*", false, false}; fkey_command_linux[12] = {"./package.sh", "*package*", false, true }; diff --git a/site/abstract_document.cpp b/site/abstract_document.cpp index 8db35149..d080c8cf 100644 --- a/site/abstract_document.cpp +++ b/site/abstract_document.cpp @@ -617,277 +617,294 @@ write_enriched_text_html(String *out, Partition *part, Enriched_Text *text, Docu String l = skip_chop_whitespace(line); append_sc(out, "

"); - //append_ss(out, l); i32 start = 0, i = 0; for (; i < l.size; ++i){ - if (l.str[i] == '\\'){ - append_ss(out, substr(l, start, i-start)); + char ch = l.str[i]; + switch (ch){ + case '<': + { + append_ss(out, substr(l, start, i-start)); + append_sc(out, "<"); + start = i+1; + }break; - i32 command_start = i+1; - i32 command_end = command_start; - for (; command_end < l.size; ++command_end){ - if (!char_is_alpha_numeric(l.str[command_end])){ - break; + case '>': + { + append_ss(out, substr(l, start, i-start)); + append_sc(out, ">"); + start = i+1; + }break; + + case '\\': + { + append_ss(out, substr(l, start, i-start)); + + i32 command_start = i+1; + i32 command_end = command_start; + for (; command_end < l.size; ++command_end){ + if (!char_is_alpha_numeric(l.str[command_end])){ + break; + } } - } - - if (command_end == command_start){ - if (command_end < l.size && l.str[command_end] == '\\'){ - ++command_end; + + if (command_end == command_start){ + if (command_end < l.size && l.str[command_end] == '\\'){ + ++command_end; + } } - } - - String command_string = substr(l, command_start, command_end - command_start); - - enum Command_Types{ - Cmd_BackSlash, - Cmd_Version, - Cmd_BeginStyle, - Cmd_EndStyle, - Cmd_DocLink, - Cmd_BeginList, - Cmd_EndList, - Cmd_BeginItem, - Cmd_EndItem, - Cmd_BoldFace, - Cmd_Section, - Cmd_BeginLink, - Cmd_EndLink, - Cmd_Image, - Cmd_Video, - // never below this - Cmd_COUNT, - }; - - static String enriched_commands[Cmd_COUNT]; - - enriched_commands[Cmd_BackSlash] = make_lit_string("\\"); - enriched_commands[Cmd_Version] = make_lit_string("VERSION"); - enriched_commands[Cmd_BeginStyle] = make_lit_string("BEGIN_STYLE"); - enriched_commands[Cmd_EndStyle] = make_lit_string("END_STYLE"); - enriched_commands[Cmd_DocLink] = make_lit_string("DOC_LINK"); - enriched_commands[Cmd_BeginList] = make_lit_string("BEGIN_LIST"); - enriched_commands[Cmd_EndList] = make_lit_string("END_LIST"); - enriched_commands[Cmd_BeginItem] = make_lit_string("BEGIN_ITEM"); - enriched_commands[Cmd_EndItem] = make_lit_string("END_ITEM"); - enriched_commands[Cmd_BoldFace] = make_lit_string("BOLD_FACE"); - enriched_commands[Cmd_Section] = make_lit_string("SECTION"); - enriched_commands[Cmd_BeginLink] = make_lit_string("BEGIN_LINK"); - enriched_commands[Cmd_EndLink] = make_lit_string("END_LINK"); - enriched_commands[Cmd_Image] = make_lit_string("IMAGE"); - enriched_commands[Cmd_Video] = make_lit_string("VIDEO"); - - i = command_end; - - i32 match_index = 0; - if (string_set_match(enriched_commands, ArrayCount(enriched_commands), command_string, &match_index)){ - switch (match_index){ - case Cmd_BackSlash: append_sc(out, "\\"); break; - case Cmd_Version: append_sc(out, VERSION); break; - - case Cmd_BeginStyle: - { - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - if (match_sc(body_text, "code")){ - append_sc(out, ""); - } - } - }break; - - case Cmd_EndStyle: - { - append_sc(out, ""); - }break; - - // TODO(allen): upgrade this bs - case Cmd_DocLink: - { - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - append_sc(out, ""); - append_ss(out, body_text); - append_sc(out, ""); - } - }break; - - case Cmd_BeginList: - { - append_sc(out,"

"); - }break; - - case Cmd_BeginItem: - { - if (item_counter == 0){ - append_sc(out, "
  • "); - ++item_counter; - } - else{ - append_sc(out, "
  • "); - item_counter = 0; - } - }break; - - case Cmd_EndItem: - { - append_sc(out, "
  • "); - }break; - - case Cmd_Section: - { - // TODO(allen): undo the duplication of this body extraction code. - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - - html_render_section_header(out, body_text, null_string, section_counter); - ++section_counter->counter[section_counter->nest_level]; - item_counter = 0; - } - }break; - - case Cmd_BeginLink: - { - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - - append_sc(out, ""); } } + }break; + + case Cmd_EndStyle: + { + append_sc(out, ""); + }break; + + // TODO(allen): upgrade this bs + case Cmd_DocLink: + { + i32 body_start = 0, body_end = 0; + i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); + if (has_body){ + String body_text = substr(l, body_start, body_end - body_start); + body_text = skip_chop_whitespace(body_text); + append_sc(out, ""); + append_ss(out, body_text); + append_sc(out, ""); + } + }break; + + case Cmd_BeginList: + { + append_sc(out,""); + }break; + + case Cmd_BeginItem: + { + if (item_counter == 0){ + append_sc(out, "
  • "); + ++item_counter; + } else{ - append_ss(out, body_text); + append_sc(out, "
  • "); + item_counter = 0; } - append_sc(out, "'>"); - } - }break; - - case Cmd_EndLink: - { - append_sc(out, ""); - }break; - - case Cmd_Image: - { - // TODO(allen): generalize this - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); + }break; - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - - i32 pixel_height = 10; - i32 pixel_width = HTML_WIDTH; - - body_start = 0, body_end = 0; - has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 0); + case Cmd_EndItem: + { + append_sc(out, "
  • "); + }break; + + case Cmd_Section: + { + // TODO(allen): undo the duplication of this body extraction code. + i32 body_start = 0, body_end = 0; + i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); if (has_body){ - String size_parameter = substr(l, body_start, body_end - body_start); - if (match_part_sc(size_parameter, "width:")){ - String width_string = substr_tail(size_parameter, sizeof("width:")-1); - if (str_is_int_s(width_string)){ - pixel_width = str_to_int_s(width_string); + String body_text = substr(l, body_start, body_end - body_start); + body_text = skip_chop_whitespace(body_text); + + html_render_section_header(out, body_text, null_string, section_counter); + ++section_counter->counter[section_counter->nest_level]; + item_counter = 0; + } + }break; + + case Cmd_BeginLink: + { + i32 body_start = 0, body_end = 0; + i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); + if (has_body){ + String body_text = substr(l, body_start, body_end - body_start); + body_text = skip_chop_whitespace(body_text); + + append_sc(out, ""); + } + }break; + + case Cmd_EndLink: + { + append_sc(out, ""); + }break; + + case Cmd_Image: + { + // TODO(allen): generalize this + i32 body_start = 0, body_end = 0; + i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); + + if (has_body){ + String body_text = substr(l, body_start, body_end - body_start); + body_text = skip_chop_whitespace(body_text); + + i32 pixel_height = 10; + i32 pixel_width = HTML_WIDTH; + + body_start = 0, body_end = 0; + has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 0); + if (has_body){ + String size_parameter = substr(l, body_start, body_end - body_start); + if (match_part_sc(size_parameter, "width:")){ + String width_string = substr_tail(size_parameter, sizeof("width:")-1); + if (str_is_int_s(width_string)){ + pixel_width = str_to_int_s(width_string); + } + } + } + + if (match_part_sc(body_text, "image:")){ + String img_name = substr_tail(body_text, sizeof("image:")-1); + Abstract_Item *img_lookup = get_item_by_name(doc_system->img_list, img_name); + + if (img_lookup){ + pixel_height = ceil32(pixel_width*img_lookup->h_w_ratio); + + append_sc(out, ""); } } } + }break; + + case Cmd_Video: + { + // TODO(allen): generalize this + i32 body_start = 0, body_end = 0; + i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - if (match_part_sc(body_text, "image:")){ - String img_name = substr_tail(body_text, sizeof("image:")-1); - Abstract_Item *img_lookup = get_item_by_name(doc_system->img_list, img_name); + i32 pixel_width = HTML_WIDTH; + i32 pixel_height = (i32)(pixel_width * 0.5625); + + if (has_body){ + String body_text = substr(l, body_start, body_end - body_start); + body_text = skip_chop_whitespace(body_text); - if (img_lookup){ - pixel_height = ceil32(pixel_width*img_lookup->h_w_ratio); + if (match_part_sc(body_text, "youtube:")){ + String youtube_str = substr_tail(body_text, sizeof("youtube:")-1); - append_sc(out, ""); + append_sc(out, "' src='"); + append_ss(out, youtube_str); + append_sc(out, "' allowfullscreen> "); } } - } - }break; - - case Cmd_Video: - { - // TODO(allen): generalize this - i32 body_start = 0, body_end = 0; - i32 has_body = extract_command_body(out, l, &i, &body_start, &body_end, command_string, 1); - - i32 pixel_width = HTML_WIDTH; - i32 pixel_height = (i32)(pixel_width * 0.5625); - - if (has_body){ - String body_text = substr(l, body_start, body_end - body_start); - body_text = skip_chop_whitespace(body_text); - - if (match_part_sc(body_text, "youtube:")){ - String youtube_str = substr_tail(body_text, sizeof("youtube:")-1); - - append_sc(out, ""); - } - } - }break; + }break; + } } + else{ + append_sc(out, "! Doc generator error: unrecognized command !"); + fprintf(stderr, "error: unrecognized command %.*s\n", command_string.size, command_string.str); + } + + start = i; } - else{ - append_sc(out, "! Doc generator error: unrecognized command !"); - fprintf(stderr, "error: unrecognized command %.*s\n", command_string.size, command_string.str); - } - - start = i; } } diff --git a/site/sitegen.cpp b/site/sitegen.cpp index 24486807..3ec817b7 100644 --- a/site/sitegen.cpp +++ b/site/sitegen.cpp @@ -312,7 +312,7 @@ generate_binding_list(Document_System *doc_system, Partition *part, char *src_di Enriched_Text *binding_list = push_struct(part, Enriched_Text); *binding_list = load_enriched_text(part, src_directory, "binding_list.txt"); - Abstract_Item *doc = begin_document_description(doc_system, "4coder Feature List", "bindings", 0); + Abstract_Item *doc = begin_document_description(doc_system, "4coder Binding List", "bindings", 0); add_enriched_text(doc, binding_list); end_document_description(doc); diff --git a/site/source_material/binding_list.txt b/site/source_material/binding_list.txt index 4fbe68d2..08f4b12c 100644 --- a/site/source_material/binding_list.txt +++ b/site/source_material/binding_list.txt @@ -5,180 +5,182 @@ These are the default key bindings in 4coder version \VERSION -The following bindings apply in all situations: \SECTION{Global Bindings} +The following bindings apply in all situations. \BEGIN_LIST - \BEGIN_ITEM - Create a new panel with a vertical split \END_ITEM - \BEGIN_ITEM - Create a new panel with a horizontal split \END_ITEM - \BEGIN_ITEM - Close a panel \END_ITEM - \BEGIN_ITEM - Change active panel \END_ITEM - \BEGIN_ITEM - change active panel backwards \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Create a new panel with a vertical split \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Create a new panel with a horizontal split \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Close a panel \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Change active panel \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE change active panel backwards \END_ITEM - \BEGIN_ITEM - New file dialogue \END_ITEM - \BEGIN_ITEM - Open file dialogue \END_ITEM - \BEGIN_ITEM - Open file dialogue in other panel \END_ITEM - \BEGIN_ITEM - Kill buffer dialogue \END_ITEM - \BEGIN_ITEM - Switch open buffer dialogue \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE New file dialogue \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open file dialogue \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open file dialogue in other panel \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Kill buffer dialogue \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Switch open buffer dialogue \END_ITEM - \BEGIN_ITEM - Open color and font selection GUI \END_ITEM - \BEGIN_ITEM - Open a debug information GUI \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open color and font selection GUI \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open a debug information GUI \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Change to footer build panel \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Close footer build panel \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Goto next error/jump location \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Goto previous error/jump location \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Goto first error/jump location \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch basic build (calls build.bat, build.sh, or Makefile) \END_ITEM - \BEGIN_ITEM - Change to footer build panel \END_ITEM - \BEGIN_ITEM - Close footer build panel \END_ITEM - \BEGIN_ITEM - Goto next error/jump location \END_ITEM - \BEGIN_ITEM - Goto previous error/jump location \END_ITEM - \BEGIN_ITEM - Goto first error/jump location \END_ITEM - \BEGIN_ITEM - Launch basic build (calls build.bat, build.sh, or Makefile) \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Execute arbitrary shell/terminal command in arbitrary buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Repeat previous shell/terminal command \END_ITEM - \BEGIN_ITEM - Execute arbitrary shell/terminal command in arbitrary buffer \END_ITEM - \BEGIN_ITEM - Repeat previous shell/terminal command \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Execute 4coder internal command \END_ITEM - \BEGIN_ITEM - Execute 4coder internal command \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Show scrollbar \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Hide scrollbar \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle filebar \END_ITEM - \BEGIN_ITEM - Show scrollbar \END_ITEM - \BEGIN_ITEM - Hide scrollbar \END_ITEM - \BEGIN_ITEM - Toggle filebar \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle mouse input \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle fullscreen mode \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Exit 4coder \END_ITEM - \BEGIN_ITEM - Toggle mouse input); - \BEGIN_ITEM - Toggle fullscreen mode); - \BEGIN_ITEM - Exit 4coder); + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM - \BEGIN_ITEM - Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Launch shell command set in a loaded project \END_ITEM \END_LIST -Long name commands that can be typed in after for infrequently triggered commands. -\SECTION{4coder Internal Command } +\SECTION{4coder Internal Command} +Long name commands that can be typed in after \BEGIN_STYLE{code} \END_STYLE for infrequently triggered commands. \BEGIN_LIST - \BEGIN_ITEM "load project" - Load a project.4coder file, ditching any previously loaded project \END_ITEM - \BEGIN_ITEM "open all code" - Open all code files in the current directory, extensions set in config.4coder, default to C/C++ extensions \END_ITEM - \BEGIN_ITEM "open all code recursive" - Like "open all code" but recurses through folders \END_ITEM - \BEGIN_ITEM "dos lines" - Switch the bufer to 'dos' line ending mode CRLF \END_ITEM - \BEGIN_ITEM "nix lines" - Switch the bufer to 'nix' line ending mode LF \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} "load project" \END_STYLE + Load a project.4coder file, ditching any previously loaded project \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} "open all code" \END_STYLE + Open all code files in the current directory, extensions set in config.4coder, default to C/C++ extensions \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} "open all code recursive" \END_STYLE + Like \BEGIN_STYLE{code} "open all code" \END_STYLE but recurses through folders \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} "dos lines" \END_STYLE + Switch the bufer to 'dos' line ending mode CRLF \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} "nix lines" \END_STYLE + Switch the bufer to 'nix' line ending mode LF \END_ITEM \END_LIST -The following bindings apply in general text files and most apply in code files, but some are overriden by other commands. \SECTION{Text File Bindings} +The following bindings apply in general text files and most apply in code files, but some are overriden by other commands. \BEGIN_LIST - \BEGIN_ITEM - Insert character \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Insert character \END_ITEM - \BEGIN_ITEM - Set cursor position to mouse position \END_ITEM - \BEGIN_ITEM - Set mark position to mouse position \END_ITEM - \BEGIN_ITEM - Set mark position to mouse position \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Set cursor position to mouse position \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Set mark position to mouse position \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Set mark position to mouse position \END_ITEM - \BEGIN_ITEM - Move left \END_ITEM - \BEGIN_ITEM - Move right \END_ITEM - \BEGIN_ITEM - Delete character \END_ITEM - \BEGIN_ITEM - Delete character \END_ITEM - \BEGIN_ITEM - Backspace character \END_ITEM - \BEGIN_ITEM - Backspace character \END_ITEM - \BEGIN_ITEM - Move up \END_ITEM - \BEGIN_ITEM - Move up \END_ITEM - \BEGIN_ITEM - Move to end of line \END_ITEM - \BEGIN_ITEM - Move to beginning of line \END_ITEM - \BEGIN_ITEM - Move up one whole page \END_ITEM - \BEGIN_ITEM - Move down one whole page \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move left \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move right \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Delete character \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Delete character \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Backspace character \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Backspace character \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move up \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move up \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move to end of line \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move to beginning of line \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move up one whole page \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move down one whole page \END_ITEM - \BEGIN_ITEM - Seek right, stop at whitespace \END_ITEM - \BEGIN_ITEM - Seek left, stop at whitespace \END_ITEM - \BEGIN_ITEM - Seek up, stop at blank line \END_ITEM - \BEGIN_ITEM - Seek down, stop at blank line \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek right, stop at whitespace \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek left, stop at whitespace \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek up, stop at blank line \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek down, stop at blank line \END_ITEM - \BEGIN_ITEM - Move up ten lines \END_ITEM - \BEGIN_ITEM - Move down ten lines \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move up ten lines \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move down ten lines \END_ITEM - \BEGIN_ITEM - Delete word backwards \END_ITEM - \BEGIN_ITEM - Delete word forwards \END_ITEM - \BEGIN_ITEM - snipe_token_or_word \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Delete word backwards \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Delete word forwards \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE snipe_token_or_word \END_ITEM \BEGIN_ITEM Note: 'the range' in the following commands refers to the text between the mark and cursor. \END_ITEM - \BEGIN_ITEM - Set mark to the cursor position \END_ITEM - \BEGIN_ITEM - Replace a substring in the range \END_ITEM - \BEGIN_ITEM - Copy text from the range \END_ITEM - \BEGIN_ITEM - Delete the text in the range \END_ITEM - \BEGIN_ITEM - Center the active view on the cursor \END_ITEM - \BEGIN_ITEM - Move the view so that it's left edge is near the cursor's current x position \END_ITEM - \BEGIN_ITEM - Begin an incremental search through the current buffer \END_ITEM - \BEGIN_ITEM - Create a jump location list of all loaded exact matches of a string \END_ITEM - \BEGIN_ITEM - Create a jump location list of all loaded substring matches of a string without case sensitivity \END_ITEM - \BEGIN_ITEM - Goto a specific line number \END_ITEM - \BEGIN_ITEM - Convert text in the range to lowercase \END_ITEM - \BEGIN_ITEM - Kill the current buffer \END_ITEM - \BEGIN_ITEM - Toggle line wrapping on the current buffer \END_ITEM - \BEGIN_ITEM - Swap the cursor and mark positions \END_ITEM - \BEGIN_ITEM - Reload the current buffer from the file system \END_ITEM - \BEGIN_ITEM - Begin an iterative query replace \END_ITEM - \BEGIN_ITEM - Begin an iterative query replace to replace the word under the cursor \END_ITEM - \BEGIN_ITEM - Begin a reversed incremental search through the current buffer \END_ITEM - \BEGIN_ITEM - Save the current buffer with it's given filename \END_ITEM - \BEGIN_ITEM - Begin an incremenal search through the current buffer for the word under the cursor \END_ITEM - \BEGIN_ITEM - Create a jump location list of all loaded exact matches of the word under the cursor \END_ITEM - \BEGIN_ITEM - Convert text in the range to uppercase \END_ITEM - \BEGIN_ITEM - Paste from the clipboard \END_ITEM - \BEGIN_ITEM - Toggle the virtual whitespace system \END_ITEM - \BEGIN_ITEM - Paste the next item on the clipboard, 4coder keeps a finite history of past 64 copies \END_ITEM - \BEGIN_ITEM - Copy text from the range and delete the range (aka cut) \END_ITEM - \BEGIN_ITEM - Redo \END_ITEM - \BEGIN_ITEM - Undo \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Set mark to the cursor position \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Replace a substring in the range \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Copy text from the range \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Delete the text in the range \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Center the active view on the cursor \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Move the view so that it's left edge is near the cursor's current x position \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Begin an incremental search through the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Create a jump location list of all loaded exact matches of a string \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Create a jump location list of all loaded substring matches of a string without case sensitivity \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Goto a specific line number \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Convert text in the range to lowercase \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Kill the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle line wrapping on the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Swap the cursor and mark positions \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Reload the current buffer from the file system \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Begin an iterative query replace \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Begin an iterative query replace to replace the word under the cursor \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Begin a reversed incremental search through the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Save the current buffer with it's given filename \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Begin an incremenal search through the current buffer for the word under the cursor \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Create a jump location list of all loaded exact matches of the word under the cursor \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Convert text in the range to uppercase \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Paste from the clipboard \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle the virtual whitespace system \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Paste the next item on the clipboard, 4coder keeps a finite history of past 64 copies \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Copy text from the range and delete the range (aka cut) \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Redo \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Undo \END_ITEM - \BEGIN_ITEM - Decrease the line wrap width for the current buffer \END_ITEM - \BEGIN_ITEM - Increase the line wrap width for the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Decrease the line wrap width for the current buffer \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Increase the line wrap width for the current buffer \END_ITEM - \BEGIN_ITEM - Toggle the show whitespace option \END_ITEM - \BEGIN_ITEM - Clean trailing whitespace from all lines \END_ITEM - \BEGIN_ITEM - Interpret jump location under cursor and jump to it, lock the next/prev jump commands to this jump location list (only in read only files) \END_ITEM - \BEGIN_ITEM - Like previous command but tries to open the jump location in the view that currently holds the jump location list \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Toggle the show whitespace option \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Clean trailing whitespace from all lines \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Interpret jump location under cursor and jump to it, lock the next/prev jump commands to this jump location list (only in read only files) \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Like previous command but tries to open the jump location in the view that currently holds the jump location list \END_ITEM \END_LIST +\SECTION{Code File Bindings} The following commands only apply in C/C++ files where the lexer (syntax highlighting) is turned on. -\SECTION{Text File Bindings} \BEGIN_LIST - bind(context, key_right, MDFR_CTRL, seek_alphanumeric_or_camel_right); - bind(context, key_left, MDFR_CTRL, seek_alphanumeric_or_camel_left); + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek right stop at alphanumeric or camel case \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Seek left stop at alphanumeric or camel case \END_ITEM - bind(context, '\n', MDFR_NONE, write_and_auto_tab); - bind(context, '\n', MDFR_SHIFT, write_and_auto_tab); - bind(context, '}', MDFR_NONE, write_and_auto_tab); - bind(context, ')', MDFR_NONE, write_and_auto_tab); - bind(context, ']', MDFR_NONE, write_and_auto_tab); - bind(context, ';', MDFR_NONE, write_and_auto_tab); - bind(context, '#', MDFR_NONE, write_and_auto_tab); + \BEGIN_ITEM \BEGIN_STYLE{code} <}> \END_STYLE Insert character and trigger auto indentation \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} <)> \END_STYLE Insert character and trigger auto indentation \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} <]> \END_STYLE Insert character and trigger auto indentation \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} <;> \END_STYLE Insert character and trigger auto indentation \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} <#> \END_STYLE Insert character and trigger auto indentation \END_ITEM - bind(context, '\t', MDFR_NONE, word_complete); - bind(context, '\t', MDFR_CTRL, auto_tab_range); - bind(context, '\t', MDFR_SHIFT, auto_tab_line_at_cursor); + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Automatically complete partial word \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Auto indent the range \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Auto indent the line at the cursor \END_ITEM - bind(context, 't', MDFR_ALT, write_todo); - bind(context, 'y', MDFR_ALT, write_note); - bind(context, 'r', MDFR_ALT, write_block); - bind(context, '[', MDFR_CTRL, open_long_braces); - bind(context, '{', MDFR_CTRL, open_long_braces_semicolon); - bind(context, '}', MDFR_CTRL, open_long_braces_break); - bind(context, 'i', MDFR_ALT, if0_off); - bind(context, '1', MDFR_ALT, open_file_in_quotes); - bind(context, '2', MDFR_ALT, open_matching_file_cpp); - bind(context, '0', MDFR_CTRL, write_zero_struct); - bind(context, 'I', MDFR_CTRL, list_all_functions_current_buffer); - - \END_LIST \ No newline at end of file + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Insert a TODO comment \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Insert a NOTE comment \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Insert a block comment \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open a pair of braces \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open a pair of braces ended with a semicolon \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Open a pair of braces ended with a break \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Surround the range with #if 0 and #endif \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Try to open a file named by the string surrounded by quotes under the cursor \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Switch from .cpp \BEGIN_STYLE{code} <-> \END_STYLE .h \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE Insert the characters " = {0};" \END_ITEM + \BEGIN_ITEM \BEGIN_STYLE{code} \END_STYLE List all function signatures in the current buffer \END_ITEM + + \END_LIST diff --git a/site/source_material/home.txt b/site/source_material/home.txt index a37ced4d..8d030f0c 100644 --- a/site/source_material/home.txt +++ b/site/source_material/home.txt @@ -11,7 +11,7 @@ If you cannot find what you are looking for please contact \BEGIN_STYLE{code} ed \BEGIN_LINK{document:features} The official 4coder feature list \END_LINK -\BEGIN_LINK{documents:binding_list} The list of default 4coder bindings \END_LINK +\BEGIN_LINK{document:bindings} The list of default 4coder bindings \END_LINK \BEGIN_LINK{document:roadmap} The official 4coder road map \END_LINK diff --git a/win32_4ed.cpp b/win32_4ed.cpp index d69fcb7e..b8cc4a9e 100644 --- a/win32_4ed.cpp +++ b/win32_4ed.cpp @@ -803,7 +803,8 @@ Sys_Set_File_List_Sig(system_set_file_list){ (find_data.cFileName[0] == '.' && find_data.cFileName[1] == 0) ||(find_data.cFileName[0] == '.' && find_data.cFileName[1] == '.' && find_data.cFileName[2] == 0); if (!nav_dir){ - info->folder = (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; + u32 attibs = find_data.dwFileAttributes; + info->folder = (attribs & FILE_ATTRIBUTE_DIRECTORY) != 0; info->filename = (char*)name; u16 *src = (u16*)find_data.cFileName;