1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

Drop @textarea_editor global

This commit is contained in:
Miciah Dashiel Butler Masters 2007-09-01 09:10:54 +00:00 committed by Miciah Dashiel Butler Masters
parent d4c262694b
commit cc67edbe1c
4 changed files with 4 additions and 11 deletions

View File

@ -446,7 +446,7 @@ invalid_utf8_start_byte:
destroy_terminal(term);
return 0;
case EVENT_TEXTAREA:
if (textarea_editor)
if (term->textarea_data)
textarea_edit(1, term, NULL, NULL, NULL);
break;

View File

@ -202,7 +202,7 @@ unblock_terminal(struct terminal *term)
(select_handler_T) destroy_terminal, term);
unblock_itrm();
redraw_terminal_cls(term);
if (textarea_editor) /* XXX */
if (term->textarea_data) /* XXX */
textarea_edit(1, term, NULL, NULL, NULL);
}

View File

@ -530,7 +530,6 @@ encode_textarea(struct submitted_value *sv)
* the content of it back to master somehow, add special flags for not deleting
* of 'delete' etc) and I'm not going to do that now. Inter-links communication
* *NEEDS* rewrite, as it looks just like quick messy hack now. --pasky */
int textarea_editor = 0;
static unsigned char *
save_textarea_file(unsigned char *value)
@ -628,20 +627,17 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
exec_on_terminal(td->term, ex, "", TERM_EXEC_FG);
mem_free(ex);
textarea_editor++;
return;
} else if (op == 1) {
int found = 0;
struct string file;
td = term_->textarea_data;
if (!td)
return;
assert(td);
if (!td->fs || !init_string(&file)
|| !add_file_to_string(&file, td->fn))
goto end;
goto free_and_return;
if (file.length > td->fc_maxlength) {
file.source[td->fc_maxlength] = '\0';
@ -672,8 +668,6 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
if (td->doc_view && td->link)
draw_form_entry(td->term, td->doc_view, td->link);
}
end:
textarea_editor--;
free_and_return:
mem_free(td->fn);
mem_free(td);

View File

@ -21,7 +21,6 @@ int area_cursor(struct form_control *fc, struct form_state *fs);
void draw_textarea(struct terminal *term, struct form_state *fs, struct document_view *doc_view, struct link *link);
unsigned char *encode_textarea(struct submitted_value *sv);
extern int textarea_editor;
void textarea_edit(int, struct terminal *, struct form_state *, struct document_view *, struct link *);
void menu_textarea_edit(struct terminal *term, void *xxx, void *ses_);