To: vim-dev@vim.org Subject: Patch 6.0.158 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.158 Problem: When getting the warning for a file being changed outside of Vim and reloading the file, the 'readonly' option is reset, even when the permissions didn't change. (Marcel Svitalsky) Solution: Keep 'readonly' set when reloading a file and the permissions didn't change. Files: src/fileio.c *** ../vim60.157/src/fileio.c Wed Jan 2 17:10:11 2002 --- src/fileio.c Wed Jan 30 20:01:42 2002 *************** *** 5159,5164 **** --- 5167,5173 ---- linenr_T old_line_count = buf->b_ml.ml_line_count; exarg_T ea; pos_T old_cursor; + int old_ro = curbuf->b_p_ro; #ifdef FEAT_AUTOCMD aco_save_T aco; *************** *** 5205,5210 **** --- 5214,5224 ---- #ifdef FEAT_AUTOCMD keep_filetype = FALSE; #endif + /* If the mode didn't change and 'readonly' was set, keep the old + * value; the user probably used the ":view" command. But don't + * reset it, might have had a read error. */ + if (orig_mode == curbuf->b_orig_mode) + curbuf->b_p_ro |= old_ro; } #ifdef FEAT_AUTOCMD *** ../vim60.157/src/version.c Wed Jan 30 16:52:45 2002 --- src/version.c Wed Jan 30 20:08:31 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 158, /**/ -- hundred-and-one symptoms of being an internet addict: 102. When filling out your driver's license application, you give your IP address. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///