mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
This commit is contained in:
@@ -73,6 +73,7 @@ interface UseTextBufferProps {
|
||||
setRawMode?: (mode: boolean) => void; // For external editor
|
||||
onChange?: (text: string) => void; // Callback for when text changes
|
||||
isValidPath: (path: string) => boolean;
|
||||
shellModeActive?: boolean; // Whether the text buffer is in shell mode
|
||||
}
|
||||
|
||||
interface UndoHistoryEntry {
|
||||
@@ -960,6 +961,7 @@ export function useTextBuffer({
|
||||
setRawMode,
|
||||
onChange,
|
||||
isValidPath,
|
||||
shellModeActive = false,
|
||||
}: UseTextBufferProps): TextBuffer {
|
||||
const initialState = useMemo((): TextBufferState => {
|
||||
const lines = initialText.split('\n');
|
||||
@@ -1028,7 +1030,7 @@ export function useTextBuffer({
|
||||
}
|
||||
|
||||
const minLengthToInferAsDragDrop = 3;
|
||||
if (ch.length >= minLengthToInferAsDragDrop) {
|
||||
if (ch.length >= minLengthToInferAsDragDrop && !shellModeActive) {
|
||||
let potentialPath = ch;
|
||||
if (
|
||||
potentialPath.length > 2 &&
|
||||
@@ -1060,7 +1062,7 @@ export function useTextBuffer({
|
||||
dispatch({ type: 'insert', payload: currentText });
|
||||
}
|
||||
},
|
||||
[isValidPath],
|
||||
[isValidPath, shellModeActive],
|
||||
);
|
||||
|
||||
const newline = useCallback((): void => {
|
||||
|
||||
Reference in New Issue
Block a user