SQL Prompt Breaks Block Indenting / Keep Tabs

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

SQL Prompt Breaks Block Indenting / Keep Tabs

Postby njahncke » Wed Aug 21, 2013 9:37 pm

Hey there everyone,

I uncovered this problem originally using the latest version of SQL Prompt 5, but I'm using 6 right now and it is unchanged.

Windows 7 SP1

Management Studio (MS): 11.0.2100.60
MS is configured for Block Indenting (as you may have inferred) with its Tab and Indent sizes set to 4. MS is also configured to keep tabs.

SQL Prompt: 6.0.0.402
SQL Prompt's "Tabs & Wrapping" behavior is set to only use tabs, which are also set to 4 spaces.


The problem itself is best demonstrated by example...

• Configure your system as described above and then enter the following code, using whatever table you have handy:

Code: Select all
SELECT
   *
FROM
   [dsr].[Audit] AS A
WHERE
   [A].[Activity] = 'Update'

• With your cursor at the end of 'Update' on Line 6, press <Enter>. If your system is properly configured for this experiment, your cursor should now be sitting on the next line (7), indented one tab. Verify that Block Indenting is currently working by pressing your left arrow key. The cursor will skip left one full tab. This is the desired behavior.

• Press the backspace key to return your cursor to the end of Line 6, and then press <Enter> once more. Your cursor will again be on Line 7, indented one tab.

• Type AND. If your suggestion window displays, press <Enter> to insert AND into your code. If not, do not press <Enter>. Your code should now look like this (with your cursor at the end of the AND on Line 7):

Code: Select all
SELECT
   *
FROM
   [dbo].[Audit] AS A
WHERE
   [A].[Action] = 'Update'
   AND

• Press <Enter>. If you are suffering from the same problem as myself, you will see your cursor drop to Line 8, but it will not be indented as it should be. If you then press your right arrow key, you will see that SQL Prompt has inserted four spaces instead of a tab, completely breaking the expected Block Indenting / Keep Tabs behavior.

• Note that disabling SQL Prompt code suggestions fixes this issue.


Is anyone familiar with this issue? I took pains to try and find reference to something similar in the forum, but was unable.

This is a truly frustrating issue, as it requires numerous superfluous key presses with almost every new line of code.

Thank you in advance for any help you can provide.

(I freakin love Tab History btw; thanks for adding it!)
njahncke
 
Posts: 16
Joined: Tue Jun 16, 2009 3:13 pm

Postby Aaron Law » Thu Aug 22, 2013 10:00 am

Thanks for the detailed reproduction steps! I can recreate this on my machine and will look into a fix.

I'm glad to hear you're enjoying the tab history :)
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Aaron Law » Thu Aug 22, 2013 3:19 pm

This should now be fixed in 6.0.0.412.
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby njahncke » Thu Aug 22, 2013 11:47 pm

Fantastic; thanks a lot, Aaron. Do you know when the next EAP release is scheduled for?
njahncke
 
Posts: 16
Joined: Tue Jun 16, 2009 3:13 pm

Postby Aaron Law » Fri Aug 23, 2013 11:18 am

This should build be up already, you can get it from the check for updates within prompt or download from http://download.red-gate.com/EAP/SQLPro ... Prompt.zip
Aaron Law
 
Posts: 261
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby njahncke » Sun Aug 25, 2013 12:07 am

Awesome; works like a charm. Thanks a lot for the quick turn-around on this. I'll be sure to keep my eyes open for any other weirdness.
njahncke
 
Posts: 16
Joined: Tue Jun 16, 2009 3:13 pm


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 0 guests