mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Make issue suggestion work for all editors (#33340)
And do not handle special keys when the text-expander popup exists
This commit is contained in:
		| @@ -1,14 +1,19 @@ | ||||
| import {matchEmoji, matchMention, matchIssue} from '../../utils/match.ts'; | ||||
| import {emojiString} from '../emoji.ts'; | ||||
| import {svg} from '../../svg.ts'; | ||||
| import {parseIssueHref, parseIssueNewHref} from '../../utils.ts'; | ||||
| import {parseIssueHref, parseRepoOwnerPathInfo} from '../../utils.ts'; | ||||
| import {createElementFromAttrs, createElementFromHTML} from '../../utils/dom.ts'; | ||||
| import {getIssueColor, getIssueIcon} from '../issue.ts'; | ||||
| import {debounce} from 'perfect-debounce'; | ||||
|  | ||||
| const debouncedSuggestIssues = debounce((key: string, text: string) => new Promise<{matched:boolean; fragment?: HTMLElement}>(async (resolve) => { | ||||
|   let issuePathInfo = parseIssueHref(window.location.href); | ||||
|   if (!issuePathInfo.ownerName) issuePathInfo = parseIssueNewHref(window.location.href); | ||||
|   const issuePathInfo = parseIssueHref(window.location.href); | ||||
|   if (!issuePathInfo.ownerName) { | ||||
|     const repoOwnerPathInfo = parseRepoOwnerPathInfo(window.location.pathname); | ||||
|     issuePathInfo.ownerName = repoOwnerPathInfo.ownerName; | ||||
|     issuePathInfo.repoName = repoOwnerPathInfo.repoName; | ||||
|     // then no issuePathInfo.indexString here, it is only used to exclude the current issue when "matchIssue" | ||||
|   } | ||||
|   if (!issuePathInfo.ownerName) return resolve({matched: false}); | ||||
|  | ||||
|   const matches = await matchIssue(issuePathInfo.ownerName, issuePathInfo.repoName, issuePathInfo.indexString, text); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 wxiaoguang
					wxiaoguang