view runtime/macros/less.sh @ 34264:cce6b834635c v9.1.0071

patch 9.1.0071: Need a diff() Vim script function Commit: https://github.com/vim/vim/commit/fa37835b8c0ed0f83952978fca4c332335ca7c46 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Feb 1 22:05:27 2024 +0100 patch 9.1.0071: Need a diff() Vim script function Problem: Need a diff() Vim script function Solution: Add the diff() Vim script function using the xdiff internal diff library, add support for "unified" and "indices" mode. (Yegappan Lakshmanan) fixes: #4241 closes: #12321 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Feb 2024 22:30:03 +0100
parents 1b584a6f446c
children
line wrap: on
line source

#!/bin/sh
# Shell script to start Vim with less.vim.
# Read stdin if no arguments were given and stdin was redirected.

if test -t 1; then
  if test $# = 0; then
    if test -t 0; then
      echo "Missing filename" 1>&2
      exit
    fi
    vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
  else
    vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
  fi
else
  # Output is not a terminal, cat arguments or stdin
  if test $# = 0; then
    if test -t 0; then
      echo "Missing filename" 1>&2
      exit
    fi
    cat
  else
    cat "$@"
  fi
fi