84 else if (!
ELEM(c,
'\t',
' ')) {
85 *r_last_state =
false;
122 const int line1_char,
124 const int line2_char)
132 if (
txt_get_span(line1, line2) > 0 || (line1 == line2 && line1_char <= line2_char)) {
135 start_char = line1_char;
136 end_char = line2_char;
141 start_char = line2_char;
142 end_char = line1_char;
145 for (
const TextLine *line = start_line; line != end_line->
next; line = line->
next) {
146 const int start = (line == start_line) ? start_char : 0;
147 const int end = (line == end_line) ? end_char : line->len;
149 for (
int i = start;
i < end;
i++) {
150 if (!
ELEM(line->line[
i],
' ',
'\t',
'\n')) {
168 bool line_start =
true;
171 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
175 if (in_buf[in_offset] ==
'\t' && line_start) {
181 const int out_size = strlen(in_buf) + num_tabs * (tab_size - 1) + 1;
185 int spaces_until_tab = 0;
189 for (
int in_offset = 0; in_buf[in_offset]; in_offset++) {
193 if (in_buf[in_offset] ==
'\t' && line_start) {
195 int num_spaces = tab_size - (spaces_until_tab % tab_size);
196 spaces_until_tab = 0;
199 memset(&out_buf[out_offset],
' ', num_spaces);
200 out_offset += num_spaces;
203 if (in_buf[in_offset] ==
' ') {
206 else if (in_buf[in_offset] ==
'\n') {
207 spaces_until_tab = 0;
210 out_buf[out_offset++] = in_buf[in_offset];
214 out_buf[out_offset] =
'\0';
215 *r_out_buf_len = out_offset;
234 if (buf ==
nullptr) {
367 st->
runtime->scroll_ofs_px[0] = 0;
368 st->
runtime->scroll_ofs_px[1] = 0;
380 ot->name =
"New Text";
381 ot->idname =
"TEXT_OT_new";
382 ot->description =
"Create a new text data-block";
445 st->
runtime->scroll_ofs_px[0] = 0;
446 st->
runtime->scroll_ofs_px[1] = 0;
477 ot->name =
"Open Text";
478 ot->idname =
"TEXT_OT_open";
479 ot->description =
"Open a new text data-block";
499 ot->srna,
"internal",
false,
"Make Internal",
"Make text file internal after loading");
515 const int orig_top = st->
top;
517 const int orig_curc = text->
curc;
557 IFACE_(
"Reload active text file?"),
568 ot->idname =
"TEXT_OT_reload";
569 ot->description =
"Reload active text data-block from its file";
619 IFACE_(
"Delete active text file?"),
630 ot->idname =
"TEXT_OT_unlink";
631 ot->description =
"Unlink active text data-block";
665 ot->name =
"Make Internal";
666 ot->idname =
"TEXT_OT_make_internal";
667 ot->description =
"Make active text file internal";
700 reports,
RPT_ERROR,
"Cannot save text file, path \"%s\" is not writable", filepath);
708 "Unable to save '%s': %s",
710 errno ? strerror(errno) :
RPT_(
"unknown error writing file"));
715 fputs(tmp->line, fp);
724 text->
mtime = st.st_mtime;
733 "Unable to stat '%s': %s",
735 errno ? strerror(errno) :
RPT_(
"unknown error statting file"));
770 ot->idname =
"TEXT_OT_save";
771 ot->description =
"Save active text data-block";
820 const char *filepath;
825 filepath = text->
id.
name + 2;
840 ot->name =
"Save As";
841 ot->idname =
"TEXT_OT_save_as";
842 ot->description =
"Save active text file with options";
869 const bool is_live = (
reports ==
nullptr);
872 void *curl_prev = text->
curl;
873 int curc_prev = text->
curc;
874 int selc_prev = text->
selc;
888 if (text->
curl != curl_prev || curc_prev != text->
curc || selc_prev != text->
selc) {
920 ot->name =
"Run Script";
921 ot->idname =
"TEXT_OT_run_script";
922 ot->description =
"Run active script";
986 ot->idname =
"TEXT_OT_paste";
987 ot->description =
"Paste text from clipboard";
1002 "Paste text selected elsewhere rather than copied (X11/Wayland only)");
1033 ot->name =
"Duplicate Line";
1034 ot->idname =
"TEXT_OT_duplicate_line";
1035 ot->description =
"Duplicate the current line";
1080 ot->idname =
"TEXT_OT_copy";
1081 ot->description =
"Copy selected text to clipboard";
1121 ot->idname =
"TEXT_OT_cut";
1122 ot->description =
"Cut selected text to clipboard";
1142 bool text_before_cursor = text->
curc != 0 && !
ELEM(line->
line[text->
curc - 1],
' ',
'\t');
1143 if (text_before_cursor && (
txt_has_sel(text) ==
false)) {
1155 ot->name =
"Indent or Autocomplete";
1156 ot->idname =
"TEXT_OT_indent_or_autocomplete";
1157 ot->description =
"Indent selected text or autocomplete";
1201 ot->name =
"Indent";
1202 ot->idname =
"TEXT_OT_indent";
1203 ot->description =
"Indent selected text";
1242 ot->name =
"Unindent";
1243 ot->idname =
"TEXT_OT_unindent";
1244 ot->description =
"Unindent selected text";
1274 for (a = 0; a < curts; a++) {
1299 ot->name =
"Line Break";
1300 ot->idname =
"TEXT_OT_line_break";
1301 ot->description =
"Insert line break at cursor position";
1357 {0,
"TOGGLE", 0,
"Toggle Comments",
nullptr},
1358 {1,
"COMMENT", 0,
"Comment",
nullptr},
1359 {-1,
"UNCOMMENT", 0,
"Un-Comment",
nullptr},
1360 {0,
nullptr, 0,
nullptr,
nullptr},
1364 ot->name =
"Toggle Comments";
1365 ot->idname =
"TEXT_OT_comment_toggle";
1376 prop =
RNA_def_enum(
ot->srna,
"type", comment_items, 0,
"Type",
"Add or remove comments");
1388 {
TO_SPACES,
"SPACES", 0,
"To Spaces",
nullptr},
1389 {
TO_TABS,
"TABS", 0,
"To Tabs",
nullptr},
1390 {0,
nullptr, 0,
nullptr,
nullptr},
1398 size_t a, j, max_len = 0;
1401 const int curc_column = text->
curl ?
1405 const int selc_column = text->
sell ?
1427 tmp->line = new_line;
1428 tmp->len = strlen(new_line);
1429 tmp->format =
nullptr;
1430 max_len = std::max<size_t>(tmp->len, max_len);
1437 const char *text_check_line = tmp->line;
1438 const int text_check_line_len = tmp->len;
1439 char *tmp_line_cur = tmp_line;
1444 for (a = 0; a < text_check_line_len;) {
1446 if (!(a % tab_len) && (text_check_line[a] ==
' ')) {
1449 (j < tab_len) && (a + j < text_check_line_len) && (text_check_line[a + j] ==
' ');
1457 if ((tmp_line_cur == tmp_line) && a != 0) {
1459 memcpy(tmp_line_cur, text_check_line, a);
1462 *tmp_line_cur =
'\t';
1467 if (tmp_line_cur != tmp_line) {
1468 memcpy(tmp_line_cur, &text_check_line[a], j);
1476 if (tmp_line_cur != tmp_line) {
1477 memcpy(tmp_line_cur, &text_check_line[a],
len);
1478 tmp_line_cur +=
len;
1484 if (tmp_line_cur != tmp_line) {
1485 *tmp_line_cur =
'\0';
1488 BLI_assert(tmp_line_cur - tmp_line <= max_len);
1501 tmp->len = strlen(tmp_line);
1503 tmp->format =
nullptr;
1510 if (curc_column != -1) {
1514 if (selc_column != -1) {
1530 ot->name =
"Convert Whitespace";
1531 ot->idname =
"TEXT_OT_convert_whitespace";
1532 ot->description =
"Convert whitespaces by type";
1547 "Type of whitespace to convert to");
1573 ot->name =
"Select All";
1574 ot->idname =
"TEXT_OT_select_all";
1575 ot->description =
"Select all text";
1605 ot->name =
"Select Line";
1606 ot->idname =
"TEXT_OT_select_line";
1607 ot->description =
"Select text by line";
1638 ot->name =
"Select Word";
1639 ot->idname =
"TEXT_OT_select_word";
1640 ot->description =
"Select word under cursor";
1678 {0,
nullptr, 0,
nullptr,
nullptr},
1682 ot->name =
"Move Lines";
1683 ot->idname =
"TEXT_OT_move_lines";
1684 ot->description =
"Move the currently selected line(s) up/down";
1694 RNA_def_enum(
ot->srna,
"direction", direction_items, 1,
"Direction",
"");
1704 {
LINE_BEGIN,
"LINE_BEGIN", 0,
"Line Begin",
""},
1705 {
LINE_END,
"LINE_END", 0,
"Line End",
""},
1706 {
FILE_TOP,
"FILE_TOP", 0,
"File Top",
""},
1707 {
FILE_BOTTOM,
"FILE_BOTTOM", 0,
"File Bottom",
""},
1708 {
PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
1709 {
NEXT_CHAR,
"NEXT_CHARACTER", 0,
"Next Character",
""},
1710 {
PREV_WORD,
"PREVIOUS_WORD", 0,
"Previous Word",
""},
1711 {
NEXT_WORD,
"NEXT_WORD", 0,
"Next Word",
""},
1712 {
PREV_LINE,
"PREVIOUS_LINE", 0,
"Previous Line",
""},
1713 {
NEXT_LINE,
"NEXT_LINE", 0,
"Next Line",
""},
1714 {
PREV_PAGE,
"PREVIOUS_PAGE", 0,
"Previous Page",
""},
1715 {
NEXT_PAGE,
"NEXT_PAGE", 0,
"Next Page",
""},
1716 {0,
nullptr, 0,
nullptr,
nullptr},
1725 int i, j, start, end,
max, curs, endj, selc;
1726 bool chop, loop, found;
1731 selc = start = endj = curs = found =
false;
1740 ch = linein->
line[j];
1750 if (rell == 0 &&
i - start <= relc && i + columns - start > relc) {
1756 else if (
i - end <= relc && i + columns - end > relc) {
1759 if (
i + columns - start >
max) {
1760 end = std::min(end,
i);
1765 if (selc > endj && !chop) {
1781 if (rell == 0 &&
i + columns - start > relc) {
1787 else if (ch ==
'\0') {
1794 else if (
ELEM(ch,
' ',
'-')) {
1800 if (rell == 0 &&
i + columns - start > relc) {
1824 int offl, offc, visible_lines;
1834 if (*rell - visible_lines + offl >= 0) {
1835 if (!(*linep)->next) {
1836 if (offl < visible_lines - 1) {
1837 *rell = visible_lines - 1;
1841 *charp = (*linep)->len;
1845 *rell -= visible_lines - offl;
1846 *
linep = (*linep)->next;
1854 if (*rell + offl <= 0) {
1855 if (!(*linep)->prev) {
1866 *
linep = (*linep)->prev;
1879 if (*rell + visible_lines >= 0) {
1880 *rell += visible_lines;
1884 if (!(*linep)->prev) {
1889 *rell += visible_lines;
1890 *
linep = (*linep)->prev;
1893 if (*rell - visible_lines < 0) {
1897 if (!(*linep)->next) {
1898 *rell = visible_lines - 1;
1902 *rell -= visible_lines;
1903 *
linep = (*linep)->next;
1915 int oldc,
i, j,
max, start, end, endj;
1923 charp = &text->
selc;
1927 charp = &text->
curc;
1944 ch = (*linep)->line[j];
1954 if (
i + columns - start >
max) {
1955 end = std::min(end,
i);
1962 (*linep)->line, (*linep)->len, start,
TXT_TABSIZE);
1976 else if (
ELEM(ch,
' ',
'-',
'\0')) {
1979 (*linep)->line, (*linep)->len, start,
TXT_TABSIZE);
2002 int oldc,
i, j,
max, start, end, endj;
2010 charp = &text->
selc;
2014 charp = &text->
curc;
2031 ch = (*linep)->line[j];
2041 if (
i + columns - start >
max) {
2042 end = std::min(end,
i);
2050 *charp = (*linep)->len;
2063 else if (ch ==
'\0') {
2064 *charp = (*linep)->len;
2068 else if (
ELEM(ch,
' ',
'-')) {
2087 int offl, offc,
col;
2093 charp = &text->
selc;
2097 charp = &text->
curc;
2106 if ((*linep)->prev) {
2109 *
linep = (*linep)->prev;
2128 int offl, offc,
col, visible_lines;
2134 charp = &text->
selc;
2138 charp = &text->
curc;
2144 if (offl < visible_lines - 1) {
2148 if ((*linep)->next) {
2149 *
linep = (*linep)->next;
2153 *charp = (*linep)->len;
2177 charp = &text->
selc;
2181 charp = &text->
curc;
2184 if (st && region && st->
wordwrap) {
2193 while (lines > 0 && (*linep)->next) {
2194 *
linep = (*linep)->next;
2197 while (lines < 0 && (*linep)->prev) {
2198 *
linep = (*linep)->prev;
2203 *charp = std::min(*charp, (*linep)->len);
2226 if (st && st->
wordwrap && region) {
2238 if (st && st->
wordwrap && region) {
2289 if (st && st->
wordwrap && region) {
2298 if (st && st->
wordwrap && region) {
2345 ot->name =
"Move Cursor";
2346 ot->idname =
"TEXT_OT_move";
2347 ot->description =
"Move cursor to position type";
2373 ot->name =
"Move Select";
2374 ot->idname =
"TEXT_OT_move_select";
2375 ot->description =
"Move the cursor while selecting";
2387 "Where to move cursor to, to make a selection");
2407 else if (line > nlines) {
2429 ot->idname =
"TEXT_OT_jump";
2430 ot->description =
"Jump cursor to line";
2439 ot->srna,
"line", 1, 1, INT_MAX,
"Line",
"Line number to jump to", 1, 10000);
2451 {
DEL_PREV_CHAR,
"PREVIOUS_CHARACTER", 0,
"Previous Character",
""},
2454 {0,
nullptr, 0,
nullptr,
nullptr},
2499 if (*curr !=
'\0') {
2501 if ((curr != prev) &&
2550 ot->name =
"Delete";
2551 ot->idname =
"TEXT_OT_delete";
2552 ot->description =
"Delete text by cursor position";
2568 "Which part of the text to delete");
2592 ot->name =
"Toggle Overwrite";
2593 ot->idname =
"TEXT_OT_overwrite_toggle";
2594 ot->description =
"Toggle overwrite while typing";
2615 last = last - (st->
runtime->viewlines / 2);
2616 if (last > 0 && st->
top > last) {
2698 const int mval[2] = {
event->xy[0],
event->xy[1]};
2723 for (
int i = 0;
i < 2;
i += 1) {
2732 int scroll_ofs_new[2] = {
2736 int scroll_ofs_px_new[2] = {
2741 for (
int i = 0;
i < 2;
i += 1) {
2743 while (scroll_ofs_px_new[
i] < 0) {
2745 scroll_ofs_new[
i] -= 1;
2749 if (scroll_ofs_new[
i] < 0) {
2750 scroll_ofs_new[
i] = 0;
2751 scroll_ofs_px_new[
i] = 0;
2755 scroll_ofs_px_new[
i] = 0;
2761 scroll_ofs_new[0] = 0;
2762 scroll_ofs_px_new[0] = 0;
2766 if (scroll_ofs_new[0] != st->
left || scroll_ofs_new[1] != st->
top ||
2769 scroll_ofs_px_new[1] != st->
runtime->scroll_ofs_px[1])
2772 st->
left = scroll_ofs_new[0];
2773 st->
top = scroll_ofs_new[1];
2774 st->
runtime->scroll_ofs_px[0] = scroll_ofs_px_new[0];
2775 st->
runtime->scroll_ofs_px[1] = scroll_ofs_px_new[1];
2794 st->
runtime->scroll_ofs_px[0] = 0;
2795 st->
runtime->scroll_ofs_px[1] = 0;
2808 switch (event->
type) {
2868 tsc->
mval_delta[0] = (
event->xy[0] -
event->prev_xy[0]) * st->
runtime->cwidth_px / 4;
2869 tsc->
mval_delta[1] = (
event->xy[1] -
event->prev_xy[1]) * st->
runtime->lheight_px / 4;
2885 ot->name =
"Scroll";
2888 ot->idname =
"TEXT_OT_scroll";
2903 ot->srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
2936 const int *mval =
event->mval;
2944 if (mval[0] > st->
runtime->scroll_region_handle.xmin &&
2945 mval[0] < st->
runtime->scroll_region_handle.xmax)
2947 if (mval[1] >= st->
runtime->scroll_region_handle.ymin &&
2948 mval[1] <= st->
runtime->scroll_region_handle.ymax)
2954 if (mval[1] < st->
runtime->scroll_region_handle.ymin) {
2995 ot->name =
"Scrollbar";
2998 ot->idname =
"TEXT_OT_scroll_bar";
3012 ot->srna,
"lines", 1, INT_MIN, INT_MAX,
"Lines",
"Number of lines to scroll", -100, 100);
3045 while (*(
str + j)) {
3048 if (
i +
col > index) {
3073 if (
i + lines > *
y) {
3095 int i = 0, start = 0, end =
max;
3096 int j, curs = 0, endj = 0;
3100 for (j = 0; !found && ((ch =
linep->line[j]) !=
'\0');
3124 if (
y == 0 &&
i - start <= x && i + columns - start >
x) {
3131 else if (
i - end <= x && i + columns - end >
x) {
3134 if (
i + columns - start >
max) {
3135 end = std::min(end,
i);
3140 if (charp > endj && !chop && ch !=
'\0') {
3152 if (j < linep->
len) {
3157 if (
y == 0 &&
i + columns - start >
x) {
3163 else if (
ELEM(ch,
' ',
'-',
'\0')) {
3168 if (
y == 0 &&
i + columns - start >
x) {
3230 charp = &text->
selc;
3234 charp = &text->
curc;
3241 if ((*linep)->next) {
3242 *
linep = (*linep)->next;
3248 if ((*linep)->prev) {
3249 *
linep = (*linep)->prev;
3259 *charp = (*linep)->len;
3269 if (ssel->
timer ==
nullptr) {
3285 ssel->
timer =
nullptr;
3294 if (event->
mval[1] < 0 || event->
mval[1] > region->
winy) {
3308 st, region, std::clamp(event->
mval[0], 0,
int(region->
winx)), event->
mval[1],
true);
3348 if (event->
mval[0] >= st->
runtime->scroll_region_handle.xmin) {
3370 switch (event->
type) {
3396 ot->name =
"Set Selection";
3397 ot->idname =
"TEXT_OT_selection_set";
3398 ot->description =
"Set text selection";
3432 if (event->
mval[0] >= st->
runtime->scroll_region_handle.xmin) {
3445 ot->name =
"Set Cursor";
3446 ot->idname =
"TEXT_OT_cursor_set";
3447 ot->description =
"Set cursor position";
3455 RNA_def_int(
ot->srna,
"x", 0, INT_MIN, INT_MAX,
"X",
"", INT_MIN, INT_MAX);
3456 RNA_def_int(
ot->srna,
"y", 0, INT_MIN, INT_MAX,
"Y",
"", INT_MIN, INT_MAX);
3472 const int *mval =
event->mval;
3474 static int jump_to = 0;
3475 static double last_jump = 0;
3483 if (!(mval[0] > 2 &&
3485 mval[1] > 2 && mval[1] < region->
winy - 2))
3491 if (!(event_ascii >=
'0' && event_ascii <=
'9')) {
3496 if (last_jump < time - 1) {
3501 jump_to += int(event_ascii -
'0');
3515 ot->name =
"Line Number";
3516 ot->idname =
"TEXT_OT_line_number";
3517 ot->description =
"The current line number";
3579 bool do_auto_close =
false;
3580 bool do_auto_close_select =
false;
3582 uint auto_close_char_input = 0;
3583 uint auto_close_char_match = 0;
3590 } auto_close_select = {
nullptr}, auto_close_select_backup = {
nullptr};
3611 if (isascii(auto_close_char_input)) {
3613 if (auto_close_char_match != 0) {
3614 do_auto_close =
true;
3619 do_auto_close_select =
true;
3621 auto_close_select_backup.curl = st->
text->
curl;
3622 auto_close_select_backup.curc = st->
text->
curc;
3623 auto_close_select_backup.sell = st->
text->
sell;
3624 auto_close_select_backup.selc = st->
text->
selc;
3629 auto_close_select.curl = st->
text->
curl;
3630 auto_close_select.curc = st->
text->
curc;
3631 auto_close_select.sell = st->
text->
sell;
3632 auto_close_select.selc = st->
text->
selc;
3643 if (do_auto_close) {
3647 if (do_auto_close_select) {
3649 if (auto_close_select.curl == auto_close_select.sell) {
3650 auto_close_select.selc += auto_close_char_len;
3653 st->
text->
curl = auto_close_select.sell;
3654 st->
text->
curc = auto_close_select.selc;
3662 if (do_auto_close_select) {
3664 if (auto_close_select.curl != auto_close_select.sell) {
3665 TextLine *line = auto_close_select.curl;
3669 }
while (line != auto_close_select.sell);
3671 st->
text->
curl = auto_close_select.curl;
3672 st->
text->
curc = auto_close_select.curc + auto_close_char_len;
3673 st->
text->
sell = auto_close_select.sell;
3674 st->
text->
selc = auto_close_select.selc;
3679 if (do_auto_close_select) {
3680 st->
text->
curl = auto_close_select_backup.curl;
3681 st->
text->
curc = auto_close_select_backup.curc;
3682 st->
text->
sell = auto_close_select_backup.sell;
3683 st->
text->
selc = auto_close_select_backup.selc;
3701 ot->name =
"Insert";
3702 ot->idname =
"TEXT_OT_insert";
3703 ot->description =
"Insert text at cursor position";
3715 ot->srna,
"text",
nullptr, 0,
"Text",
"Text to insert at the cursor position");
3810 ot->name =
"Find Next";
3811 ot->idname =
"TEXT_OT_find";
3812 ot->description =
"Find specified text";
3829 const int flags = st->
flags;
3837 const int orig_curc = text->
curc;
3879 ot->name =
"Replace";
3880 ot->idname =
"TEXT_OT_replace";
3881 ot->description =
"Replace text with the specified text";
3892 prop =
RNA_def_boolean(
ot->srna,
"all",
false,
"Replace All",
"Replace all occurrences");
3922 ot->name =
"Find & Set Selection";
3923 ot->idname =
"TEXT_OT_find_set_selected";
3924 ot->description =
"Find specified text and set as selected";
3953 ot->name =
"Replace & Set Selection";
3954 ot->idname =
"TEXT_OT_replace_set_selected";
3955 ot->description =
"Replace text with specified text and set as selected";
3973 const char *filepath,
3974 const int line_index,
3975 const int column_index)
3977 bool success =
false;
3983 const char *expr_imports[] = {
"bl_text_utils",
"bl_text_utils.external_editor",
"os",
nullptr};
3986 std::stringstream expr_stream;
3987 expr_stream <<
"bl_text_utils.external_editor.open_external_editor(os.fsdecode(b'";
3988 for (
const char *ch = filepath; *ch; ch++) {
3989 expr_stream <<
"\\x" << std::hex << int(*ch);
3991 expr_stream <<
"'), " << std::dec << line_index <<
", " << std::dec << column_index <<
")";
3992 expr = expr_stream.str();
3995 char *expr_result =
nullptr;
3998 if (expr_result[0] ==
'\0') {
4016 const char *filepath,
4017 const int line_index,
4018 const int column_index)
4021 Text *text =
nullptr;
4024 if (text_iter->filepath &&
BLI_path_cmp(text_iter->filepath, filepath) == 0) {
4030 if (text ==
nullptr) {
4034 if (text ==
nullptr) {
4039 txt_move_to(text, line_index, column_index,
false);
4060 if (text->filepath !=
nullptr) {
4062 const int line_index =
BLI_findindex(&text->lines, text->curl);
4077 if (filepath[0] ==
'\0') {
4083 printf(
"%s:%d:%d\n", filepath, line_index + 1, column_index);
4086 if (
U.text_editor[0] !=
'\0') {
4088 C, op->
reports, filepath, line_index, column_index);
4092 C, op->
reports, filepath, line_index, column_index);
4103 ot->name =
"Jump to File at Point";
4104 ot->idname =
"TEXT_OT_jump_to_file_at_point";
4105 ot->description =
"Jump to a file for the text editor";
4116 prop =
RNA_def_int(
ot->srna,
"line", 0, 0, INT_MAX,
"Line",
"Line to jump to", 1, 10000);
4119 prop =
RNA_def_int(
ot->srna,
"column", 0, 0, INT_MAX,
"Column",
"Column to jump to", 1, 10000);
4135 {0,
nullptr, 0,
nullptr,
nullptr},
4154 switch (resolution) {
4182 C,
IFACE_(
"File Modified Outside and Inside Blender"), ICON_NONE);
4186 IFACE_(
"Reload from disk (ignore local changes)"),
4192 IFACE_(
"Save to disk (ignore outside changes)"),
4198 IFACE_(
"Make text internal (separate copy)"),
4211 IFACE_(
"Make text internal (separate copy)"),
4225 IFACE_(
"Make text internal"),
4241 ot->name =
"Resolve Conflict";
4242 ot->idname =
"TEXT_OT_resolve_conflict";
4243 ot->description =
"When external text is out of sync, resolve the conflict";
4256 "How to solve conflict due to differences in internal and external text");
4278 ot->name =
"To 3D Object";
4279 ot->idname =
"TEXT_OT_to_3d_object";
4280 ot->description =
"Create 3D text object from active text data-block";
4291 ot->srna,
"split_lines",
false,
"Split Lines",
"Create one object per line in the text");
4306 if (text ==
nullptr) {
4331 for (
bNode *node : ntree->all_nodes()) {
4334 if (ngroup && !done_trees.
contains(ngroup)) {
4374 if (cam->custom_shader == text) {
4393 ot->name =
"Shader Update";
4395 "Update users of this shader, such as custom cameras and script nodes, with its new sockets "
4397 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
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
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
@ 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)
void uiItemEnumO_ptr(uiLayout *layout, wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::StringRefNull propname, int value)
@ WM_CAPABILITY_PRIMARY_CLIPBOARD
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)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
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)
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)
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::@116124127235364141050345323154173067160125271366 state
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)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
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)
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)