comparison src/fileio.c @ 13575:4df23d9bad47 v8.0.1660

patch 8.0.1660: the terminal API "drop" command doesn't support options commit https://github.com/vim/vim/commit/333b80acf3a44e462456e6d5730e47ffa449c83d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 4 22:57:29 2018 +0200 patch 8.0.1660: the terminal API "drop" command doesn't support options Problem: The terminal API "drop" command doesn't support options. Solution: Implement the options.
author Christian Brabandt <cb@256bit.org>
date Wed, 04 Apr 2018 23:00:07 +0200
parents 9f06f7aca74c
children e76499e85744
comparison
equal deleted inserted replaced
13574:73c69063091f 13575:4df23d9bad47
2777 * Returns OK or FAIL. 2777 * Returns OK or FAIL.
2778 */ 2778 */
2779 int 2779 int
2780 prep_exarg(exarg_T *eap, buf_T *buf) 2780 prep_exarg(exarg_T *eap, buf_T *buf)
2781 { 2781 {
2782 eap->cmd = alloc((unsigned)(STRLEN(buf->b_p_ff) 2782 eap->cmd = alloc(15
2783 #ifdef FEAT_MBYTE 2783 #ifdef FEAT_MBYTE
2784 + STRLEN(buf->b_p_fenc) 2784 + (unsigned)STRLEN(buf->b_p_fenc)
2785 #endif 2785 #endif
2786 + 15)); 2786 );
2787 if (eap->cmd == NULL) 2787 if (eap->cmd == NULL)
2788 return FAIL; 2788 return FAIL;
2789 2789
2790 #ifdef FEAT_MBYTE 2790 #ifdef FEAT_MBYTE
2791 sprintf((char *)eap->cmd, "e ++ff=%s ++enc=%s", buf->b_p_ff, buf->b_p_fenc); 2791 sprintf((char *)eap->cmd, "e ++enc=%s", buf->b_p_fenc);
2792 eap->force_enc = 14 + (int)STRLEN(buf->b_p_ff); 2792 eap->force_enc = 8;
2793 eap->bad_char = buf->b_bad_char; 2793 eap->bad_char = buf->b_bad_char;
2794 #else 2794 #else
2795 sprintf((char *)eap->cmd, "e ++ff=%s", buf->b_p_ff); 2795 sprintf((char *)eap->cmd, "e");
2796 #endif 2796 #endif
2797 eap->force_ff = 7; 2797 eap->force_ff = *buf->b_p_ff;
2798 2798
2799 eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN; 2799 eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN;
2800 eap->read_edit = FALSE; 2800 eap->read_edit = FALSE;
2801 eap->forceit = FALSE; 2801 eap->forceit = FALSE;
2802 return OK; 2802 return OK;