~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to src/diff.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-01-13 18:39:18 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090113183918-kgq1jzdwsbbex4pq
Tags: 2:7.2.079-1ubuntu1
* Resynchronise with Debian (diversions fix closes LP: #296324). Remaining
  changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        {
74
74
            tp->tp_diffbuf[i] = NULL;
75
75
            tp->tp_diff_invalid = TRUE;
 
76
            if (tp == curtab)
 
77
                diff_redraw(TRUE);
76
78
        }
77
79
    }
78
80
}
102
104
            {
103
105
                curtab->tp_diffbuf[i] = NULL;
104
106
                curtab->tp_diff_invalid = TRUE;
 
107
                diff_redraw(TRUE);
105
108
            }
106
109
        }
107
110
    }
131
134
        {
132
135
            curtab->tp_diffbuf[i] = buf;
133
136
            curtab->tp_diff_invalid = TRUE;
 
137
            diff_redraw(TRUE);
134
138
            return;
135
139
        }
136
140
 
661
665
    char_u      *tmp_diff;
662
666
    FILE        *fd;
663
667
    int         ok;
 
668
    int         io_error = FALSE;
664
669
 
665
670
    /* Delete all diffblocks. */
666
671
    diff_clear(curtab);
697
702
    {
698
703
        ok = FALSE;
699
704
        fd = mch_fopen((char *)tmp_orig, "w");
700
 
        if (fd != NULL)
 
705
        if (fd == NULL)
 
706
            io_error = TRUE;
 
707
        else
701
708
        {
702
 
            fwrite("line1\n", (size_t)6, (size_t)1, fd);
 
709
            if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1)
 
710
                io_error = TRUE;
703
711
            fclose(fd);
704
712
            fd = mch_fopen((char *)tmp_new, "w");
705
 
            if (fd != NULL)
 
713
            if (fd == NULL)
 
714
                io_error = TRUE;
 
715
            else
706
716
            {
707
 
                fwrite("line2\n", (size_t)6, (size_t)1, fd);
 
717
                if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1)
 
718
                    io_error = TRUE;
708
719
                fclose(fd);
709
720
                diff_file(tmp_orig, tmp_new, tmp_diff);
710
721
                fd = mch_fopen((char *)tmp_diff, "r");
711
 
                if (fd != NULL)
 
722
                if (fd == NULL)
 
723
                    io_error = TRUE;
 
724
                else
712
725
                {
713
726
                    char_u      linebuf[LBUFLEN];
714
727
 
761
774
    }
762
775
    if (!ok)
763
776
    {
 
777
        if (io_error)
 
778
            EMSG(_("E810: Cannot read or write temp files"));
764
779
        EMSG(_("E97: Cannot create diffs"));
765
780
        diff_a_works = MAYBE;
766
781
#if defined(MSWIN) || defined(MSDOS)
925
940
    {
926
941
# ifdef TEMPDIRNAMES
927
942
        if (vim_tempdir != NULL)
928
 
            mch_chdir((char *)vim_tempdir);
 
943
            ignored = mch_chdir((char *)vim_tempdir);
929
944
        else
930
945
# endif
931
 
            mch_chdir("/tmp");
 
946
            ignored = mch_chdir("/tmp");
932
947
        shorten_fnames(TRUE);
933
948
    }
934
949
#endif