Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
truell20 committed Mar 30, 2023
1 parent 8f5bab8 commit ea14a89
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 53 deletions.
27 changes: 16 additions & 11 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ module.exports = {
packagerConfig: {
name: 'Cursor',
icon: 'assets/icon/icon',
extraResource: ['./lsp', './resources', './tutor', './todesktop-runtime-config.json'],
extraResource: [
'./lsp',
'./resources',
'./tutor',
'./todesktop-runtime-config.json',
],
osxSign: {},
protocols: [
{
name: "Electron Fiddle",
schemes: ["electron-fiddle"]
}
]
{
name: 'Electron Fiddle',
schemes: ['electron-fiddle'],
},
],
},
rebuildConfig: {},
makers: [
Expand All @@ -30,11 +35,11 @@ module.exports = {
},
},
{
"name": "@electron-forge/maker-deb",
"config": {
"mimeType": ["x-scheme-handler/electron-fiddle"]
}
}
name: '@electron-forge/maker-deb',
config: {
mimeType: ['x-scheme-handler/electron-fiddle'],
},
},
],
plugins: [
{
Expand Down
6 changes: 3 additions & 3 deletions src/components/codemirror-vim/cm_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runHistoryCommand(cm: CodeMirror, revert: boolean) {
if (cm.curOp) {
cm.curOp.$changeStart = undefined
}
(revert ? undo : redo)(cm.cm6)
;(revert ? undo : redo)(cm.cm6)
const changeStartIndex = cm.curOp?.$changeStart
// vim mode expects the changed text to be either selected or cursor placed at the start
if (changeStartIndex != null) {
Expand Down Expand Up @@ -568,7 +568,7 @@ export class CodeMirror {
caseSensitive: !/i/.test(query.flags),
})
if (cm6Query.valid) {
(cm6Query as any).forVim = true
;(cm6Query as any).forVim = true
this.cm6Query = cm6Query
const effect = setSearchQuery.of(cm6Query)
this.cm6.dispatch({ effects: effect })
Expand Down Expand Up @@ -784,7 +784,7 @@ export class CodeMirror {
this.refresh()
}
refresh() {
(this.cm6 as any).measure()
;(this.cm6 as any).measure()
}

// event listeners
Expand Down
99 changes: 61 additions & 38 deletions src/components/errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { getError, getShowErrors } from '../features/selectors'
import { faClose } from '@fortawesome/pro-regular-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Modal from 'react-modal'
import { NoAuthGlobalOldRateLimitError, NotLoggedInError, OpenAIError } from '../utils';
import { CursorLogin, OpenAILoginPanel } from './settingsPane';
import { signInCursor, upgradeCursor } from '../features/tools/toolSlice';
import {
NoAuthGlobalOldRateLimitError,
NotLoggedInError,
OpenAIError,
} from '../utils'
import { CursorLogin, OpenAILoginPanel } from './settingsPane'
import { signInCursor, upgradeCursor } from '../features/tools/toolSlice'

const customStyles = {
overlay: {
Expand Down Expand Up @@ -103,28 +107,39 @@ export function ErrorPopup() {
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">To avoid abuse on our backend, we ask that you login in to use the AI features</div>
<div className="signup__signup_button" onClick={() => dispatch(signInCursor(null))}>Log in</div>

<div className="signup__signup_button" onClick={() => dispatch(signInCursor(null))}>Sign up</div>

</div>
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">
Or enter your OpenAI API key
To avoid abuse on our backend, we ask that you
login in to use the AI features
</div>
<div
className="signup__signup_button"
onClick={() => dispatch(signInCursor(null))}
>
Log in
</div>

<div
className="signup__signup_button"
onClick={() => dispatch(signInCursor(null))}
>
Sign up
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</Modal>
Expand All @@ -148,26 +163,34 @@ export function ErrorPopup() {
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Free tier limit exceeded</div>
<div className="signup__module">
<div className="signup__subtitle">If you've enjoyed using Cursor, please consider subscribing to one of our paid plans</div>
<div className="signup__signup_button" onClick={() => dispatch(upgradeCursor(null))}>Upgrade</div>

</div>
<div className="signup__signup_button">Upgrade</div>
<div className="signup__body">
<div className="signup__title">
Free tier limit exceeded
</div>
<div className="signup__module signup__last_module">
<div className="signup__module">
<div className="signup__subtitle">
Or enter your OpenAI API key to continue using
the AI features at-cost
If you've enjoyed using Cursor, please consider
subscribing to one of our paid plans
</div>
<div
className="signup__signup_button"
onClick={() => dispatch(upgradeCursor(null))}
>
Upgrade
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
<div className="signup__signup_button">Upgrade</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key to continue using the
AI features at-cost
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</Modal>
Expand Down
2 changes: 1 addition & 1 deletion src/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export function ChatPopup() {

function handleMouseDown() {
if (document.activeElement) {
(document.activeElement as HTMLElement).blur()
;(document.activeElement as HTMLElement).blur()
}
}
return (
Expand Down

0 comments on commit ea14a89

Please sign in to comment.