Skip to content

【yml editor】Shortcut key comment not following cursor #159

Closed

Description

@yl-yue

version
Spring Tool Suite 4

Version: 4.0.2.RELEASE
Build Id: 201811300843

Problem description

ctrl + shift + c Not following cursor comments.

image

As shown in the figure above, select the cursor druid.sql.Statement: DEBUGThis line, press the shortcut key combination, the effect is as follows:

image

The annotated content is the first line

Activity

  1. changed the title [-]【yml editor】Shortcut key comment problem[/-] [+]【yml editor】Shortcut key comment not following cursor[/+] on Dec 5, 2018
  2. mweirauch commented on Dec 5, 2018

    @mweirauch

    Can confirm this regression. Same version.

  3. kdvolder commented on Dec 5, 2018

    @kdvolder
    Member

    At first I couldn't reproduce it. The key seems to be that problems ensue if the text selection is of length zero. In other words it is just a 'cursor' rather than a selection highlighting a range of characters. Even selecting just a single character makes it work correctly. But if change selection, for example, by moving the cursor around the document using the arrow keys, then, the next time we call on 'Toggle Comment' it triggers at the last location where a non-empty text selection was made.

    Seems like this is some sort of a quirk caused by the Eclipse 'selection service'. I think it is skipping over 'empty' selections and so to the 'Toggle comment' handler it is as if those cursor movements never happened. I'll have to debug it a bit more to be sure of this explanation, and to find a suitable fix.

    In the mean time a simple workaround is to make sure you select at least one character before triggering 'toggle comment'.

  4. added a commit that references this issue on Dec 5, 2018
  5. added this to the 4.1.0.RELEASE milestone on Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions