Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7dc7095

Browse files
committed
Resolved merge
2 parents 7b6ab8c + cbcdebe commit 7dc7095

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1297
-1472
lines changed

‎.eslintrc.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"es6": true,
55
"node": true
66
},
7+
"plugins": ["unused-imports"],
78
"extends": [
89
"eslint:recommended",
910
"plugin:@typescript-eslint/eslint-recommended",
@@ -12,5 +13,25 @@
1213
"plugin:import/electron",
1314
"plugin:import/typescript"
1415
],
16+
"rules": {
17+
"@typescript-eslint/ban-ts-comment": "off",
18+
"@typescript-eslint/no-empty-function": "off",
19+
"@typescript-eslint/no-explicit-any": "off",
20+
"@typescript-eslint/no-non-null-assertion": "off",
21+
"@typescript-eslint/no-unused-vars": "off",
22+
"@typescript-eslint/no-var-requires": "off",
23+
"import/no-named-as-default": "off",
24+
"no-constant-condition": "off",
25+
"unused-imports/no-unused-imports": "error",
26+
"unused-imports/no-unused-vars": [
27+
"warn",
28+
{
29+
"vars": "all",
30+
"varsIgnorePattern": "^_",
31+
"args": "after-used",
32+
"argsIgnorePattern": "^_"
33+
}
34+
]
35+
},
1536
"parser": "@typescript-eslint/parser"
1637
}

‎package-lock.json‎

Lines changed: 50 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"homepage": "cursor.so",
3-
"name": "Cursor",
2+
"homepage": "https://cursor.so",
3+
"name": "cursor",
44
"author": {
5-
"name": "Michael Truell",
6-
"email": "[email protected]"
5+
"name": "Cursor AI, Inc.",
6+
"email": "[email protected]"
77
},
88
"productName": "Cursor",
9-
"version": "0.1.9",
9+
"version": "0.1.11",
1010
"description": "Cursor is an AI-first coding environment.",
1111
"main": ".webpack/main",
1212
"scripts": {
@@ -66,6 +66,7 @@
6666
"electron-winstaller": "^5.1.0",
6767
"eslint": "^8.36.0",
6868
"eslint-plugin-import": "^2.27.5",
69+
"eslint-plugin-unused-imports": "^2.0.0",
6970
"husky": "^8.0.3",
7071
"identity-obj-proxy": "^3.0.0",
7172
"jest": "^29.3.1",

‎src/app/constants.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ import {
22
faTimes,
33
faHistory,
44
IconDefinition,
5-
faChevronLeft,
6-
faChevronRight,
75
} from '@fortawesome/free-solid-svg-icons'
86
import {
97
faChevronsLeft,
10-
faChevronsRight,
118
} from '@fortawesome/pro-regular-svg-icons'
12-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
139
import { setChatOpen, toggleChatHistory } from '../features/chat/chatSlice'
1410
import { store } from './store'
1511

‎src/appComponent.tsx‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
useState,
66
useCallback,
77
} from 'react'
8-
import { faClose, faCog } from '@fortawesome/pro-regular-svg-icons'
8+
import { faClose } from '@fortawesome/pro-regular-svg-icons'
99
import Modal from 'react-modal'
1010

1111
import { useAppSelector, useAppDispatch } from './app/hooks'
@@ -26,7 +26,6 @@ import {
2626
getFocusedTab,
2727
} from './features/selectors'
2828

29-
import _ from 'lodash'
3029

3130
import { ChatPopup, CommandBar } from './components/markdown'
3231
import { SettingsPopup } from './components/settingsPane'
@@ -54,7 +53,7 @@ const customStyles = {
5453
height: 'auto',
5554
marginLeft: 'auto',
5655
marginRight: 'auto',
57-
maxWidth: '600px',
56+
maxWidth: '700px',
5857
},
5958
}
6059

@@ -66,25 +65,25 @@ function ErrorPopup() {
6665
<Modal
6766
isOpen={showError}
6867
onRequestClose={() => {
69-
dispatch(gs.closeError(null))
68+
dispatch(gs.closeError())
7069
}}
7170
style={customStyles}
7271
>
7372
<div className="errorPopup">
7473
<div className="errorPopup__title">
7574
<div className="errorPopup__title_text">
76-
Maximum Capacity
75+
We ran into a problem
7776
</div>
7877
<div
7978
className="errorPopup__title_close"
80-
onClick={() => dispatch(gs.closeError(null))}
79+
onClick={() => dispatch(gs.closeError())}
8180
>
8281
<FontAwesomeIcon icon={faClose} />
8382
</div>
8483
</div>
8584
<div className="errorPopup__body">
86-
We're getting more traffic than we can handle right now.
87-
Please try again later.
85+
Something unexpected happened. Please try again later. If
86+
this continues, please contact [email protected].
8887
<br />
8988
</div>
9089
</div>
@@ -111,7 +110,7 @@ function RateLimitPopup() {
111110
</div>
112111
<div
113112
className="errorPopup__title_close"
114-
onClick={() => dispatch(gs.closeError(null))}
113+
onClick={() => dispatch(gs.closeError())}
115114
>
116115
<FontAwesomeIcon icon={faClose} />
117116
</div>
@@ -152,8 +151,16 @@ function NoAuthRateLimitPopup() {
152151
</div>
153152
</div>
154153
<div className="errorPopup__body">
155-
We're getting more traffic than we can handle right
156-
now. To avoid these limits, you can enter your OpenAI API key in Settings.
154+
We're getting more traffic than we can handle right now.
155+
Please try again in one minute. To avoid these limits, you
156+
can optionally upgrade to{' '}
157+
<a
158+
className="pay-link"
159+
onClick={() => dispatch(ts.upgradeCursor(null))}
160+
>
161+
pro
162+
</a>
163+
.
157164
</div>
158165
</div>
159166
</Modal>
@@ -183,7 +190,7 @@ function SSHPopup() {
183190
<Modal
184191
isOpen={showRemotePopup}
185192
onRequestClose={() => {
186-
dispatch(gs.closeRemotePopup(null))
193+
dispatch(gs.closeRemotePopup())
187194
}}
188195
style={customStyles}
189196
>
@@ -194,7 +201,7 @@ function SSHPopup() {
194201
</div>
195202
<div
196203
className="remotePopup__title_close"
197-
onClick={() => dispatch(gs.closeRemotePopup(null))}
204+
onClick={() => dispatch(gs.closeRemotePopup())}
198205
>
199206
<FontAwesomeIcon icon={faClose} />
200207
</div>

‎src/components/codemirror-vim/block-cursor.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Piece {
1919
) {}
2020

2121
draw() {
22-
let elt = document.createElement('div')
22+
const elt = document.createElement('div')
2323
elt.className = this.className
2424
this.adjust(elt)
2525
return elt
@@ -99,11 +99,11 @@ export class BlockCursorPlugin {
9999
}
100100

101101
readPos(): Measure {
102-
let { state } = this.view
103-
let cursors = []
104-
for (let r of state.selection.ranges) {
105-
let prim = r == state.selection.main
106-
let piece = measureCursor(this.cm, this.view, r, prim)
102+
const { state } = this.view
103+
const cursors = []
104+
for (const r of state.selection.ranges) {
105+
const prim = r == state.selection.main
106+
const piece = measureCursor(this.cm, this.view, r, prim)
107107
if (piece) cursors.push(piece)
108108
}
109109
return { cursors }
@@ -114,7 +114,7 @@ export class BlockCursorPlugin {
114114
cursors.length != this.cursors.length ||
115115
cursors.some((c, i) => !c.eq(this.cursors[i]))
116116
) {
117-
let oldCursors = this.cursorLayer.children
117+
const oldCursors = this.cursorLayer.children
118118
if (oldCursors.length !== cursors.length) {
119119
this.cursorLayer.textContent = ''
120120
for (const c of cursors) this.cursorLayer.appendChild(c.draw())
@@ -156,8 +156,8 @@ const themeSpec = {
156156
export const hideNativeSelection = Prec.highest(EditorView.theme(themeSpec))
157157

158158
function getBase(view: EditorView) {
159-
let rect = view.scrollDOM.getBoundingClientRect()
160-
let left =
159+
const rect = view.scrollDOM.getBoundingClientRect()
160+
const left =
161161
view.textDirection == Direction.LTR
162162
? rect.left
163163
: rect.right - view.scrollDOM.clientWidth
@@ -176,7 +176,7 @@ function measureCursor(
176176
let head = cursor.head
177177
let fatCursor = false
178178
let hCoeff = 1
179-
let vim = cm.state.vim
179+
const vim = cm.state.vim
180180
if (vim && (!vim.insertMode || cm.state.overwrite)) {
181181
fatCursor = true
182182
if (vim.visualBlock && !primary) return null
@@ -193,9 +193,9 @@ function measureCursor(
193193
head--
194194
letter = view.state.sliceDoc(head, head + 1)
195195
}
196-
let pos = view.coordsAtPos(head, 1)
196+
const pos = view.coordsAtPos(head, 1)
197197
if (!pos) return null
198-
let base = getBase(view)
198+
const base = getBase(view)
199199
let domAtPos = view.domAtPos(head)
200200
let node = domAtPos ? domAtPos.node : view.contentDOM
201201
while (domAtPos && domAtPos.node instanceof HTMLElement) {
@@ -209,7 +209,7 @@ function measureCursor(
209209
if (!node.parentNode) return null
210210
node = node.parentNode
211211
}
212-
let style = getComputedStyle(node as HTMLElement)
212+
const style = getComputedStyle(node as HTMLElement)
213213
if (!letter || letter == '\n' || letter == '\r') letter = '\xa0'
214214
else if (
215215
/[\uD800-\uDBFF]/.test(letter) &&
@@ -218,7 +218,7 @@ function measureCursor(
218218
// include the second half of a surrogate pair in cursor
219219
letter += view.state.sliceDoc(head + 1, head + 2)
220220
}
221-
let h = pos.bottom - pos.top
221+
const h = pos.bottom - pos.top
222222
return new Piece(
223223
pos.left - base.left,
224224
pos.top - base.top + h * (1 - hCoeff),

0 commit comments

Comments
 (0)