mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
feat(paste): add large paste placeholder and fix enter-submit on macOS
- Add large paste placeholder feature: when pasting text > 1000 chars, show a placeholder like '[Pasted Content 1500 chars]' instead of the full content. The full text is stored and expanded on submit. - Fix enter-submit on macOS: only apply recentPasteTime protection when pasteWorkaround is enabled (Windows or Node < 20). On macOS/Linux with modern Node, bracketed paste markers work reliably so the protection is unnecessary and caused the first Enter after paste to be ignored. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
2ed4ae773e
commit
c7b681ef5d
2 changed files with 58 additions and 6 deletions
|
|
@ -60,6 +60,7 @@ export type KeypressHandler = (key: Key) => void;
|
|||
interface KeypressContextValue {
|
||||
subscribe: (handler: KeypressHandler) => void;
|
||||
unsubscribe: (handler: KeypressHandler) => void;
|
||||
pasteWorkaround: boolean;
|
||||
}
|
||||
|
||||
const KeypressContext = createContext<KeypressContextValue | undefined>(
|
||||
|
|
@ -799,7 +800,9 @@ export function KeypressProvider({
|
|||
]);
|
||||
|
||||
return (
|
||||
<KeypressContext.Provider value={{ subscribe, unsubscribe }}>
|
||||
<KeypressContext.Provider
|
||||
value={{ subscribe, unsubscribe, pasteWorkaround }}
|
||||
>
|
||||
{children}
|
||||
</KeypressContext.Provider>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue