| Summary: | [outliner] Scroll and reveal should scroll to start of selection, not the end | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Curtis Windatt <curtis.windatt.public> | ||||
| Component: | JS Tools | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P3 | CC: | Michael_Rennie | ||||
| Version: | 5.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I'm not seeing a way to accomplish this. The selection service has no concept of whether to reveal or not, nevermind what to reveal. We could work around this by just selecting the start of the closure. We currently do this for named function declarations (just select the name). Moving to JS Tools as we can simply consider changing the selection for closures. We already select the identifier for functions and the return keyword. I'll attach a patch which changes the selection to just the opening bracket. Mike, let me know what you think. The reveal is much better, but the selection looks odd and isn't always immediately noticeable. Created attachment 239437 [details]
Fix to select only the opening bracket
(In reply to Curtis Windatt from comment #3) > Created attachment 239437 [details] > Fix to select only the opening bracket It is *much* better, especially in the Orion code where the first closure selects pretty much the whole file. Like you mentioned though, it is hard to notice the one char selection. Perhaps you could select the entire statement the object 'belongs' to? For example: Foo.bar({... }); would select 'Foo.bar({...' Foo.bar(function({... })); would select 'function({...' This should be pretty simple to do since we are currently on the parent node when we compute the signature / ranges in the outliner. (In reply to Michael Rennie from comment #4) > This should be pretty simple to do since we are currently on the parent node > when we compute the signature / ranges in the outliner. I'm going to defer this until 6.0. Curtis and I chatted about it and tried selecting other items, but none of it felt quite right. Selecting the entire statement is possible if we have the parent. However, we do not always have a parent node available. Inconsistent ranges would be worse than selecting the whole closure so I'm marking this as WONTFIX. |
1) Open a file with large closures (ex: occurrences.js in the js plug-in) 2) Ctrl-O to open the outliner 3) Click on a closure {...} entry Result: The closure is selected and the editor scrolls to the end of the selection. When you click on a function or a closure, you expect to see the beginning of the selection, where is it defined.