mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 22:27:41 +00:00
Merge branch 'master' into mouse
This commit is contained in:
commit
7747daa9ec
2
fzf
2
fzf
@ -430,7 +430,7 @@ class FZF
|
|||||||
if RUBY_VERSION.split('.').map { |e| e.rjust(3, '0') }.join > '001009'
|
if RUBY_VERSION.split('.').map { |e| e.rjust(3, '0') }.join > '001009'
|
||||||
@@wrx = Regexp.new '\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}'
|
@@wrx = Regexp.new '\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}'
|
||||||
def width str
|
def width str
|
||||||
str.gsub(@@wrx, ' ').length
|
str.gsub(@@wrx, ' ').length rescue str.length
|
||||||
end
|
end
|
||||||
|
|
||||||
def trim str, len, left
|
def trim str, len, left
|
||||||
|
17
install
17
install
@ -10,11 +10,20 @@ if [ $? -ne 0 ]; then
|
|||||||
echo "ruby executable not found!"
|
echo "ruby executable not found!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "OK"
|
|
||||||
|
# System ruby is preferred
|
||||||
|
curses_check="begin; require 'curses'; rescue Exception; exit 1; end"
|
||||||
|
system_ruby=/usr/bin/ruby
|
||||||
|
if [ -x $system_ruby -a $system_ruby != "$ruby" ]; then
|
||||||
|
$system_ruby --disable-gems -e "$curses_check" 2> /dev/null
|
||||||
|
[ $? -eq 0 ] && ruby=$system_ruby
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "OK ($ruby)"
|
||||||
|
|
||||||
# Curses-support
|
# Curses-support
|
||||||
echo -n "Checking Curses support ... "
|
echo -n "Checking Curses support ... "
|
||||||
/usr/bin/env ruby -e "begin; require 'curses'; rescue Exception; exit 1; end"
|
"$ruby" -e "$curses_check"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "OK"
|
echo "OK"
|
||||||
else
|
else
|
||||||
@ -30,10 +39,10 @@ fi
|
|||||||
|
|
||||||
# Ruby version
|
# Ruby version
|
||||||
echo -n "Checking Ruby version ... "
|
echo -n "Checking Ruby version ... "
|
||||||
/usr/bin/env ruby -e 'exit RUBY_VERSION >= "1.9"'
|
"$ruby" -e 'exit RUBY_VERSION >= "1.9"'
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo ">= 1.9"
|
echo ">= 1.9"
|
||||||
/usr/bin/env ruby --disable-gems -e "begin; require 'curses'; rescue Exception; exit 1; end"
|
"$ruby" --disable-gems -e "$curses_check"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
fzf_cmd="$ruby --disable-gems $fzf_base/fzf"
|
fzf_cmd="$ruby --disable-gems $fzf_base/fzf"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user