Commits

Evgeny Podjachev  committed 9da2b8b

Version 1.3.0:

Added parameter g:YATE_clear_search_string to control
clearing of search string on next YATE buffer invocation.
Pressing <Enter> in search string if length of search
string is more or equal g:YATE_min_symbols_to_search
lead to open first tag in search results.

  • Participants
  • Parent commits 14d354e

Comments (0)

Files changed (1)

File plugin/yate.vim

 "
 " ChangeLog:	1.3.0:	Added parameter g:YATE_clear_search_string to control
 "						clearing of search string on next YATE buffer invocation.
+"						Pressing <Enter> in search string if length of search
+"						string is more or equal g:YATE_min_symbols_to_search
+"						lead to open first tag in search results.
 "
 "				1.2.5:	Force disable line numbering in YATE buffer.
 "
 fun <SID>GotoTag(open_command)
 	let str=getline('.')
 
-	if !exists("s:tags_list") || !len(s:tags_list) || match(str,"^.*|.*|.*|.*$")
+	if !exists("s:tags_list") || !len(s:tags_list)
+		call <SID>GenerateTagsListCB()
+		return
+	endif
+
+	if line('.') == 1 && len(str) >= g:YATE_min_symbols_to_search
+		let str=getline(2)
+	endif
+
+	if match(str,"^.*|.*|.*|.*$")
 		call <SID>GenerateTagsListCB()
 		return
 	endif
 		exe 'startinsert'
 
 		if g:YATE_clear_search_string
-			let s:user_line=''
+			let s:user_line = ''
+			let s:tags_list = []
 		endif
 
 		if !exists("s:first_time")