Pane move down (ie without splitting)


#1

At the moment the split command opens up (as expected) two tabs (as the screenshot below shows).

What I would like is for a ‘move’ command where the current editor is opened in the respective new split (up,down, left or right) and removed from the previous location (in effect moving it)

Is there a way to do it?

If not, could somebody point to the location in the atom code that creates the split (sorry still new in Atom development)

I believe this question is similar to this one:


#2

This sounds like a duplicate of the original topic. Typically, we just reply to the original topic so as to keep the all of the discussion focused in one place … so people don’t have to read 15 topics to find out what all has been said :grinning: I’ll close the original though in this case because of the pretty picture :laughing:

Any time you want to find the code behind a particular command, here is how you can do it:

  1. Find the name of the command
    • If all you have is a keybinding, look in the Settings View under Keybindings (see image below)
    • If you have the name of a command in the command palette, here’s how you convert the command palette name to the command name:
      1. Lowercase it
      2. Remove the space after the colon
      3. Convert all other spaces to hyphens
  2. Search for the name of the command in the appropriate repository. If you used the keybinding to find the command, the Keybinding View showed you which package the command came from (“Core” means atom/atom most of the time).
  3. Find where the command is mapped to some code
  4. Follow the code from there

One thing to keep in mind is that when you create a new command that works like you want, there is one edge case you’ll need to figure out how you want to handle. What if the editor view you want to move is the only one open? Does it duplicate the window in that case? Does it still move it, leaving an empty pane behind?

I also edited your post to create a Onebox of the link to the original topic. See my post here for how Oneboxing works:


#3

Thanks, and I will use the OneBoxing next (I’m also new to discourse)

So I followed the code and this is where the pane is split

(Wow, oneboxing is great :slight_smile: :sunny: )

Next I just need to figure out how to to close the current window (taking into account the edge case you mentioned)

Another question: What is the recommended way to show the user a ‘warning message’? For example in this case: ‘Could not move window since it is the only one available’

(practically speaking the best way would be to detect that case and not even have that command available, but I still would like to know how to ‘communicate’ with the user in the ‘Atom Editor way’ :slight_smile: )


#4

Funny you should ask that, since I just created this pull request last night:

You can find out more about the notifications system at: