Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving lines up/down #16

Open
LukaPitamic opened this issue Jun 13, 2020 · 6 comments
Open

moving lines up/down #16

LukaPitamic opened this issue Jun 13, 2020 · 6 comments

Comments

@LukaPitamic
Copy link

Hi, great addition to JL!!!

I'm facing the issue though:

  1. If I move a line up, pointer moves beyond the cell (into a previous cell)
  2. if I move line down it evokes error sound (but it doesn't move beyond current cell into the next)

also:
how could I achieve indented comment out character#

In Sublime if code is indented, like:

If True:
    Print('indent')

commented out line looks like

If True:
    #Print('indent')

but in JL(codemirror) I always see:
commented out line looks like

If True:
#     Print('indent')

which makes code a lot less transparent

thank you for the time and effort

@ryantam626
Copy link
Owner

Moving line up and down beyond cell limit is not that trivial to implement correctly, I don't really have time these days to work on this sadly 😞

But the other issue you flagged is easily solved though! I have published a new version (0.3.2) which should have the correct behavior now.

@LukaPitamic
Copy link
Author

@ryantam626 just to be sure we understand each other:

  • moving line beyond the cell is what I DON'T want but I see it happening in up direction
  • are you referring with new version(0.3.2) moving line direction down error beep or comment out indent?

Appreciate your time, thank you

@ryantam626
Copy link
Owner

0.3.2 fixes the indent issue.

Moving line beyond the cell should not be possible, what key are you pressing to do that?

@LukaPitamic
Copy link
Author

  • I diagnosed my problem:
    for moving lines up/down - I'm using:
    CMD + CTRL + UP/DWON_ARROW on MacOS
    I just realised now it's the issue of JupyterLab (I'm using 2.1.4.) causing error sound when pressing key combination CMD + CTRL + DOWN_ARROW - not your extension.
  • I tested commenting out indented line on v0.3.2: as you said - it works perfectly!

Another question, is there a way to switch CMD, CTRL, ALT to control behaviour? I noticed Sublime acts differently depending on underlying OS(Linux, MacOS). You probably adapted keybindings from Linux right?

In any way, really super awesome extension, I see now I won't be able to live without it. Thank you for the contribution.

@ryantam626
Copy link
Owner

Ah interesting. Here is a link to codemirror's sublime keybindings https://codemirror.net/keymap/sublime.js, according to this CMD + CTRL + UP/DOWN_ARROW should have worked, since it's the default keybindings (and this plugin simple activates the sublime mode for you in codemirror + dealing with some keybind collision with jupyterlab), it really should have worked.

Since it doesn't work, I have two theories,

  1. It picked up the MacOS keybinds and there is a collision with CMD + CTRL + UP/DOWN_ARROW, rendering that combo useless / do some other unknown action.
  2. It didn't pick up the MacOS keybinds, in which case, CTRL/CMD + SHIFT + UP/DOWN_ARROW might work

Because I don't have a Mac, I can't really test things out myself, if you want you can fork this repo and altering the behaviour of this plugin, the plugin actually doesn't do that much and a fair bit of the groundwork has been done 😉

@LukaPitamic
Copy link
Author

LukaPitamic commented Jun 15, 2020

wonderful, thank you very much for the guide

keep on rockn'
_\../

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants