Mercurial > vim
comparison src/ex_cmds.c @ 11144:e85aa0e46ca5 v8.0.0459
patch 8.0.0459: old fix for :move and folding no longer needed
commit https://github.com/vim/vim/commit/fe70c5198336dba7e8b0fa915e6c4350e7f80f6f
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 15 20:45:53 2017 +0100
patch 8.0.0459: old fix for :move and folding no longer needed
Problem: Old fix for :move messing up folding no longer needed, now that we
have a proper solution.
Solution: Revert patch 7.4.700. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 15 Mar 2017 21:00:04 +0100 |
parents | 6b26e044b6f5 |
children | 501f46f7644c |
comparison
equal
deleted
inserted
replaced
11143:ed0f1fee66f1 | 11144:e85aa0e46ca5 |
---|---|
797 linenr_T l; | 797 linenr_T l; |
798 linenr_T extra; /* Num lines added before line1 */ | 798 linenr_T extra; /* Num lines added before line1 */ |
799 linenr_T num_lines; /* Num lines moved */ | 799 linenr_T num_lines; /* Num lines moved */ |
800 linenr_T last_line; /* Last line in file after adding new text */ | 800 linenr_T last_line; /* Last line in file after adding new text */ |
801 #ifdef FEAT_FOLDING | 801 #ifdef FEAT_FOLDING |
802 int isFolded; | |
803 win_T *win; | 802 win_T *win; |
804 tabpage_T *tp; | 803 tabpage_T *tp; |
805 | |
806 /* Moving lines seems to corrupt the folds, delete folding info now | |
807 * and recreate it when finished. Don't do this for manual folding, it | |
808 * would delete all folds. */ | |
809 isFolded = hasAnyFolding(curwin) && !foldmethodIsManual(curwin); | |
810 if (isFolded) | |
811 deleteFoldRecurse(&curwin->w_folds); | |
812 #endif | 804 #endif |
813 | 805 |
814 if (dest >= line1 && dest < line2) | 806 if (dest >= line1 && dest < line2) |
815 { | 807 { |
816 EMSG(_("E134: Move lines into themselves")); | 808 EMSG(_("E134: Move lines into themselves")); |
915 dest = last_line + 1; | 907 dest = last_line + 1; |
916 changed_lines(line1, 0, dest, 0L); | 908 changed_lines(line1, 0, dest, 0L); |
917 } | 909 } |
918 else | 910 else |
919 changed_lines(dest + 1, 0, line1 + num_lines, 0L); | 911 changed_lines(dest + 1, 0, line1 + num_lines, 0L); |
920 | |
921 #ifdef FEAT_FOLDING | |
922 /* recreate folds */ | |
923 if (isFolded) | |
924 foldUpdateAll(curwin); | |
925 #endif | |
926 | 912 |
927 return OK; | 913 return OK; |
928 } | 914 } |
929 | 915 |
930 /* | 916 /* |