Skip to content

Some keybinding option for cursor movement are missing #10277

Open

Description

@mmahmoudian

System details

RStudio Edition : server & desktop
RStudio Version : RStudio 2021.09.1+372 "Ghost Orchid" Release (8b9ced188245155642d024aa3630363df611088a, 2021-11-08) for Ubuntu Bionic 
                  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.113 Safari/537.36
OS Version      :  Manjaro (more details below)
R Version       :  4.1.2 (2021-11-01)
Detail of my system information:
    Operating System      : Manjaro Linux
    KDE Plasma Version    : 5.23.4
    KDE Frameworks Version: 5.88.0
    Qt Version            : 5.15.2
    Kernel Version        : 5.15.7-1-MANJARO (64-bit)
    Graphics Platform     : X11
    Processors            : 8 × Intel® Core™ i7-4770K CPU @ 3.50GHz
    Memory                : 15.5 GiB of RAM
    Graphics Processor    : NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2

Steps to reproduce the problem

  1. open Rstudio (server or desktop)

image
3.
image

Describe the problem in detail

  1. There is entry/option for "move to previous character" but no entry/option for "move to next character"
  2. There is entry/option for "move to next word" but no entry/option for "move to previous word"

image

Needless to say that the "keyboard shortcuts" modal window does not follow the theme of the software (as you can see in the screenshot above) which is extremely annoying and hurtful to my eyes, but that is perhaps for another bug report. :)

Describe the behavior you expected

I expect to be able to customize the "move to next character" and "move to previous word" keybindings

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. ronblum commented on Dec 22, 2021

    @ronblum
    Contributor

    @mmahmoudian Thank you for the suggestions! Also, would you mind filing another issue for the modal's theme? Thanks!

  2. mikebessuille commented on Jan 3, 2022

    @mikebessuille
    Contributor

    we have a keyboard shortcut for "Go to next character"
    image.png
    Looks like these were just named inconsistently; we should fix that.

  3. kevinushey commented on Jan 3, 2022

    @kevinushey
    Collaborator

    Custom names for Ace keybindings are defined here:

    private static final native JsObject makeDisplayNameMap()
    /*-{
    var $ = {};
    $["selectall"] = "Select All";
    $["centerselection"] = "Center Selection";
    $["gotoline"] = "Go To Line";
    $["foldall"] = "Fold All";
    $["unfoldall"] = "Unfold All";
    $["findnext"] = "Find Next";
    $["findprevious"] = "Find Previous";
    $["selecttostart"] = "Select to Beginning of Document";
    $["gotostart"] = "Go to Start of Document";
    $["selectup"] = "Select Line Upwards";
    $["golineup"] = "Move Upwards One Line";
    $["selecttoend"] = "Select to End of Document";
    $["gotoend"] = "Go to End of Document";
    $["selectdown"] = "Select Line Downwards";
    $["golinedown"] = "Move Downwards one Line";
    $["selectwordleft"] = "Select Previous Word";
    $["gotowordleft"] = "Go to Previous Word";
    $["selecttolinestart"] = "Select to Line Start";
    $["gotolinestart"] = "Go to Start of Line";
    $["selectleft"] = "Select Previous Character";
    $["gotoleft"] = "Move to Previous Character";
    $["selectwordright"] = "Select Next Word";
    $["gotowordright"] = "Move to Next Word";
    $["selecttolineend"] = "Select to End of Line";
    $["gotolineend"] = "Go to End of Line";
    $["selectright"] = "Select Next Character";
    $["gotoright"] = "Go to Next Character";
    $["selectpagedown"] = "Expand Selection down a Page";
    $["pagedown"] = "Scroll View Down a Page";
    $["gotopagedown"] = "Move Cursor Down a Page";
    $["selectpageup"] = "Expand Selection Up a Page";
    $["pageup"] = "Scroll View Up a Page";
    $["gotopageup"] = "Move Cursor Up a Page";
    $["scrollup"] = "Scroll Up a Line";
    $["scrolldown"] = "Scroll Down a Line";
    $["selectlinestart"] = "Select to Start of Line";
    $["selectlineend"] = "Select to End of Line";
    $["jumptomatching"] = "Jump to Matching Bracket";
    $["selecttomatching"] = "Select to Matching Bracket";
    $["removeline"] = "Remove Line";
    $["sortlines"] = "Sort Lines";
    $["togglecomment"] = "Toggle Comment";
    $["modifyNumberUp"] = "Increment Number at Cursor";
    $["modifyNumberDown"] = "Decrement Number at Cursor";
    $["copylinesup"] = "Copy Lines Up";
    $["movelinesup"] = "Move Lines Up";
    $["copylinesdown"] = "Copy Lines Down";
    $["movelinesdown"] = "Move Lines Down";
    $["del"] = "Delete";
    $["cut_or_delete"] = "Cut of Delete";
    $["removetolinestart"] = "Remove to Start of Line";
    $["removetolineend"] = "Remove to End of Line";
    $["removewordleft"] = "Remove Word Left";
    $["removewordright"] = "Remove Word Right";
    $["blockoutdent"] = "Block Outdent";
    $["blockindent"] = "Block Indent";
    $["splitline"] = "Split Line";
    $["transposeletters"] = "Transpose Letters";
    $["touppercase"] = "To Upper Case";
    $["tolowercase"] = "To Lower Case";
    $["expandtoline"] = "Expand to Line";
    $["joinlines"] = "Join Lines";
    return $;
    }-*/;

    The full list of default Ace commands is here:

    https://github.com/ajaxorg/ace/blob/master/lib/ace/commands/default_commands.js

  4. mmahmoudian commented on Jan 4, 2022

    @mmahmoudian
    Author

    I also realized that there is another naming mismatch: "Modify keyboard shortcuts" but "Edit code snippets".

  5. mmahmoudian commented on Jan 5, 2022

    @mmahmoudian
    Author

    @mikebessuille following to your comment, I set the cursor movements with Ctrl+{VIM keys} and I managed to get them all working other than Ctrl+L in my setup weirdly does nothing in the editor. (it correctly cleans the console when I'm in console though):

    image

    I then realized that the Rstudio is not sensitive to duplicated shortcuts. For instance in the screenshot above, I have Ctrl+J set to Move Downwards one line in the Editor scope, but it is also by default set to Split Line in the same scope. Interestingly enough, the Move Downwards one line is triggered with the keybinding and the Split Line is not triggered which makes me wonder if the one with a higher rank in the alphabetical order has the priority in the current implementation.

    Update: I found a help page of Rstudio server which states under "Handling Conflicts" heading that the Rstudio marks the conflicts, but in my end with the same exact Rstudio Server version I don't see such thing (as also illustrated in the image above).

  6. mmahmoudian commented on Feb 16, 2022

    @mmahmoudian
    Author

    Update: I just realized that the Ctrl+L actually works, but always the "Clear Console" is triggered regardless of the scope I'm in. I typically use my right [vertical] monitor for the "editor" and the rest of Rstudio is on the left [horizontal] monitor. I rarely put the main window in focus and almost always I'm in the editor and that is how I realized Rstudio shortcuts (or at least this particular one) does not respect the defined scope. To me this feels like a bug. Let me know if you want me to create a new dedicated issue for this or you would like to track this bug along with this "enhancement" issue.

    image

    At the moment of writing this I'm on the following version of Rstudio:

    RStudio 2021.09.2+382 "Ghost Orchid" Release (fc9e217980ee9320126e33cdf334d4f4e105dc4f, 2022-01-04) for Ubuntu Bionic
    Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0
    

    Running it on:

    ❯  inxi --system --graphics --width 80
    System:
      Kernel: 5.10.98-1-MANJARO x86_64 bits: 64
        Desktop: KDE Plasma 5.23.5 Distro: Manjaro Linux
    Graphics:
      Device-1: Intel CometLake-S GT2 [UHD Graphics 630] driver: i915 v: kernel
      Device-2: AMD Lexa XT [Radeon PRO WX 3200] driver: amdgpu v: kernel
      Display: x11 server: X.Org 1.21.1.3 driver: loaded: amdgpu,ati,modesetting
        resolution: 1: 1920x1080~60Hz 2: 1080x1920~60Hz 3: 1080x1920~60Hz
      OpenGL: renderer: AMD Radeon Pro WX 3200 Series (POLARIS12 DRM 3.40.0
        5.10.98-1-MANJARO LLVM 13.0.0)
        v: 4.6 Mesa 21.3.5
  7. modified the milestones: Backlog-3, Later on Oct 5, 2023
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions