|
|
@ -155,12 +155,27 @@ class FZF
|
|
|
|
(arr[2] || 0)].pack('U*')
|
|
|
|
(arr[2] || 0)].pack('U*')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if String.method_defined?(:each_char)
|
|
|
|
|
|
|
|
def self.split str
|
|
|
|
|
|
|
|
str.each_char.to_a
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
def self.split str
|
|
|
|
|
|
|
|
str.split('')
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def self.nfc str, offsets = []
|
|
|
|
def self.nfc str, offsets = []
|
|
|
|
ret = ''
|
|
|
|
ret = ''
|
|
|
|
omap = []
|
|
|
|
omap = []
|
|
|
|
pend = []
|
|
|
|
pend = []
|
|
|
|
str.split(//).each_with_index do |c, idx|
|
|
|
|
split(str).each_with_index do |c, idx|
|
|
|
|
cp = c.ord
|
|
|
|
cp =
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
c.ord
|
|
|
|
|
|
|
|
rescue Exception
|
|
|
|
|
|
|
|
next
|
|
|
|
|
|
|
|
end
|
|
|
|
omap << ret.length
|
|
|
|
omap << ret.length
|
|
|
|
unless pend.empty?
|
|
|
|
unless pend.empty?
|
|
|
|
if cp >= JUNGSUNG && cp < JUNGSUNG + JUNGSUNGS
|
|
|
|
if cp >= JUNGSUNG && cp < JUNGSUNG + JUNGSUNGS
|
|
|
@ -221,9 +236,12 @@ class FZF
|
|
|
|
def cursor_y; C.lines - 1; end
|
|
|
|
def cursor_y; C.lines - 1; end
|
|
|
|
def cprint str, col
|
|
|
|
def cprint str, col
|
|
|
|
C.attron(col) do
|
|
|
|
C.attron(col) do
|
|
|
|
C.addstr str.gsub("\0", '')
|
|
|
|
addstr_safe str
|
|
|
|
end if str
|
|
|
|
end if str
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def addstr_safe str
|
|
|
|
|
|
|
|
C.addstr str.gsub("\0", '')
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def print_input
|
|
|
|
def print_input
|
|
|
|
C.setpos cursor_y, 0
|
|
|
|
C.setpos cursor_y, 0
|
|
|
@ -320,7 +338,7 @@ class FZF
|
|
|
|
cprint token, color(chosen ? :match! : :match, chosen)
|
|
|
|
cprint token, color(chosen ? :match! : :match, chosen)
|
|
|
|
C.attron color(:chosen, true) if chosen
|
|
|
|
C.attron color(:chosen, true) if chosen
|
|
|
|
else
|
|
|
|
else
|
|
|
|
C.addstr token
|
|
|
|
addstr_safe token
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
C.attroff color(:chosen, true) if chosen
|
|
|
|
C.attroff color(:chosen, true) if chosen
|
|
|
|