86 else if (!
ELEM(c,
'\t',
' ')) {
87 *r_last_state =
false;
124 const int line1_char,
126 const int line2_char)
134 if (
txt_get_span(line1, line2) > 0 || (line1 == line2 && line1_char <= line2_char)) {
137 start_char = line1_char;
138 end_char = line2_char;
143 start_char = line2_char;
144 end_char = line1_char;
147 for (
const TextLine *line = start_line; line != end_line->
next; line = line->
next) {
148 const int start = (line == start_line) ? start_char : 0;
149 const int end = (line == end_line) ? end_char : line->len;
151 for (
int i = start;
i < end;
i++) {
152 if (!
ELEM(line->line[
i],
' ',
'\t',
'\n')) {
170 bool line_start =
true;
173 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
177 if (in_buf[in_offset] ==
'\t' && line_start) {
183 const int out_size = strlen(in_buf) + num_tabs * (tab_size - 1) + 1;
187 int spaces_until_tab = 0;
191 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
195 if (in_buf[in_offset] ==
'\t' && line_start) {
197 int num_spaces = tab_size - (spaces_until_tab % tab_size);
198 spaces_until_tab = 0;
201 memset(&out_buf[out_offset],
' ', num_spaces);
202 out_offset += num_spaces;
205 if (in_buf[in_offset] ==
' ') {
208 else if (in_buf[in_offset] ==
'\n') {
209 spaces_until_tab = 0;
212 out_buf[out_offset++] = in_buf[in_offset];
216 out_buf[out_offset] =
'\0';
217 *r_out_buf_len = out_offset;
236 if (buf ==
nullptr) {
369 st->
runtime->scroll_ofs_px[0] = 0;
370 st->
runtime->scroll_ofs_px[1] = 0;
382 ot->name =
"New Text";
383 ot->idname =
"TEXT_OT_new";
384 ot->description =
"Create a new text data-block";
447 st->
runtime->scroll_ofs_px[0] = 0;
448 st->
runtime->scroll_ofs_px[1] = 0;
467 const char *filepath =
nullptr;
473 filepath = filepath_buf;
494 ot->name =
"Open Text";
495 ot->idname =
"TEXT_OT_open";
496 ot->description =
"Open a new text data-block";
516 ot->srna,
"internal",
false,
"Make Internal",
"Make text file internal after loading");
532 const int orig_top = st->
top;
534 const int orig_curc = text->
curc;
574 IFACE_(
"Reload active text file?"),
585 ot->idname =
"TEXT_OT_reload";
586 ot->description =
"Reload active text data-block from its file";
636 IFACE_(
"Delete active text file?"),
647 ot->idname =
"TEXT_OT_unlink";
648 ot->description =
"Unlink active text data-block";
682 ot->name =
"Make Internal";
683 ot->idname =
"TEXT_OT_make_internal";
684 ot->description =
"Make active text file internal";
717 reports,
RPT_ERROR,
"Cannot save text file, path \"%s\" is not writable", filepath);
725 "Unable to save '%s': %s",
727 errno ? strerror(errno) :
RPT_(
"unknown error writing file"));
732 fputs(tmp->line, fp);
741 text->
mtime = st.st_mtime;
750 "Unable to stat '%s': %s",
752 errno ? strerror(errno) :
RPT_(
"unknown error statting file"));
788 ot->idname =
"TEXT_OT_save";
789 ot->description =
"Save active text data-block";
838 const char *filepath =
nullptr;
844 filepath = filepath_buf;
851 filepath = text->
id.
name + 2;
867 ot->name =
"Save As";
868 ot->idname =
"TEXT_OT_save_as";
869 ot->description =
"Save active text file with options";
896 const bool is_live = (reports ==
nullptr);
899 void *curl_prev = text->
curl;
900 int curc_prev = text->
curc;
901 int selc_prev = text->
selc;
915 if (text->
curl != curl_prev || curc_prev != text->
curc || selc_prev != text->
selc) {
947 ot->name =
"Run Script";
948 ot->idname =
"TEXT_OT_run_script";
949 ot->description =
"Run active script";
1013 ot->idname =
"TEXT_OT_paste";
1014 ot->description =
"Paste text from clipboard";
1029 "Paste text selected elsewhere rather than copied (X11/Wayland only)");
1060 ot->name =
"Duplicate Line";
1061 ot->idname =
"TEXT_OT_duplicate_line";
1062 ot->description =
"Duplicate the current line";
1107 ot->idname =
"TEXT_OT_copy";
1108 ot->description =
"Copy selected text to clipboard";
1148 ot->idname =
"TEXT_OT_cut";
1149 ot->description =
"Cut selected text to clipboard";
1169 bool text_before_cursor = text->
curc != 0 && !
ELEM(line->
line[text->
curc - 1],
' ',
'\t');
1170 if (text_before_cursor && (
txt_has_sel(text) ==
false)) {
1184 ot->name =
"Indent or Autocomplete";
1185 ot->idname =
"TEXT_OT_indent_or_autocomplete";
1186 ot->description =
"Indent selected text or autocomplete";
1230 ot->name =
"Indent";
1231 ot->idname =
"TEXT_OT_indent";
1232 ot->description =
"Indent selected text";
1271 ot->name =
"Unindent";
1272 ot->idname =
"TEXT_OT_unindent";
1273 ot->description =
"Unindent selected text";
1303 for (a = 0; a < curts; a++) {
1328 ot->name =
"Line Break";
1329 ot->idname =
"TEXT_OT_line_break";
1330 ot->description =
"Insert line break at cursor position";
1386 {0,
"TOGGLE", 0,
"Toggle Comments",
nullptr},
1387 {1,
"COMMENT", 0,
"Comment",
nullptr},
1388 {-1,
"UNCOMMENT", 0,
"Un-Comment",
nullptr},
1389 {0,
nullptr, 0,
nullptr,
nullptr},
1393 ot->name =
"Toggle Comments";
1394 ot->idname =
"TEXT_OT_comment_toggle";
1405 prop =
RNA_def_enum(
ot->srna,
"type", comment_items, 0,
"Type",
"Add or remove comments");
1417 {
TO_SPACES,
"SPACES", 0,
"To Spaces",
nullptr},
1418 {
TO_TABS,
"TABS", 0,
"To Tabs",
nullptr},
1419 {0,
nullptr, 0,
nullptr,
nullptr},
1427 size_t a, j, max_len = 0;
1430 const int curc_column = text->
curl ?
1434 const int selc_column = text->
sell ?
1456 tmp->line = new_line;
1457 tmp->len = strlen(new_line);
1458 tmp->format =
nullptr;
1459 max_len = std::max<size_t>(tmp->len, max_len);
1466 const char *text_check_line = tmp->line;
1467 const int text_check_line_len = tmp->len;
1468 char *tmp_line_cur = tmp_line;
1473 for (a = 0; a < text_check_line_len;) {
1475 if (!(a % tab_len) && (text_check_line[a] ==
' ')) {
1478 (j < tab_len) && (a + j < text_check_line_len) && (text_check_line[a + j] ==
' ');
1486 if ((tmp_line_cur == tmp_line) && a != 0) {
1488 memcpy(tmp_line_cur, text_check_line, a);
1491 *tmp_line_cur =
'\t';
1496 if (tmp_line_cur != tmp_line) {
1497 memcpy(tmp_line_cur, &text_check_line[a], j);
1505 if (tmp_line_cur != tmp_line) {
1506 memcpy(tmp_line_cur, &text_check_line[a],
len);
1507 tmp_line_cur +=
len;
1513 if (tmp_line_cur != tmp_line) {
1514 *tmp_line_cur =
'\0';
1517 BLI_assert(tmp_line_cur - tmp_line <= max_len);
1530 tmp->len = strlen(tmp_line);
1532 tmp->format =
nullptr;
1539 if (curc_column != -1) {
1543 if (selc_column != -1) {
1559 ot->name =
"Convert Whitespace";
1560 ot->idname =
"TEXT_OT_convert_whitespace";
1561 ot->description =
"Convert whitespaces by type";
1576 "Type of whitespace to convert to");
1602 ot->name =
"Select All";
1603 ot->idname =
"TEXT_OT_select_all";
1604 ot->description =
"Select all text";
1634 ot->name =
"Select Line";
1635 ot->idname =
"TEXT_OT_select_line";
1636 ot->description =
"Select text by line";
1667 ot->name =
"Select Word";
1668 ot->idname =
"TEXT_OT_select_word";
1669 ot->description =
"Select word under cursor";
1707 {0,
nullptr, 0,
nullptr,
nullptr},
1711 ot->name =
"Move Lines";
1712 ot->idname =
"TEXT_OT_move_lines";
1713 ot->description =
"Move the currently selected line(s) up/down";
1723 RNA_def_enum(
ot->srna,
"direction", direction_items, 1,
"Direction",
"");
1733 {
LINE_BEGIN,
"LINE_BEGIN", 0,
"Line Begin",
""},
1734 {
LINE_END,
"LINE_END", 0,
"Line End",
""},
1735 {
FILE_TOP,
"FILE_TOP", 0,
"File Top",
""},
1736 {
FILE_BOTTOM,
"FILE_BOTTOM", 0,
"File Bottom",
""},
1737 {
PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
1738 {
NEXT_CHAR,
"NEXT_CHARACTER", 0,
"Next Character",
""},
1739 {
PREV_WORD,
"PREVIOUS_WORD", 0,
"Previous Word",
""},
1740 {
NEXT_WORD,
"NEXT_WORD", 0,
"Next Word",
""},
1741 {
PREV_LINE,
"PREVIOUS_LINE", 0,
"Previous Line",
""},
1742 {
NEXT_LINE,
"NEXT_LINE", 0,
"Next Line",
""},
1743 {
PREV_PAGE,
"PREVIOUS_PAGE", 0,
"Previous Page",
""},
1744 {
NEXT_PAGE,
"NEXT_PAGE", 0,
"Next Page",
""},
1745 {0,
nullptr, 0,
nullptr,
nullptr},
1754 int i, j, start, end,
max, curs, endj, selc;
1755 bool chop, loop, found;
1760 selc = start = endj = curs = found =
false;
1769 ch = linein->
line[j];
1779 if (rell == 0 &&
i - start <= relc && i + columns - start > relc) {
1785 else if (
i - end <= relc && i + columns - end > relc) {
1788 if (
i + columns - start >
max) {
1789 end = std::min(end,
i);
1794 if (selc > endj && !chop) {
1810 if (rell == 0 &&
i + columns - start > relc) {
1816 else if (ch ==
'\0') {
1823 else if (
ELEM(ch,
' ',
'-')) {
1829 if (rell == 0 &&
i + columns - start > relc) {
1853 int offl, offc, visible_lines;
1863 if (*rell - visible_lines + offl >= 0) {
1864 if (!(*linep)->next) {
1865 if (offl < visible_lines - 1) {
1866 *rell = visible_lines - 1;
1870 *charp = (*linep)->len;
1874 *rell -= visible_lines - offl;
1875 *
linep = (*linep)->next;
1883 if (*rell + offl <= 0) {
1884 if (!(*linep)->prev) {
1895 *
linep = (*linep)->prev;
1908 if (*rell + visible_lines >= 0) {
1909 *rell += visible_lines;
1913 if (!(*linep)->prev) {
1918 *rell += visible_lines;
1919 *
linep = (*linep)->prev;
1922 if (*rell - visible_lines < 0) {
1926 if (!(*linep)->next) {
1927 *rell = visible_lines - 1;
1931 *rell -= visible_lines;
1932 *
linep = (*linep)->next;
1944 int oldc,
i, j,
max, start, end, endj;
1952 charp = &text->
selc;
1956 charp = &text->
curc;
1973 ch = (*linep)->line[j];
1983 if (
i + columns - start >
max) {
1984 end = std::min(end,
i);
1991 (*linep)->line, (*linep)->len, start,
TXT_TABSIZE);
2005 else if (
ELEM(ch,
' ',
'-',
'\0')) {
2008 (*linep)->line, (*linep)->len, start,
TXT_TABSIZE);
2031 int oldc,
i, j,
max, start, end, endj;
2039 charp = &text->
selc;
2043 charp = &text->
curc;
2060 ch = (*linep)->line[j];
2070 if (
i + columns - start >
max) {
2071 end = std::min(end,
i);
2079 *charp = (*linep)->len;
2092 else if (ch ==
'\0') {
2093 *charp = (*linep)->len;
2097 else if (
ELEM(ch,
' ',
'-')) {
2116 int offl, offc,
col;
2122 charp = &text->
selc;
2126 charp = &text->
curc;
2135 if ((*linep)->prev) {
2138 *
linep = (*linep)->prev;
2157 int offl, offc,
col, visible_lines;
2163 charp = &text->
selc;
2167 charp = &text->
curc;
2173 if (offl < visible_lines - 1) {
2177 if ((*linep)->next) {
2178 *
linep = (*linep)->next;
2182 *charp = (*linep)->len;
2206 charp = &text->
selc;
2210 charp = &text->
curc;
2213 if (st && region && st->
wordwrap) {
2222 while (lines > 0 && (*linep)->next) {
2223 *
linep = (*linep)->next;
2226 while (lines < 0 && (*linep)->prev) {
2227 *
linep = (*linep)->prev;
2232 *charp = std::min(*charp, (*linep)->len);
2255 if (st && st->
wordwrap && region) {
2267 if (st && st->
wordwrap && region) {
2318 if (st && st->
wordwrap && region) {
2327 if (st && st->
wordwrap && region) {
2374 ot->name =
"Move Cursor";
2375 ot->idname =
"TEXT_OT_move";
2376 ot->description =
"Move cursor to position type";
2402 ot->name =
"Move Select";
2403 ot->idname =
"TEXT_OT_move_select";
2404 ot->description =
"Move the cursor while selecting";
2416 "Where to move cursor to, to make a selection");
2436 else if (line > nlines) {
2458 ot->idname =
"TEXT_OT_jump";
2459 ot->description =
"Jump cursor to line";
2468 ot->srna,
"line", 1, 1, INT_MAX,
"Line",
"Line number to jump to", 1, 10000);
2480 {
DEL_PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
2483 {0,
nullptr, 0,
nullptr,
nullptr},
2528 if (*curr !=
'\0') {
2530 if ((curr != prev) &&
2579 ot->name =
"Delete";
2580 ot->idname =
"TEXT_OT_delete";
2581 ot->description =
"Delete text by cursor position";
2597 "Which part of the text to delete");
2621 ot->name =
"Toggle Overwrite";
2622 ot->idname =
"TEXT_OT_overwrite_toggle";
2623 ot->description =
"Toggle overwrite while typing";
2644 last = last - (st->
runtime->viewlines / 2);
2645 if (last > 0 && st->
top > last) {
2727 const int mval[2] = {
event->xy[0],
event->xy[1]};
2752 for (
int i = 0;
i < 2;
i += 1) {
2761 int scroll_ofs_new[2] = {
2765 int scroll_ofs_px_new[2] = {
2770 for (
int i = 0;
i < 2;
i += 1) {
2772 while (scroll_ofs_px_new[
i] < 0) {
2774 scroll_ofs_new[
i] -= 1;
2778 if (scroll_ofs_new[
i] < 0) {
2779 scroll_ofs_new[
i] = 0;
2780 scroll_ofs_px_new[
i] = 0;
2784 scroll_ofs_px_new[
i] = 0;
2790 scroll_ofs_new[0] = 0;
2791 scroll_ofs_px_new[0] = 0;
2795 if (scroll_ofs_new[0] != st->
left || scroll_ofs_new[1] != st->
top ||
2798 scroll_ofs_px_new[1] != st->
runtime->scroll_ofs_px[1])
2801 st->
left = scroll_ofs_new[0];
2802 st->
top = scroll_ofs_new[1];
2803 st->
runtime->scroll_ofs_px[0] = scroll_ofs_px_new[0];
2804 st->
runtime->scroll_ofs_px[1] = scroll_ofs_px_new[1];
2823 st->
runtime->scroll_ofs_px[0] = 0;
2824 st->
runtime->scroll_ofs_px[1] = 0;
2837 switch (event->
type) {
2897 tsc->
mval_delta[0] = (
event->xy[0] -
event->prev_xy[0]) * st->
runtime->cwidth_px / 4;
2898 tsc->
mval_delta[1] = (
event->xy[1] -
event->prev_xy[1]) * st->
runtime->lheight_px / 4;
2914 ot->name =
"Scroll";
2917 ot->idname =
"TEXT_OT_scroll";
2932 ot->srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2965 const int *mval =
event->mval;
2973 if (mval[0] > st->
runtime->scroll_region_handle.xmin &&
2974 mval[0] < st->
runtime->scroll_region_handle.xmax)
2976 if (mval[1] >= st->
runtime->scroll_region_handle.ymin &&
2977 mval[1] <= st->
runtime->scroll_region_handle.ymax)
2983 if (mval[1] < st->
runtime->scroll_region_handle.ymin) {
3024 ot->name =
"Scrollbar";
3027 ot->idname =
"TEXT_OT_scroll_bar";
3041 ot->srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
3074 while (*(
str + j)) {
3077 if (
i +
col > index) {
3102 if (
i + lines > *
y) {
3124 int i = 0, start = 0, end =
max;
3125 int j, curs = 0, endj = 0;
3129 for (j = 0; !found && ((ch =
linep->line[j]) !=
'\0');
3153 if (
y == 0 &&
i - start <= x && i + columns - start >
x) {
3160 else if (
i - end <= x && i + columns - end >
x) {
3163 if (
i + columns - start >
max) {
3164 end = std::min(end,
i);
3169 if (charp > endj && !chop && ch !=
'\0') {
3181 if (j < linep->
len) {
3186 if (
y == 0 &&
i + columns - start >
x) {
3192 else if (
ELEM(ch,
' ',
'-',
'\0')) {
3197 if (
y == 0 &&
i + columns - start >
x) {
3259 charp = &text->
selc;
3263 charp = &text->
curc;
3270 if ((*linep)->next) {
3271 *
linep = (*linep)->next;
3277 if ((*linep)->prev) {
3278 *
linep = (*linep)->prev;
3288 *charp = (*linep)->len;
3298 if (ssel->
timer ==
nullptr) {
3314 ssel->
timer =
nullptr;
3323 if (event->
mval[1] < 0 || event->
mval[1] > region->
winy) {
3337 st, region, std::clamp(event->
mval[0], 0,
int(region->
winx)), event->
mval[1],
true);
3377 if (event->
mval[0] >= st->
runtime->scroll_region_handle.xmin) {
3399 switch (event->
type) {
3425 ot->name =
"Set Selection";
3426 ot->idname =
"TEXT_OT_selection_set";
3427 ot->description =
"Set text selection";
3461 if (event->
mval[0] >= st->
runtime->scroll_region_handle.xmin) {
3474 ot->name =
"Set Cursor";
3475 ot->idname =
"TEXT_OT_cursor_set";
3476 ot->description =
"Set cursor position";
3484 RNA_def_int(
ot->srna,
"x", 0, INT_MIN, INT_MAX,
"X",
"", INT_MIN, INT_MAX);
3485 RNA_def_int(
ot->srna,
"y", 0, INT_MIN, INT_MAX,
"Y",
"", INT_MIN, INT_MAX);
3501 const int *mval =
event->mval;
3503 static int jump_to = 0;
3504 static double last_jump = 0;
3512 if (!(mval[0] > 2 &&
3514 mval[1] > 2 && mval[1] < region->
winy - 2))
3520 if (!(event_ascii >=
'0' && event_ascii <=
'9')) {
3525 if (last_jump < time - 1) {
3530 jump_to += int(event_ascii -
'0');
3544 ot->name =
"Line Number";
3545 ot->idname =
"TEXT_OT_line_number";
3546 ot->description =
"The current line number";
3608 bool do_auto_close =
false;
3609 bool do_auto_close_select =
false;
3611 uint auto_close_char_input = 0;
3612 uint auto_close_char_match = 0;
3619 } auto_close_select = {
nullptr}, auto_close_select_backup = {
nullptr};
3640 if (isascii(auto_close_char_input)) {
3642 if (auto_close_char_match != 0) {
3643 do_auto_close =
true;
3648 do_auto_close_select =
true;
3650 auto_close_select_backup.curl = st->
text->
curl;
3651 auto_close_select_backup.curc = st->
text->
curc;
3652 auto_close_select_backup.sell = st->
text->
sell;
3653 auto_close_select_backup.selc = st->
text->
selc;
3658 auto_close_select.curl = st->
text->
curl;
3659 auto_close_select.curc = st->
text->
curc;
3660 auto_close_select.sell = st->
text->
sell;
3661 auto_close_select.selc = st->
text->
selc;
3672 if (do_auto_close) {
3676 if (do_auto_close_select) {
3678 if (auto_close_select.curl == auto_close_select.sell) {
3679 auto_close_select.selc += auto_close_char_len;
3682 st->
text->
curl = auto_close_select.sell;
3683 st->
text->
curc = auto_close_select.selc;
3691 if (do_auto_close_select) {
3693 if (auto_close_select.curl != auto_close_select.sell) {
3694 TextLine *line = auto_close_select.curl;
3698 }
while (line != auto_close_select.sell);
3700 st->
text->
curl = auto_close_select.curl;
3701 st->
text->
curc = auto_close_select.curc + auto_close_char_len;
3702 st->
text->
sell = auto_close_select.sell;
3703 st->
text->
selc = auto_close_select.selc;
3708 if (do_auto_close_select) {
3709 st->
text->
curl = auto_close_select_backup.curl;
3710 st->
text->
curc = auto_close_select_backup.curc;
3711 st->
text->
sell = auto_close_select_backup.sell;
3712 st->
text->
selc = auto_close_select_backup.selc;
3730 ot->name =
"Insert";
3731 ot->idname =
"TEXT_OT_insert";
3732 ot->description =
"Insert text at cursor position";
3744 ot->srna,
"text",
nullptr, 0,
"Text",
"Text to insert at the cursor position");
3839 ot->name =
"Find Next";
3840 ot->idname =
"TEXT_OT_find";
3841 ot->description =
"Find specified text";
3858 const int flags = st->
flags;
3866 const int orig_curc = text->
curc;
3908 ot->name =
"Replace";
3909 ot->idname =
"TEXT_OT_replace";
3910 ot->description =
"Replace text with the specified text";
3921 prop =
RNA_def_boolean(
ot->srna,
"all",
false,
"Replace All",
"Replace all occurrences");
3951 ot->name =
"Find & Set Selection";
3952 ot->idname =
"TEXT_OT_find_set_selected";
3953 ot->description =
"Find specified text and set as selected";
3982 ot->name =
"Replace & Set Selection";
3983 ot->idname =
"TEXT_OT_replace_set_selected";
3984 ot->description =
"Replace text with specified text and set as selected";
4002 const char *filepath,
4003 const int line_index,
4004 const int column_index)
4006 bool success =
false;
4012 const char *expr_imports[] = {
"_bl_text_utils",
"_bl_text_utils.external_editor",
"os",
nullptr};
4015 std::stringstream expr_stream;
4016 expr_stream <<
"_bl_text_utils.external_editor.open_external_editor(os.fsdecode(b'";
4017 for (
const char *ch = filepath; *ch; ch++) {
4018 expr_stream <<
"\\x" << std::hex << int(*ch);
4020 expr_stream <<
"'), " << std::dec << line_index <<
", " << std::dec << column_index <<
")";
4021 expr = expr_stream.str();
4024 char *expr_result =
nullptr;
4027 if (expr_result[0] ==
'\0') {
4038 UNUSED_VARS(
C, reports, filepath, line_index, column_index);
4045 const char *filepath,
4046 const int line_index,
4047 const int column_index)
4050 Text *text =
nullptr;
4054 if (text_iter->filepath ==
nullptr) {
4057 const char *filepath_iter;
4060 STRNCPY(filepath_iter_buf, text_iter->filepath);
4062 filepath_iter = filepath_iter_buf;
4065 filepath_iter = text_iter->filepath;
4074 if (text ==
nullptr) {
4078 if (text ==
nullptr) {
4083 txt_move_to(text, line_index, column_index,
false);
4105 if (text->filepath !=
nullptr) {
4107 const int line_index =
BLI_findindex(&text->lines, text->curl);
4111 STRNCPY(filepath, text->filepath);
4128 if (filepath[0] ==
'\0') {
4134 printf(
"%s:%d:%d\n", filepath, line_index + 1, column_index);
4137 if (
U.text_editor[0] !=
'\0') {
4139 C, op->
reports, filepath, line_index, column_index);
4143 C, op->
reports, filepath, line_index, column_index);
4154 ot->name =
"Jump to File at Point";
4155 ot->idname =
"TEXT_OT_jump_to_file_at_point";
4156 ot->description =
"Jump to a file for the text editor";
4167 prop =
RNA_def_int(
ot->srna,
"line", 0, 0, INT_MAX,
"Line",
"Line to jump to", 1, 10000);
4170 prop =
RNA_def_int(
ot->srna,
"column", 0, 0, INT_MAX,
"Column",
"Column to jump to", 1, 10000);
4186 {0,
nullptr, 0,
nullptr,
nullptr},
4205 switch (resolution) {
4233 C,
IFACE_(
"File Modified Outside and Inside Blender"), ICON_NONE);
4236 op->
type,
IFACE_(
"Reload from disk (ignore local changes)"), ICON_NONE);
4238 op_ptr = layout->
op(op->
type,
IFACE_(
"Save to disk (ignore outside changes)"), ICON_NONE);
4240 op_ptr = layout->
op(op->
type,
IFACE_(
"Make text internal (separate copy)"), ICON_NONE);
4249 op_ptr = layout->
op(op->
type,
IFACE_(
"Make text internal (separate copy)"), ICON_NONE);
4251 op_ptr = layout->
op(op->
type,
IFACE_(
"Ignore"), ICON_NONE);
4261 op_ptr = layout->
op(op->
type,
IFACE_(
"Recreate file"), ICON_NONE);
4273 ot->name =
"Resolve Conflict";
4274 ot->idname =
"TEXT_OT_resolve_conflict";
4275 ot->description =
"When external text is out of sync, resolve the conflict";
4288 "How to solve conflict due to differences in internal and external text");
4310 ot->name =
"To 3D Object";
4311 ot->idname =
"TEXT_OT_to_3d_object";
4312 ot->description =
"Create 3D text object from active text data-block";
4323 ot->srna,
"split_lines",
false,
"Split Lines",
"Create one object per line in the text");
4338 if (text ==
nullptr) {
4363 for (
bNode *node : ntree->all_nodes()) {
4366 if (ngroup && !done_trees.
contains(ngroup)) {
4406 if (cam->custom_shader == text) {
4425 ot->name =
"Shader Update";
4427 "Update users of this shader, such as custom cameras and script nodes, with its new sockets "
4429 ot->idname =
"TEXT_OT_update_shader";
SpaceText * CTX_wm_space_text(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Text * CTX_data_edit_text(const bContext *C)
RenderEngineType * CTX_data_engine_type(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
bool BKE_id_is_editable(const Main *bmain, const ID *id)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
#define FOREACH_NODETREE_END
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void txt_move_down(struct Text *text, bool sel)
void void txt_split_curline(struct Text *text)
int txt_setcurr_tab_spaces(struct Text *text, int space)
bool txt_has_sel(const struct Text *text)
void txt_move_eof(struct Text *text, bool sel)
void txt_delete_selected(struct Text *text)
void txt_delete_char(struct Text *text)
bool txt_cursor_is_line_end(const struct Text *text)
void txt_sel_line(struct Text *text)
void txt_move_toline(struct Text *text, unsigned int line, bool sel)
bool txt_replace_char(struct Text *text, unsigned int add)
int txt_calc_tab_right(const struct TextLine *tl, int ch)
void txt_backspace_char(struct Text *text)
void txt_sel_clear(struct Text *text)
void txt_move_left(struct Text *text, bool sel)
bool txt_add_char(struct Text *text, unsigned int add)
int txt_calc_tab_left(const struct TextLine *tl, int ch)
void txt_delete_word(struct Text *text)
void txt_move_bof(struct Text *text, bool sel)
void txt_move_right(struct Text *text, bool sel)
int txt_get_span(const struct TextLine *from, const struct TextLine *to)
void txt_move_lines(struct Text *text, int direction)
struct Text * BKE_text_add(struct Main *bmain, const char *name)
void txt_comment(struct Text *text, const char *prefix)
struct Text struct Text * BKE_text_load(struct Main *bmain, const char *filepath, const char *relbase) ATTR_NONNULL(1
void txt_jump_left(struct Text *text, bool sel, bool use_init_step)
void int BKE_text_file_modified_check(const struct Text *text)
void txt_move_eol(struct Text *text, bool sel)
void txt_backspace_word(struct Text *text)
void txt_jump_right(struct Text *text, bool sel, bool use_init_step)
void txt_move_up(struct Text *text, bool sel)
bool txt_find_string(struct Text *text, const char *findstr, int wrap, int match_case)
void BKE_text_file_modified_ignore(struct Text *text)
void txt_move_bol(struct Text *text, bool sel)
struct Text * BKE_text_load_ex(struct Main *bmain, const char *filepath, const char *relbase, bool is_internal) ATTR_NONNULL(1
void txt_sel_all(struct Text *text)
void txt_order_cursors(struct Text *text, bool reverse)
bool txt_unindent(struct Text *text)
void txt_indent(struct Text *text)
void txt_duplicate_line(struct Text *text)
char * txt_sel_to_buf(const struct Text *text, size_t *r_buf_strlen)
void txt_insert_buf(struct Text *text, const char *in_buffer, int in_buffer_len) ATTR_NONNULL(1
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, bool sel)
bool txt_cursor_is_line_start(const struct Text *text)
void txt_pop_sel(struct Text *text)
bool BKE_text_reload(struct Text *text)
bool txt_uncomment(struct Text *text, const char *prefix)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_file_is_writable(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int max_ii(int a, int b)
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int char char int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
void BLI_str_cursor_step_bounds_utf8(const char *str, int str_maxlen, int pos, int *r_start, int *r_end)
int BLI_str_utf8_char_width_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_to_index(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
const char * BLI_str_find_prev_char_utf8(const char *p, const char *str_start) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1
unsigned int BLI_str_utf8_as_unicode_step_safe(const char *__restrict p, size_t p_len, size_t *__restrict index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
unsigned int unsigned int size_t BLI_str_utf8_from_unicode_len(unsigned int c) ATTR_WARN_UNUSED_RESULT
#define STRNCPY_UTF8(dst, src)
unsigned int BLI_str_utf8_as_unicode_or_error(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_from_column_with_tabs(const char *str, size_t str_len, int column_target, int tab_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_to_column_with_tabs(const char *str, size_t str_len, int offset_target, int tab_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Platform independent time functions.
double BLI_time_now_seconds(void)
#define BLT_I18NCONTEXT_ID_TEXT
void BPY_text_free_code(Text *text)
bool bool BPY_run_text(bContext *C, Text *text, ReportList *reports, bool do_jump) ATTR_NONNULL(1
bool bool bool bool BPY_run_string_as_string(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1
#define ID_BLEND_PATH(_bmain, _id)
@ USER_TEXT_EDIT_AUTO_CLOSE
void ED_area_tag_redraw(ScrArea *area)
bool ED_text_activate_in_screen(bContext *C, Text *text)
const char * ED_text_format_comment_line_prefix(Text *text)
UndoStep * ED_text_undo_push_init(bContext *C)
void ED_space_text_scroll_to_cursor(SpaceText *st, ARegion *region, bool center)
Read Guarded memory(de)allocation.
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
@ WM_CAPABILITY_CLIPBOARD_PRIMARY
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool contains(const Key &key) const
void add_new(const Key &key)
void ED_text_to_object(bContext *C, const Text *text, const bool split_lines)
static const EnumPropertyItem delete_type_items[]
static const EnumPropertyItem move_type_items[]
RenderEngine * RE_engine_create(RenderEngineType *type)
void RE_engine_free(RenderEngine *engine)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
int RNA_string_length(PointerRNA *ptr, const char *name)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const char * report_prefix
void(* update_script_node)(struct RenderEngine *engine, struct bNodeTree *ntree, struct bNode *node)
void(* update_custom_camera)(struct RenderEngine *engine, struct Camera *cam)
struct ReportList * reports
SpaceText_Runtime * runtime
struct TextScroll::@255150002250362276003247202274315002261237166372 state
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
wmEventModifierFlag modifier
struct ReportList * reports
struct wmOperatorType * type
void space_text_drawcache_tag_update(SpaceText *st, const bool full)
void space_text_update_cursor_moved(bContext *C)
void space_text_update_character_width(SpaceText *st)
int space_text_get_visible_lines(const SpaceText *st, const ARegion *region, const char *str)
void space_text_wrap_offset_in_line(const SpaceText *st, const ARegion *region, TextLine *linein, int cursin, int *offl, int *offc)
int space_text_get_total_lines(SpaceText *st, const ARegion *region)
int space_text_get_char_pos(const SpaceText *st, const char *line, int cur)
int flatten_string(const SpaceText *st, FlattenString *fs, const char *in)
void flatten_string_free(FlattenString *fs)
int space_text_wrap_width(const SpaceText *st, const ARegion *region)
#define TXT_LINE_HEIGHT(st)
#define TXT_NUMCOL_WIDTH(st)
bool text_space_edit_poll(bContext *C)
#define TXT_BODY_LEFT(st)
static wmOperatorStatus text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_replace_set_selected(wmOperatorType *ot)
static wmOperatorStatus text_convert_whitespace_exec(bContext *C, wmOperator *op)
static bool text_edit_poll(bContext *C)
static bool text_update_shader_text_recursive(RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text, VectorSet< bNodeTree * > &done_trees)
static bool text_span_is_blank(TextLine *line1, const int line1_char, TextLine *line2, const int line2_char)
static bool text_data_poll(bContext *C)
void TEXT_OT_unlink(wmOperatorType *ot)
static wmOperatorStatus text_comment_exec(bContext *C, wmOperator *op)
void TEXT_OT_overwrite_toggle(wmOperatorType *ot)
static void text_cursor_set_to_pos(SpaceText *st, const ARegion *region, int x, int y, const bool sel)
static void space_text_screen_clamp(SpaceText *st, const ARegion *region)
void TEXT_OT_reload(wmOperatorType *ot)
static wmOperatorStatus text_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_open(wmOperatorType *ot)
void text_update_edited(Text *text)
static int cursor_skip_find_line(const SpaceText *st, const ARegion *region, int lines, TextLine **linep, int *charp, int *rell, int *relc)
void TEXT_OT_update_shader(wmOperatorType *ot)
static wmOperatorStatus text_run_script_exec(bContext *C, wmOperator *op)
static void text_open_init(bContext *C, wmOperator *op)
static wmOperatorStatus text_open_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus text_reload_exec(bContext *C, wmOperator *op)
void TEXT_OT_replace(wmOperatorType *ot)
static const EnumPropertyItem resolution_items[]
@ SCROLLHANDLE_INVALID_OUTSIDE
void TEXT_OT_run_script(wmOperatorType *ot)
static wmOperatorStatus text_jump_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus text_line_number_invoke(bContext *C, wmOperator *, const wmEvent *event)
static TextLine * space_text_get_line_pos_wrapped(const SpaceText *st, const ARegion *region, int *y)
static void text_scroll_apply(bContext *C, wmOperator *op, const wmEvent *event)
static void text_scroll_state_init(TextScroll *tsc, SpaceText *st, ARegion *region)
static wmOperatorStatus text_replace_set_selected_exec(bContext *C, wmOperator *)
void TEXT_OT_copy(wmOperatorType *ot)
static wmOperatorStatus move_lines_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_move_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_unindent_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_select_line_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_resolve_conflict_exec(bContext *C, wmOperator *op)
void TEXT_OT_select_line(wmOperatorType *ot)
static void text_selection_set_cancel(bContext *C, wmOperator *op)
static wmOperatorStatus text_find_and_replace(bContext *C, wmOperator *op, short mode)
static wmOperatorStatus text_delete_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_save_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_new(wmOperatorType *ot)
void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot)
void TEXT_OT_scroll(wmOperatorType *ot)
void TEXT_OT_line_break(wmOperatorType *ot)
static wmOperatorStatus text_line_break_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_select_all_exec(bContext *C, wmOperator *)
static bool text_region_edit_poll(bContext *C)
void TEXT_OT_save_as(wmOperatorType *ot)
static wmOperatorStatus text_save_exec(bContext *C, wmOperator *op)
static bool text_region_scroll_poll(bContext *C)
static void txt_copy_clipboard(const Text *text)
static void text_cursor_set_exit(bContext *C, wmOperator *op)
void TEXT_OT_paste(wmOperatorType *ot)
void TEXT_OT_make_internal(wmOperatorType *ot)
void TEXT_OT_to_3d_object(wmOperatorType *ot)
void TEXT_OT_indent(wmOperatorType *ot)
bool text_space_edit_poll(bContext *C)
void TEXT_OT_select_all(wmOperatorType *ot)
static void txt_wrap_move_eol(SpaceText *st, ARegion *region, const bool sel)
static bool text_jump_to_file_at_point_external(bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static wmOperatorStatus text_cut_exec(bContext *C, wmOperator *)
void TEXT_OT_select_word(wmOperatorType *ot)
static wmOperatorStatus text_copy_exec(bContext *C, wmOperator *)
void TEXT_OT_save(wmOperatorType *ot)
BLI_INLINE int space_text_pixel_x_to_column(const SpaceText *st, const int x)
static wmOperatorStatus text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus text_reload_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus text_open_exec(bContext *C, wmOperator *op)
void TEXT_OT_move_lines(wmOperatorType *ot)
static wmOperatorStatus text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus text_jump_to_file_at_point_exec(bContext *C, wmOperator *op)
void TEXT_OT_cursor_set(wmOperatorType *ot)
static wmOperatorStatus text_paste_exec(bContext *C, wmOperator *op)
static char * buf_tabs_to_spaces(const char *in_buf, const int tab_size, int *r_out_buf_len)
static wmOperatorStatus text_jump_exec(bContext *C, wmOperator *op)
static void space_text_cursor_set_to_pos_wrapped(const SpaceText *st, const ARegion *region, int x, int y, const bool sel)
void TEXT_OT_scroll_bar(wmOperatorType *ot)
void TEXT_OT_find(wmOperatorType *ot)
static wmOperatorStatus text_toggle_overwrite_exec(bContext *C, wmOperator *)
void TEXT_OT_duplicate_line(wmOperatorType *ot)
void TEXT_OT_move_select(wmOperatorType *ot)
static int flatten_width(SpaceText *st, const char *str)
static wmOperatorStatus text_to_3d_object_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_select_word_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_indent_or_autocomplete_exec(bContext *C, wmOperator *)
static void text_cursor_timer_ensure(bContext *C, SetSelection *ssel)
static bool text_update_shader_poll(bContext *C)
static bool text_new_poll(bContext *)
void TEXT_OT_jump(wmOperatorType *ot)
static wmOperatorStatus text_save_as_exec(bContext *C, wmOperator *op)
static void text_cursor_timer_remove(bContext *C, SetSelection *ssel)
static wmOperatorStatus text_new_exec(bContext *C, wmOperator *)
void TEXT_OT_delete(wmOperatorType *ot)
static wmOperatorStatus text_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *)
void TEXT_OT_selection_set(wmOperatorType *ot)
static bool text_scroll_poll(bContext *C)
static int flatten_column_to_offset(SpaceText *st, const char *str, int index)
static wmOperatorStatus text_unlink_exec(bContext *C, wmOperator *)
void TEXT_OT_find_set_selected(wmOperatorType *ot)
static wmOperatorStatus text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus text_find_set_selected_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_indent_exec(bContext *C, wmOperator *)
static void txt_wrap_move_bol(SpaceText *st, ARegion *region, const bool sel)
static wmOperatorStatus text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_unindent(wmOperatorType *ot)
void TEXT_OT_insert(wmOperatorType *ot)
static wmOperatorStatus text_cursor_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static const EnumPropertyItem whitespace_type_items[]
static wmOperatorStatus text_selection_set_modal(bContext *C, wmOperator *op, const wmEvent *event)
void TEXT_OT_comment_toggle(wmOperatorType *ot)
static int space_text_get_cursor_rel(const SpaceText *st, const ARegion *region, TextLine *linein, int rell, int relc)
void TEXT_OT_jump_to_file_at_point(wmOperatorType *ot)
static void space_text_cursor_skip(const SpaceText *st, const ARegion *region, Text *text, int lines, const bool sel)
static char text_closing_character_pair_get(const char character)
static wmOperatorStatus text_replace_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_update_shader_exec(bContext *C, wmOperator *op)
static bool text_unlink_poll(bContext *C)
static wmOperatorStatus text_find_exec(bContext *C, wmOperator *op)
void TEXT_OT_resolve_conflict(wmOperatorType *ot)
static wmOperatorStatus text_scroll_exec(bContext *C, wmOperator *op)
void TEXT_OT_move(wmOperatorType *ot)
static void space_text_screen_skip(SpaceText *st, ARegion *region, int lines)
static void text_open_cancel(bContext *, wmOperator *op)
void TEXT_OT_line_number(wmOperatorType *ot)
void text_update_line_edited(TextLine *line)
static void test_line_start(char c, bool *r_last_state)
static bool text_resolve_conflict_poll(bContext *C)
void TEXT_OT_convert_whitespace(wmOperatorType *ot)
static void text_select_update_primary_clipboard(const Text *text)
static wmOperatorStatus text_move_select_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_make_internal_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_run_script(bContext *C, ReportList *reports)
static void txt_wrap_move_down(SpaceText *st, ARegion *region, const bool sel)
void TEXT_OT_cut(wmOperatorType *ot)
static wmOperatorStatus text_cursor_set_exec(bContext *C, wmOperator *op)
static wmOperatorStatus text_replace_all(bContext *C)
static wmOperatorStatus text_insert_exec(bContext *C, wmOperator *op)
static bool text_jump_to_file_at_point_internal(bContext *C, ReportList *reports, const char *filepath, const int line_index, const int column_index)
static void txt_wrap_move_up(SpaceText *st, ARegion *region, const bool sel)
static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *event)
static void text_scroll_cancel(bContext *C, wmOperator *op)
static void scroll_exit(bContext *C, wmOperator *op)
static wmOperatorStatus text_duplicate_line_exec(bContext *C, wmOperator *)
static wmOperatorStatus text_move_cursor(bContext *C, int type, bool select)
static void txt_write_file(Main *bmain, Text *text, ReportList *reports)
@ SCROLLHANDLE_MIN_OUTSIDE
@ SCROLLHANDLE_MAX_OUTSIDE
char WM_event_utf8_to_ascii(const wmEvent *event)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)
void WM_clipboard_text_set(const char *buf, bool selection)
char * WM_clipboard_text_get(bool selection, bool ensure_utf8, int *r_len)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const wmEventType event_type, const double time_step)
eWM_CapabilitiesFlag WM_capabilities_flag()
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)