mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
prompt update
This commit is contained in:
parent
f75dee39b3
commit
20d89cd07c
2 changed files with 8 additions and 4 deletions
|
|
@ -34,8 +34,7 @@ export const VoidCommandBarMain = ({ uri, editor }: VoidCommandBarProps) => {
|
|||
|
||||
const stepIdx = (currIdx: number | null, len: number, step: -1 | 1) => {
|
||||
if (len === 0) return null
|
||||
if (len === 1 && step === -1) return null // don't step backwards if just 1 element
|
||||
return ((currIdx ?? 0) + step) % len
|
||||
return ((currIdx ?? 0) + step + len) % len // for some reason, small negatives are kept negative. just add len to offset
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -54,6 +53,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor
|
|||
// changes if the user clicks left/right or if the user goes on a uri with changes
|
||||
const [currUriIdx, setUriIdx] = useState<number | null>(null)
|
||||
const [currUriHasChanges, setCurrUriHasChanges] = useState(false)
|
||||
const anyUriHasChanges = sortedCommandBarURIs.length !== 0
|
||||
useEffect(() => {
|
||||
console.log('uri', uri?.fsPath, sortedCommandBarURIs)
|
||||
const i = sortedCommandBarURIs.findIndex(e => e.fsPath === uri?.fsPath)
|
||||
|
|
@ -91,6 +91,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor
|
|||
const diff = editCodeService.diffOfId[diffid]
|
||||
const range = { startLineNumber: diff.startLine, endLineNumber: diff.startLine, startColumn: 1, endColumn: 1 };
|
||||
editor.revealRange(range, ScrollType.Immediate)
|
||||
commandBarService.setDiffIdx(uri, idx)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +134,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor
|
|||
|
||||
|
||||
// if there are *any* changes at all
|
||||
const navPanel = sortedCommandBarURIs.length !== 0 && <div
|
||||
const navPanel = anyUriHasChanges && <div
|
||||
className={`pointer-events-auto flex items-center gap-2 p-2 ${isFocused ? 'ring-1 ring-[var(--vscode-focusBorder)]' : ''}`}
|
||||
onFocus={() => setIsFocused(true)}
|
||||
onBlur={() => setIsFocused(false)}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ You're allowed to ask for more context. For example, if the user only gives you
|
|||
\
|
||||
`}
|
||||
${mode === 'agent' /* code blocks */ ? `\
|
||||
Behavior:
|
||||
- Prioritize editing files and running commands over simply making suggestions.
|
||||
- Prioritize taking as many steps as you need to complete your request over stopping early.\
|
||||
`: `\
|
||||
|
|
@ -65,7 +66,9 @@ If you think it's appropriate to suggest an edit to a file, then you must descri
|
|||
Misc:
|
||||
- Do not make things up.
|
||||
- Do not be lazy.
|
||||
- Always wrap any code you produce in triple backticks, and specify a language if possible. For example, ${tripleTick[0]}typescript\n...\n${tripleTick[1]}.\
|
||||
- Always wrap any code you produce in triple backticks, and specify a language if possible. For example, ${tripleTick[0]}typescript\n...\n${tripleTick[1]}. ${mode === 'agent' || mode === 'gather' ? `
|
||||
- If you are writing a code explanation for the user (NOT calling a tool), and you know the full path of the file that the code should go in, then you should also output the path in the first line of the triple ticks. For example, ${tripleTick[0]}typescript\n/Users/username/Desktop/my_project/app.ts\n...\n${tripleTick[1]}.\
|
||||
This is only for display purposes to the user, and it's not required. Do NOT do this if you are calling a tool or have any ambiguity about the path.` : ''}\
|
||||
`
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue