Mercurial > vim
diff src/edit.c @ 22095:2cc0de1e05a6 v8.2.1597
patch 8.2.1597: the channel source file is too big
Commit: https://github.com/vim/vim/commit/8b5866ded6036f7adece26b6d16962bbd2d47842
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 5 15:48:51 2020 +0200
patch 8.2.1597: the channel source file is too big
Problem: The channel source file is too big.
Solution: Move job related code to a new source file.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Sep 2020 16:00:04 +0200 |
parents | 9bb1c984c4da |
children | 6941d3205be9 |
line wrap: on
line diff
--- a/src/edit.c +++ b/src/edit.c @@ -24,9 +24,6 @@ static int compl_busy = FALSE; static void ins_ctrl_v(void); -#ifdef FEAT_JOB_CHANNEL -static void init_prompt(int cmdchar_todo); -#endif static void insert_special(int, int, int); static void redo_literal(int c); static void start_arrow_common(pos_T *end_insert_pos, int change); @@ -1683,84 +1680,21 @@ edit_putchar(int c, int highlight) } } -#if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* - * Return the effective prompt for the specified buffer. + * Set the insert start position for when using a prompt buffer. */ - char_u * -buf_prompt_text(buf_T* buf) -{ - if (buf->b_prompt_text == NULL) - return (char_u *)"% "; - return buf->b_prompt_text; -} - -/* - * Return the effective prompt for the current buffer. - */ - char_u * -prompt_text(void) -{ - return buf_prompt_text(curbuf); -} - - -/* - * Prepare for prompt mode: Make sure the last line has the prompt text. - * Move the cursor to this line. - */ - static void -init_prompt(int cmdchar_todo) + void +set_insstart(linenr_T lnum, int col) { - char_u *prompt = prompt_text(); - char_u *text; - - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - text = ml_get_curline(); - if (STRNCMP(text, prompt, STRLEN(prompt)) != 0) - { - // prompt is missing, insert it or append a line with it - if (*text == NUL) - ml_replace(curbuf->b_ml.ml_line_count, prompt, TRUE); - else - ml_append(curbuf->b_ml.ml_line_count, prompt, 0, FALSE); - curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; - coladvance((colnr_T)MAXCOL); - changed_bytes(curbuf->b_ml.ml_line_count, 0); - } - - // Insert always starts after the prompt, allow editing text after it. - if (Insstart_orig.lnum != curwin->w_cursor.lnum - || Insstart_orig.col != (int)STRLEN(prompt)) - { - Insstart.lnum = curwin->w_cursor.lnum; - Insstart.col = (int)STRLEN(prompt); - Insstart_orig = Insstart; - Insstart_textlen = Insstart.col; - Insstart_blank_vcol = MAXCOL; - arrow_used = FALSE; - } - - if (cmdchar_todo == 'A') - coladvance((colnr_T)MAXCOL); - if (cmdchar_todo == 'I' || curwin->w_cursor.col <= (int)STRLEN(prompt)) - curwin->w_cursor.col = (int)STRLEN(prompt); - // Make sure the cursor is in a valid position. - check_cursor(); + Insstart.lnum = lnum; + Insstart.col = col; + Insstart_orig = Insstart; + Insstart_textlen = Insstart.col; + Insstart_blank_vcol = MAXCOL; + arrow_used = FALSE; } /* - * Return TRUE if the cursor is in the editable position of the prompt line. - */ - int -prompt_curpos_editable() -{ - return curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count - && curwin->w_cursor.col >= (int)STRLEN(prompt_text()); -} -#endif - -/* * Undo the previous edit_putchar(). */ void