Home Download Buy Blog Forum Support

Tab completion weirdness

Tab completion weirdness

Postby ninjaroll on Fri May 25, 2012 6:25 pm

Hi everyone,
I'm experiencing a weird bug when using tab completion, but only after another tab completion. It's a bit hard to explain so I recorded a short video of what I'm referring to: http://smg.photobucket.com/albums/v146/ ... etion2.mp4

In the video, you can see that after the first div, I hit return, press "p" and hit tab again. The behavior I'm expecting is that it would give me <p></p>, but instead, the cursor jumps to the closing div tag.

Is there a fix to this? Thanks!
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby C0D312 on Fri May 25, 2012 7:11 pm

C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Tab completion weirdness

Postby ninjaroll on Fri May 25, 2012 8:29 pm

Thanks, but that didn't quite work just like that guy said. In my example, I get an actual tab space after where I type "test" instead of the cursor moving in between the two div tags.
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby C0D312 on Fri May 25, 2012 9:03 pm

Okay. Nevermind. Don't do that. If you look at the statusbar, it should say field 1/2 . Tabbing to the next field takes precedence, so pressing esc while take you out of the fields. If you want to stay in the fields and let tab go to the next location, use control+space instead for completion. I assumed that you could change it so if tab has an exact match, complete it, otherwise go to next field. I'll look into it though.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Tab completion weirdness

Postby ninjaroll on Fri May 25, 2012 10:02 pm

Thanks for the quick response! I'm wondering if there's a way to say "if Return key pressed, escape out of field"
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby ninjaroll on Fri May 25, 2012 10:11 pm

Ok, I'm getting closer (I think). I added this to my User Key Binding and this command will escape out of the field order, however, I need to hit Enter twice.. once to escape, and another time to actually do a Return break

Code: Select all
   { "keys": ["enter"], "command": "clear_fields", "context":
      [
         { "key": "has_next_field", "operator": "equal", "operand": true }
      ]
   },
   { "keys": ["enter"], "command": "clear_fields", "context":
      [
         { "key": "has_prev_field", "operator": "equal", "operand": true }
      ]
   }
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby ninjaroll on Sun May 27, 2012 5:05 am

Does anyone know of a way to combine canceling out of the field order and return break in one swoop?
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby xeno.by on Sun May 27, 2012 7:35 am

A custom command that does run_command("command1") and then run_command("command2")?
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: Tab completion weirdness

Postby ninjaroll on Mon May 28, 2012 7:00 pm

xeno.by wrote:A custom command that does run_command("command1") and then run_command("command2")?


That sounds like it would work, but unfortunately this might be a little over my head. I'm very new to ST2, and don't know perl. I've read thru the legacy official docs, along with the unofficial docs, and still don't know where to start. Can someone shed some light on how I would do this?
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Tab completion weirdness

Postby C0D312 on Mon May 28, 2012 7:14 pm

First of all, Sublime Text uses Python, not perl for its plugins. second, you'll be better off just making a macro. http://docs.sublimetext.info/en/latest/ ... acros.html
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Next

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 26 guests