| To: vim-dev@vim.org |
| Subject: patch 7.1.066 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.1.066 |
| Problem: When 'bomb' is set or reset the file should be considered |
| modified. (Tony Mechelynck) |
| Solution: Handle like 'endofline'. (Martin Toft) |
| Files: src/buffer.c, src/fileio.c, src/option.c, src/structs.h |
| |
| |
| |
| |
| |
| *** 502,507 **** |
| --- 502,508 ---- |
| buf->b_start_eol = TRUE; |
| #ifdef FEAT_MBYTE |
| buf->b_p_bomb = FALSE; |
| + buf->b_start_bomb = FALSE; |
| #endif |
| buf->b_ml.ml_mfp = NULL; |
| buf->b_ml.ml_flags = ML_EMPTY; /* empty buffer */ |
| |
| |
| |
| *** 654,659 **** |
| --- 654,660 ---- |
| curbuf->b_start_eol = TRUE; |
| #ifdef FEAT_MBYTE |
| curbuf->b_p_bomb = FALSE; |
| + curbuf->b_start_bomb = FALSE; |
| #endif |
| } |
| |
| |
| *** 912,918 **** |
| --- 913,922 ---- |
| file_rewind = FALSE; |
| #ifdef FEAT_MBYTE |
| if (set_options) |
| + { |
| curbuf->b_p_bomb = FALSE; |
| + curbuf->b_start_bomb = FALSE; |
| + } |
| conv_error = 0; |
| #endif |
| } |
| |
| *** 1361,1367 **** |
| --- 1365,1374 ---- |
| size -= blen; |
| mch_memmove(ptr, ptr + blen, (size_t)size); |
| if (set_options) |
| + { |
| curbuf->b_p_bomb = TRUE; |
| + curbuf->b_start_bomb = TRUE; |
| + } |
| } |
| |
| if (fio_flags == FIO_UCSBOM) |
| |
| |
| |
| *** 7118,7123 **** |
| --- 7118,7128 ---- |
| /* when 'endofline' is changed, redraw the window title */ |
| else if ((int *)varp == &curbuf->b_p_eol) |
| need_maketitle = TRUE; |
| + #ifdef FEAT_MBYTE |
| + /* when 'bomb' is changed, redraw the window title */ |
| + else if ((int *)varp == &curbuf->b_p_bomb) |
| + need_maketitle = TRUE; |
| + #endif |
| #endif |
| |
| /* when 'bin' is set also set some other options */ |
| |
| *** 10604,10609 **** |
| --- 10609,10616 ---- |
| buf->b_start_ffc = *buf->b_p_ff; |
| buf->b_start_eol = buf->b_p_eol; |
| #ifdef FEAT_MBYTE |
| + buf->b_start_bomb = buf->b_p_bomb; |
| + |
| /* Only use free/alloc when necessary, they take time. */ |
| if (buf->b_start_fenc == NULL |
| || STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0) |
| |
| *** 10617,10623 **** |
| /* |
| * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value |
| * from when editing started (save_file_ff() called). |
| ! * Also when 'endofline' was changed and 'binary' is set. |
| * Don't consider a new, empty buffer to be changed. |
| */ |
| int |
| --- 10624,10631 ---- |
| /* |
| * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value |
| * from when editing started (save_file_ff() called). |
| ! * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was |
| ! * changed and 'binary' is not set. |
| * Don't consider a new, empty buffer to be changed. |
| */ |
| int |
| |
| *** 10636,10641 **** |
| --- 10644,10651 ---- |
| if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol) |
| return TRUE; |
| #ifdef FEAT_MBYTE |
| + if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb) |
| + return TRUE; |
| if (buf->b_start_fenc == NULL) |
| return (*buf->b_p_fenc != NUL); |
| return (STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0); |
| |
| |
| |
| *** 1453,1458 **** |
| --- 1453,1459 ---- |
| #ifdef FEAT_MBYTE |
| char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */ |
| int b_bad_char; /* "++bad=" argument when edit started or 0 */ |
| + int b_start_bomb; /* 'bomb' when it was read */ |
| #endif |
| |
| #ifdef FEAT_EVAL |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 66, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 127. You bring your laptop and cellular phone to church. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |