Home Download Buy Blog Forum Support

Transforming Multiple Selections into Lines

Transforming Multiple Selections into Lines

Postby RickyS on Tue Nov 05, 2013 1:08 pm

Informal docs say:
Ctrl + L expands the selections to the end of the line. Ctrl + Shift + L splits the selections into lines.


On my 64-bit Ubuntu system, ST3/3054, Ctrl+L expands the selection to the whole line, and Ctrl+Shift+L doesn't appear to do anything. :o

The doc page is:
http://docs.sublimetext.info/en/latest/editing/editing.html#transforming-multiple-selections-into-lines
RickyS
 
Posts: 19
Joined: Mon Jul 08, 2013 6:51 pm

Re: Transforming Multiple Selections into Lines

Postby adzenith on Tue Nov 05, 2013 6:42 pm

ctrl+shift+l turns one multiline selection into multiple one-line selections. What are you expecting it to do?
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Transforming Multiple Selections into Lines

Postby RickyS on Wed Nov 06, 2013 4:24 pm

When I select a block of 5 lines and type ctrl shift L, nothing appears to change. It looks the same. So I type one letter and all 5 lines are replaced by the 1 letter. If it were really a series of multiple selections then the number of lines would not have reduced to 1.
RickyS
 
Posts: 19
Joined: Mon Jul 08, 2013 6:51 pm

Re: Transforming Multiple Selections into Lines

Postby Vanishing on Thu Nov 07, 2013 4:40 pm

Open up console, type:
sublime.log_commands(True)

keep console open, select the block of lines, and ctrl+shift+l, paste the output from console.
Vanishing
 
Posts: 23
Joined: Fri Oct 18, 2013 2:58 pm

Re: Transforming Multiple Selections into Lines

Postby RickyS on Thu Nov 07, 2013 11:21 pm

>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 63.5, "y": 268.5}}

(Everything after this was my attempt to copy for pasting. Doing the select first, then setting log_commands to True, then ctr+shift+l results in nothing being logged at all).

List bound keys shows:
Code: Select all
|ctrl+a                   |select_all               |                         |                                                  |
|ctrl+shift+l             |split_selection_into_lin…|                         |                                                  |
|escape                   |single_selection         |                         |                                                  |

So I'm puzzled.
RickyS
 
Posts: 19
Joined: Mon Jul 08, 2013 6:51 pm

Re: Transforming Multiple Selections into Lines

Postby bizoo on Fri Nov 08, 2013 7:33 am

Don't use mouse to select the text.

Try:
-Open the console
-Type sublime.log_commands(True)
-Clic somewhere on the file to put the cursor (focus).
-Hit shift-down 2 times to extand selection
-Hit ctrl+shift+l

The result in the console must be something like:
Code: Select all
>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 314.5, "y": 409.5}}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: split_selection_into_lines
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Transforming Multiple Selections into Lines

Postby RickyS on Fri Nov 08, 2013 11:25 am

>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 53.5, "y": 261.5}}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}

===
Again, showing the line after, which is from ctrl+backquote:

>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 53.5, "y": 145.5}}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: show_panel {"panel": "console", "toggle": true}

===
I tried again, thinking maybe I'd got it all wrong, maybe the command is control-shift-eye, not control-shift-ell, but no, it's ell, the letter after kay.

By the way, is there a way I can enter into the console: split_selection_into_lines ?

Also, thanks for all your effort so far...
RickyS
RickyS
 
Posts: 19
Joined: Mon Jul 08, 2013 6:51 pm

Re: Transforming Multiple Selections into Lines

Postby jbjornson on Fri Nov 08, 2013 12:09 pm

Code: Select all
sublime.active_window().active_view().run_command("split_selection_into_lines")
jbjornson
 
Posts: 350
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Transforming Multiple Selections into Lines

Postby RickyS on Fri Nov 08, 2013 1:18 pm

command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: drag_select {"event": {"button": 1, "x": 206.5, "y": 707.5}}
>>> sublime.active_window().active_view().run_command("split_selection_into_lines")
command: drag_select {"event": {"button": 1, "x": 56.5, "y": 268.5}}


I can see a visual change when I enter the command. This is different from the result of entering ctrl+shift+l.
But when I move the mouse focus back to the pre-selected lines, everything gets de-selected so I don't get any useful result.

Ah! I move the focus back by re-entering ctrl+backquote and then enter the letter a. Each of the three selected lines got changed into a single letter a.
Proving the lines were selected as multiple selections:

>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 57.5, "y": 269.5}}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: move {"by": "lines", "extend": true, "forward": true}
command: show_panel {"panel": "console", "toggle": true}
>>> sublime.active_window().active_view().run_command("split_selection_into_lines")
command: show_panel {"panel": "console", "toggle": true}
command: hide_auto_complete
Writing file /home/ricky/addtopathOld.sh with encoding UTF-8 (atomic)


Is there a way I can fix my (apparently) broken key-map? or maybe write a macro to implement this? Or should I just file a bug somewhere?
RickyS
 
Posts: 19
Joined: Mon Jul 08, 2013 6:51 pm

Re: Transforming Multiple Selections into Lines

Postby bizoo on Fri Nov 08, 2013 1:21 pm

Try to log inputs with:
Code: Select all
>>> sublime.log_input(True)
key evt: control+alt+l

Maybe this keybinding is trapped by OS or something else.
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Next

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 26 guests