+
diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
index 6319c1f0..029e0000 100644
--- a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
+++ b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
@@ -197,11 +197,12 @@ export const VoidCheckBox = ({ label, value, onClick, className }: { label: stri
}
-export const VoidSelectBox = ({ onChangeSelection, onCreateInstance, selectBoxRef, options }: {
+export const VoidSelectBox = ({ onChangeSelection, onCreateInstance, selectBoxRef, options, className }: {
onChangeSelection: (value: T) => void;
onCreateInstance?: ((instance: SelectBox) => void | IDisposable[]);
selectBoxRef?: React.MutableRefObject;
options: readonly { text: string, value: T }[];
+ className?:string;
}) => {
const accessor = useAccessor()
const contextViewProvider = accessor.get('IContextViewService')
@@ -209,10 +210,9 @@ export const VoidSelectBox = ({ onChangeSelection, onCreateInstance, selectB
let containerRef = useRef(null);
return {
containerRef.current = container
diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx
index d0cd41b4..1a3bd734 100644
--- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx
+++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx
@@ -32,6 +32,7 @@ const ModelSelectBox = ({ options, featureName }: { options: ModelOption[], feat
let weChangedText = false
return {
if (weChangedText) return
diff --git a/src/vs/workbench/contrib/void/browser/sidebarActions.ts b/src/vs/workbench/contrib/void/browser/sidebarActions.ts
index bd1c753f..b2a4df91 100644
--- a/src/vs/workbench/contrib/void/browser/sidebarActions.ts
+++ b/src/vs/workbench/contrib/void/browser/sidebarActions.ts
@@ -26,13 +26,17 @@ import { VOID_OPEN_SETTINGS_ACTION_ID } from './voidSettingsPane.js';
// ---------- Register commands and keybindings ----------
-const roundRangeToLines = (range: IRange | null | undefined) => {
+export const roundRangeToLines = (range: IRange | null | undefined, options: { emptySelectionBehavior: 'null' | 'line' }) => {
if (!range)
return null
// treat as no selection if selection is empty
- if (range.endColumn === range.startColumn && range.endLineNumber === range.startLineNumber)
- return null
+ if (range.endColumn === range.startColumn && range.endLineNumber === range.startLineNumber) {
+ if (options.emptySelectionBehavior === 'null')
+ return null
+ else if (options.emptySelectionBehavior === 'line')
+ return { startLineNumber: range.startLineNumber, startColumn: 1, endLineNumber: range.startLineNumber, endColumn: 1 }
+ }
// IRange is 1-indexed
const endLine = range.endColumn === 1 ? range.endLineNumber - 1 : range.endLineNumber // e.g. if the user triple clicks, it selects column=0, line=line -> column=0, line=line+1
@@ -77,10 +81,8 @@ registerAction2(class extends Action2 {
stateService.fireFocusChat()
const editor = editorService.getActiveCodeEditor()
- const selectionRange = roundRangeToLines(
- // accessor.get(IEditorService).activeTextEditorControl?.getSelection()
- editor?.getSelection()
- )
+ // accessor.get(IEditorService).activeTextEditorControl?.getSelection()
+ const selectionRange = roundRangeToLines(editor?.getSelection(), { emptySelectionBehavior: 'null' })
// select whole lines