From f5ec6cba565e4a888a4de1a11cd01f317956df97 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Feb 2014 20:44:26 +0900 Subject: [PATCH 1/2] Update vital-over set_prompt & get_prompt --- .../vital/_easymotion/Over/Commandline/Base.vim | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/autoload/vital/_easymotion/Over/Commandline/Base.vim b/autoload/vital/_easymotion/Over/Commandline/Base.vim index a8851b3..e8c5ec5 100644 --- a/autoload/vital/_easymotion/Over/Commandline/Base.vim +++ b/autoload/vital/_easymotion/Over/Commandline/Base.vim @@ -25,9 +25,8 @@ endfunction function! s:make(...) - let prompt = get(a:, 1, ":") let result = deepcopy(s:base) - let result.prompt = prompt + let result.set_prompt(get(a:, 1, ":")) call result.connect(result, "_") return result endfunction @@ -39,9 +38,9 @@ endfunction let s:base = { -\ "prompt" : "", \ "line" : {}, \ "variables" : { +\ "prompt" : "", \ "char" : "", \ "input" : "", \ "tap_key" : "", @@ -130,6 +129,16 @@ function! s:base.input_key() endfunction +function! s:base.set_prompt(prompt) + let self.variables.prompt = a:prompt +endfunction + + +function! s:base.get_prompt() + return self.variables.prompt +endfunction + + function! s:base.insert(word, ...) if a:0 call self.line.set(a:1) @@ -355,7 +364,7 @@ endfunction function! s:_echo_cmdline(cmdline) call s:redraw() execute "echohl" a:cmdline.highlights.prompt - echon a:cmdline.prompt + echon a:cmdline.get_prompt() echohl NONE echon a:cmdline.backward() if empty(a:cmdline.line.pos_word()) From ee08b922a52df95997c4478cc45441363f56dec1 Mon Sep 17 00:00:00 2001 From: haya14busa Date: Mon, 17 Feb 2014 20:52:45 +0900 Subject: [PATCH 2/2] Use set_prompt() instead of s:cmdline.prompt --- autoload/EasyMotion/command_line.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/EasyMotion/command_line.vim b/autoload/EasyMotion/command_line.vim index eb29455..5b14710 100644 --- a/autoload/EasyMotion/command_line.vim +++ b/autoload/EasyMotion/command_line.vim @@ -2,7 +2,7 @@ " FILE: autoload/EasyMotion/command_line.vim " AUTHOR: haya14busa " Reference: https://github.com/osyo-manga/vim-over -" Last Change: 16 Feb 2014. +" Last Change: 17 Feb 2014. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -165,7 +165,8 @@ endfunction "}}} function! EasyMotion#command_line#GetInput(num_strokes, prev, direction) "{{{ let s:num_strokes = a:num_strokes - let s:search.prompt = s:getPromptMessage(a:num_strokes) + let s:prompt_base = s:getPromptMessage(a:num_strokes) + let s:search.set_prompt(s:prompt_base) " Screen: cursor position, first and last line let s:orig_pos = getpos('.')