Closed Bug 732981 Opened 13 years ago Closed 11 years ago

sourceEditor.setCaretPosition() has undefined out of bounds behavior

Categories

(DevTools :: Source Editor, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: miker, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sourceeditor][fixed by work for bug 816756])

Attachments

(1 file)

If you attempt to go to a line that does not exist using sourceEditor.setCaretPosition() the current behavior is to do nothing. If a user attempts to go to a line below 0 the editor should go to line 0 and is a user attempts to go to a line past the end of the file the editor should go to the last line of the file.
Priority: P2 → P3
Version: unspecified → Trunk
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Depends on: 759351
Moving to Source Editor component. Filter on CHELICERAE.
Component: Developer Tools → Developer Tools: Source Editor
Attached patch proposed patch (deleted) — Splinter Review
Simple and quick fix.
Attachment #644956 - Flags: review?(rcampbell)
Depends on: 725392
No longer depends on: 759351
Blocks: 734831
Comment on attachment 644956 [details] [diff] [review] proposed patch looks good.
Attachment #644956 - Flags: review?(rcampbell) → review+
I think CodeMirror.setCursor's behavior is good now. When you go to the <0 line it defaults to 0. When you go to >maxline it defaults to maxline.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee: mihai.sucan → nobody
Whiteboard: [sourceeditor] → [sourceeditor][fixed by work for bug 816756]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: