Visitar URL original
Goto/highlight target error when moving around in the panel · Issue #1717 · SublimeLinter/SublimeLinter · GitHub
Skip to content

Goto/highlight target error when moving around in the panel #1717

Open

Description

@kaste

We currently support double-clicking in the panel as a goto-command. Maybe we could reduce that to simple clicks, and then generally just follow the cursor in the panel.

Basically reducing the need for mouse interactions. We could then explore how the panel could get keyboard focus just by using the keyboard. (ctrl+ka only opens the panel without focusing it.)

Technically that means we implement on_selection_modifed for the panel view. Since the target view also implements on_selection_modified to scroll and select the correct error in the panel we need to take care of this circular triggering which will be the tricky part here.

Activity

  1. braver commented on Mar 6, 2020

    @braver
    Member

    Well, that is maybe tricky because you need to think about click-dragging to select text etc. Also, IIRC "we" don't support double-clicking, we just format the output in a way that makes Sublime Text support it like that. I'm hesitant to introduce behavior in our output panel that makes it different from other output panels that look similar. It intentionally mimics the output of the "find results" panel and the "build output" panels. So I'm not against researching possible improvements here, but we should fit into the eco system, or move the eco system forward.

  2. kaste commented on Mar 6, 2020

    @kaste
    MemberAuthor

    Well, our panel is probably best-in-class. With the new "focus on one file" feature it maybe feels natural to just go through them via cursor. Of course popping up errors from other files would be surprising. Maybe on <enter> which is clearly an user action (and also missing from the built in find panel).

    With the current panel it feels a bit too mousy, and that's just because the panel behaves so great in that it always shows the right information, auto-wrapped and auto-scrolled. I think I wish I could just use the keyboard more. And then introducing <n/p> shortcuts for essentially cursor navigation when you can just move the cursor...

    Either on_selection_modified or <enter> I think. What would be a good method to bring the focus to the panel?

  3. kaste commented on Apr 5, 2020

    @kaste
    MemberAuthor

    Let's brainstorm a bit:

    This basically combines quick-panel features with the "output.panel".

    Let's say the user opens the panel by ctrl+k+g to also focus the panel. Upon that we open the panel and put the cursor on the nearest error. The user can then use up-down to move the cursor. On cursor move and also initially, we will highlight (transiently) the error in a normal view. On ESC we will "cancel" this previewing, and focus and go to the previous view in the previous view position. On Enter we will focus the view, showing the selected error. (We probably also close our error panel.)

    (This is pretty much, or should be as close as possible, how ctrl+shift+r (Goto-Symbol) works.)

    If the panel is already open ctrl+k+g just focuses the panel and shows the nearest error. Just clicking into an open panel, selects that error.

    Typical use-case A: You edit a file, then some import at the top of the file gets unused. You somehow get the focus to the panel as described. Use the cursor to move to the said error. Hit enter to fix it, then the builtin Go back command (e.g. alt+left) to go back to the section you were editing before.

    Typical use-case B: You see that you have some errors in the file. You open and focus the panel to review some error, then hit ESC to continue working without fixing.

  4. braver commented on Apr 6, 2020

    @braver
    Member

    You can already keyboard navigate through stuff in the output panel (any output panel) without focusing the panel itself, via next/previous result. This works in conjunction with “go back” just like anything else. I guess I don’t understand your use cases because I think they’re already fully covered (because it’s a standard output panel)?

    Maybe we could do a new command “open panel and scroll to nearest error in file” (to quickly check something relevant about what you’re writing). Or “open panel at first error in file” to start reviewing a file?

  5. kaste commented on Apr 6, 2020

    @kaste
    MemberAuthor

    Hm, next/previous result just doesn't work really reliable (on SL3?) and the interaction with "go back" is incomprehensible. Sometimes it skips results or jumps to the next file.

    In comparison the UI using the "goto symbol" (or any other quick panel) is 100%. In that: you basically open the panel, then up down to preview, enter to commit going to that location, ESC to discard.

    Our own goto next/previous error command is reliable but it always commits the location to the history. Nothing we can change though (I think) because it is only one keystroke we either always commit to the history or never. (The preview feature is missing, I guess.)

  6. braver commented on Apr 6, 2020

    @braver
    Member

    Hm, next/previous result just doesn't work really reliable

    Ok, I don't have that problem, but let's say it's there (maybe we should pin-point it and open an issue upstream).

    the interaction with "go back" is incomprehensible

    I think it bundles all the steps into one "edit" or something. It is weird though.

    I agree that as soon as you have focus in the panel it's nice if you could do something there. It seems only natural that "Enter" would bring you to where your cursor points at.

  7. kaste commented on Apr 6, 2020

    @kaste
    MemberAuthor

    I think I quickly(?) hack a quick-panel to see if that UX (previewing locations, commit or discard jumping, all just using the keyboard) makes a difference, esp. I would like "go back" to work better, and of course not going to the mouse at all.

  8. added 2 commits that reference this issue on Jun 18, 2020
    0a5e539
    4469ad6
  9. added 2 commits that reference this issue on Jul 10, 2020
    c0906e9
    91b1de2
  10. added a commit that references this issue on Aug 3, 2020
    1685920
  11. added a commit that references this issue on Aug 21, 2020
    8a3943c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions