Giter Club home page Giter Club logo

Comments (16)

metasong avatar metasong commented on July 17, 2024

I really want to remove the defaut conflict, the problem here is what's the most convent shortcut for us to use the commands. Is ctrl+l, down, down....for selecting down, and ctrl+l, up,up... for select up ok? are there better way? what's your suggestion.

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

By Ctrl+L, up, do you mean first Ctrl+L (then release) then up ?

Because if so, the user would need to constantly press and release Ctrl+L before every up to select a line up, I think this would be a little slow.

How about Alt+Shif+K for up and Alt+Shift+J for down instead ?
This follows the classic vim keybind for up and down.

from metago.

metasong avatar metasong commented on July 17, 2024

I'm thinking make Ctrl+L into a line comand trigger: if the user press i(means up, configurable), triggers the selecting up subcomand, in this subcomand the user can press i again or press k (mean down) several times. Ctrl+L, k is select down subcomand triger. any other key other than i,k would escape this comand. This is the idea, I would evelate the possiblility to make it happen. this also opens the possibility to make other line related subcomands, any better idea?

from metago.

metasong avatar metasong commented on July 17, 2024

#26

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

From what I understand of command triggers, we need to press the trigger (Ctrl+L), release the keys and press the next key and release. To repeat the command, you need to do everything else again and not just the last key:
Press Ctrl+L, release Ctrl+L, press up, release up -> Select line up is ran.
Press Ctrl+L, release Ctrl+L, press up, release up -> Select line up is ran. -> press up, release up -> Select line up is not ran and the previous selection is removed because the user pressed up which caused the cursor to go up (default action for up is cursorUp).

Press Ctrl+L, release Ctrl+L, press up, release up -> Select line up is ran. -> Press Ctrl+L, release Ctrl+L, press up, release up -> Select line up is ran again.

The forces the user to keep pressing and releasing Ctrl+L and then pressing and releasing up to select the line up.

But to tell you the truth, I don't really see any benefit in having this command. We can just use the normal Shift+up to select the line up and Home while holding Shift to select until the start of the line.

from metago.

metasong avatar metasong commented on July 17, 2024

@Ranguna thank you for your detail description.
in vscode, we could create a command that last for a while, and when execute the command, we can read the user's key stroke and do task accordingly.
the only one problem in my idea is the escape of the command. I could make the escape occurs when user type key that is not 'i' or 'k', and also add a timeout after user press 'i' or 'k' to do escape, it's a kind of over engineering, but opens an opportunity to other line related commands(Ctrl+L, 'key'): search-in-line?.....

for now, I prefer leave this feature with a low priority.

and consider other shortcut to avoid the collision

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

Yes. Maybe to quickly close this issue, you can just assign a non conflicting shortcut, then you can explore other options in the future.
As I said above, Alt+Shif+K for up and Alt+Shift+J for down are good for me.

from metago.

metasong avatar metasong commented on July 17, 2024

I prefer to keep use the current default setting; Ctrl+L is the default shortcut for select line down.
you could press ctrl+K, ctrl+s and search metago, find the command and assign the shortcut that you like. note: you could also right click and select delete, to remove the metago default assignment, the the defaut vscode command for ctrl+shift+l shorcut would be used:
image

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

Yes, I locally deleted metago keybinding before posting this issue.
That new key is fine by me as long as it doesn't overwrite vscode's default ones πŸ‘

from metago.

metasong avatar metasong commented on July 17, 2024

@Ranguna new implementation:

  • Ctrl+l to select current line or extend selection by one line below.
  • Ctrl+o to extend selection by one line above.

note: Ctrl+o triggers open file by default, and it triggers extend line selection when there is selection in active editor.

if you want to select line up, you should press Ctrl+l to select current line and then press Ctrl+o to extend line selection up.

by default selectLineUp command is configed as:

{
	"command": "metaGo.selectLineUp",
	"key": "ctrl+o",
	"mac": "cmd+o",
	"when": "editorTextFocus && editorHasSelection"
}

you could asign a shortcut key not collision with default vscode ones, and remove the editorHasSelection condition, so it would work even no selection in editor.

I have done the implementation, would be released in the next versionπŸ˜‰

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

So the original issue was about a metaGo keyboard shortcut conflicting with a default vscode one. Your solution is to remove the old conflicting and replace it with a, even worse and widely used, default vscode keyboard shortcut ?

Should I change the issue name to be more generic, something like "remove all metaGo keyboard shortcut conflict with default vscode keyboard shortcuts", or should I close this issue and open a new one right after ?

I'm sorry to say this but... This is a bad "solution" to this issue.

from metago.

metasong avatar metasong commented on July 17, 2024

@Ranguna I think you misunderstand what I mean.
there is no conflict after my modification, It's better than my original solution.
the ctrl+o to open a file still works, it just works as the extending selection up when there is selection.

from metago.

metasong avatar metasong commented on July 17, 2024

let me build a special release for you, have an evaluation:
v3.6.1

from metago.

Ranguna avatar Ranguna commented on July 17, 2024

the ctrl+o to open a file still works, it just works as the extending selection up when there is selection.

Hmm.. Now I feel stupid. I'm sorry for what I said.

Users will still see a weird behavior when they have selected something and are trying to open a file though, but either way, the original command doesn't conflict anymore.

Also v3.6.1 works as described. I'm good with closing this issue once the next version has been released. Thanks πŸ‘

from metago.

metasong avatar metasong commented on July 17, 2024

I'm glad you accept it. And also to remind if you want you can bind other shortcuts as you described before, just to make sure to remove 'editorHasSelection' condition for 'selectLineUp' to make it works even without selection.(you need edit json file to modify condition). I think the default key bindings are better, the collision is minor than the convenience it brings.

from metago.

metasong avatar metasong commented on July 17, 2024

close this issue after publish V3.6.6

from metago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.