Skip to content

Commit

Permalink
passes prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanger2000 committed Mar 27, 2023
1 parent 60ada1e commit 5410c19
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/components/codemirror-vim/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ function generateVimPlugin(callbacks: CustomVimConfig) {
Vim.map('<C-w>k', ':toTopPane', 'normal')
Vim.map('<C-w>j', ':toBottomPane', 'normal')
Vim.map('<C-c>', '<Esc>', 'insert')

}

if (callbacks.exit != null)
Expand Down
16 changes: 8 additions & 8 deletions src/components/codemirrorHooks/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,14 @@ export function useExtensions({
}, [fileIndentUnit, editorRef.current, justCreated])

useEffect(() => {
if (settings.tabSize != undefined) {
editorRef.current.view?.dispatch({
effects: indentCompartment.reconfigure([
indentUnit.of(" ".repeat(Number(settings.tabSize))),
EditorState.tabSize.of(Number(settings.tabSize))
]),
})
}
if (settings.tabSize != undefined) {
editorRef.current.view?.dispatch({
effects: indentCompartment.reconfigure([
indentUnit.of(' '.repeat(Number(settings.tabSize))),
EditorState.tabSize.of(Number(settings.tabSize)),
]),
})
}
}, [settings.tabSize, editorRef.current, justCreated])

return globalExtensions
Expand Down
11 changes: 4 additions & 7 deletions src/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,10 @@ export default function Editor({ tabId }: { tabId: number }) {
})
} else {
view.dispatch({
effects: EditorView.scrollIntoView(
0,
{
y: 'start',
yMargin: 0,
}
),
effects: EditorView.scrollIntoView(0, {
y: 'start',
yMargin: 0,
}),
})
}
transactionDispatcher(view, transactions)
Expand Down
6 changes: 3 additions & 3 deletions src/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ export function ChatPopup() {
const commandBoxRef = useRef<HTMLDivElement>(null)

useEffect(() => {
if(!isGenerating && commandBoxRef) {
if (!isGenerating && commandBoxRef) {
setTimeout(() => {
commandBoxRef.current?.scrollIntoView({ behavior: "smooth" });
commandBoxRef.current?.scrollIntoView({ behavior: 'smooth' })
}, 100)
}
}, [isGenerating])
Expand Down Expand Up @@ -440,7 +440,7 @@ export function MarkdownPopup({
className="markdownpopup__content"
ref={reactMarkdownRef}
>
{/* <Markdown
{/* <Markdown
options={{
overrides: {
a: {
Expand Down
11 changes: 6 additions & 5 deletions src/components/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ function Tab({ tid }: { tid: number }) {
}}
onContextMenu={() => dispatch(gs.rightClickTab(tid))}
>
<div onMouseDown={
(e) => {
if(e.button == 1) { // middle click
<div
onMouseDown={(e) => {
if (e.button == 1) {
// middle click
e.stopPropagation()
dispatch(gt.closeTab(tid))
}
}
}>
}}
>
<div className="tab__icon">{getIconElement(file.name)}</div>
<div className="tab__name">{name}</div>
<div
Expand Down
4 changes: 2 additions & 2 deletions src/components/terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function XTermComponent({ height }: { height: number }) {
foreground: '#f1f1f1',
},
})
terminal.current.onResize((size: { cols: number, rows: number }) => {
terminal.current.onResize((size: { cols: number; rows: number }) => {
connector.terminalResize(size)
});
})

terminal.current.loadAddon(fitAddon.current)

Expand Down
2 changes: 1 addition & 1 deletion src/components/titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function MenuBar() {
() => {
dispatch(gs.openRemotePopup(null))
},
''
'',
],
[
'Save File',
Expand Down
1 change: 0 additions & 1 deletion src/features/chat/chatThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1356,4 +1356,3 @@ export const submitCommandBar = thunkFactory(
dummySubmitCommandBar,
'submitCommandBar'
)

14 changes: 7 additions & 7 deletions src/features/globalThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const closeTab = createAsyncThunk(
export const closeAllTabs = createAsyncThunk(
'global/closeAllTabs',
async (_, { getState, dispatch }) => {
const state = (<FullState>getState()).global
const tabIds = Object.keys(state.tabs);
for (const tabId of tabIds) {
await dispatch(closeTab(parseInt(tabId, 10)));
}
const state = (<FullState>getState()).global
const tabIds = Object.keys(state.tabs)

for (const tabId of tabIds) {
await dispatch(closeTab(parseInt(tabId, 10)))
}
}
);
)
2 changes: 1 addition & 1 deletion src/features/window/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export const initialSettingsState = {
useFour: 'disabled',
contextType: 'none',
textWrapping: 'disabled',
tabSize: undefined
tabSize: undefined,
},
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ cm-diff-cancel > div {
padding: 8px 12px;
cursor: pointer;
display: flex;
/* justify-content: center; */
/* justify-content: center; */
align-items: center;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const lspDir = app.isPackaged
? path.join(process.resourcesPath, 'lsp')
: path.join(__dirname, '..', '..', 'lsp')

if (!fs.existsSync(lspDir)) {
if (!fs.existsSync(lspDir)) {
fs.mkdirSync(lspDir)
}

Expand Down
3 changes: 2 additions & 1 deletion src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ const electronConnector = {
rightClickFile: () => ipcRenderer.invoke('right_click_file', null),
rightClickTab: () => ipcRenderer.invoke('right_click_tab', null),
deleteFile: (path: string) => ipcRenderer.invoke('delete_file', path),
openContainingFolder: (path: string) => ipcRenderer.invoke('open_containing_folder', path),
openContainingFolder: (path: string) =>
ipcRenderer.invoke('open_containing_folder', path),
deleteFolder: (path: string) => ipcRenderer.invoke('delete_folder', path),
rightClickFolder: (path: string, isRoot: boolean) =>
ipcRenderer.invoke('right_click_folder', {
Expand Down

0 comments on commit 5410c19

Please sign in to comment.