Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 autotext
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 15 2006 :  03:37:36 AM  Show Profile  Reply with Quote
Would it be possible to get an autotext suggestion like '///' that fills up to column indicator when defined in options?
E.g. something like:
"/*$repeat_char/"
which would result in:
/***<snip>***/|
or
//$repeat_char/
which would result in:
///<snip>///|

-bugfix

http://www.mf-sd.de

Edited by - bugfix on Jan 15 2006 03:41:42 AM

support
Whole Tomato Software

5566 Posts

Posted - Jan 15 2006 :  09:32:25 AM  Show Profile  Reply with Quote
You can make an Autotext entry that expands /// to a fixed numbers of slashes, but you cannot make an extry that expands from the current position to the column indicator.

Certainly an interesting idea.
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 15 2006 :  10:12:18 AM  Show Profile  Reply with Quote
I'm already using that option but it happens more than once a day that I have to adjust the inserted autotext and that that's why I've came up w/ that idea.

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19001 Posts

Posted - Jan 15 2006 :  3:45:52 PM  Show Profile  Reply with Quote
out of interest, what are you doing that leads to this need? i have seen plugins for VIM that allow you to produce a comment mode "box" around a block of text, but i have never used them myself. are you doing something like this? or something totally different?

zen is the art of being at one with the two'ness
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 16 2006 :  01:37:26 AM  Show Profile  Reply with Quote
I follow a very strict "< 80" chars per line rule, so when I have something like code below I always have to adjust the nested comments inserted autotext.


//////////////////////////////////////|
// some doc                           |
//////////////////////////////////////|
struct blub                           |
{                                     |
    //////////////////////////////////|
    // some doc                       |
    //////////////////////////////////|
    void blubber()                    |
    {                                 |
    }                                 |
};                                    |


http://www.mf-sd.de
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jan 16 2006 :  10:51:22 AM  Show Profile  Reply with Quote
What you really need is something to adjust the lengths of your ///// lines as you change indent levels.
Go to Top of Page

ether
Tomato Guru

USA
130 Posts

Posted - Jan 16 2006 :  12:03:37 PM  Show Profile  Reply with Quote
Make a Visual Studio macro and assign it a shortcut. You can easily fill a line from the current position to a specified column number in VB script. You can also make it prompt you for the text to fill in where your "some doc" is in your example. Give it a try.
Go to Top of Page

ether
Tomato Guru

USA
130 Posts

Posted - Jan 16 2006 :  1:06:05 PM  Show Profile  Reply with Quote
I decided to code what I described above to give you some ideas.


sub TestStuff()
'DESCRIPTION: This is a test macro
	Dim nCol
	Dim i

	nCol = ActiveDocument.Selection.CurrentColumn
	for i = nCol to 79
		ActiveDocument.Selection = "/"
	next
	ActiveDocument.Selection = vbCrLf
	ActiveDocument.Selection.MoveTo ActiveDocument.Selection.CurrentLine, nCol, dsMove
	ActiveDocument.Selection = "//" + vbTab + InputBox("Enter Some text") + vbCrLf
	ActiveDocument.Selection.MoveTo ActiveDocument.Selection.CurrentLine, nCol, dsMove
	for i = nCol to 79
		ActiveDocument.Selection = "/"
	next
end sub

You put this in a .DSM file and load it into Visual Studio. The code above works for VS 6 and may need to be adjusted for VS.NET.

Edited by - ether on Jan 16 2006 1:06:33 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19001 Posts

Posted - Jan 16 2006 :  2:43:56 PM  Show Profile  Reply with Quote
interesting. looking into the IDE's macro language has been on my "things to do" list for years now

i tried this in VS2003 and some of the code is accepted, but the primary problem is that:

ActiveDocument.Selection

is readonly, more specifically "Selection" is readonly, so none of the assignment operations work. so this will take a bit of work to make work in VS2003, but hopefully not to much.

zen is the art of being at one with the two'ness
Go to Top of Page

ether
Tomato Guru

USA
130 Posts

Posted - Jan 16 2006 :  2:57:28 PM  Show Profile  Reply with Quote
Yeah, I knew there would be some issues, but since I'm at work and I don't have VS.NET here, I couldn't look at how I got my other macros to work in it. At home I have VS.NET 2003 installed and ported my VS 6 macros over to it. I remember hitting a lot of little things like that, but it can be done.

I think you have to specifically call through ActiveDocument.Selection.Text in order to do it, but again, without VS.NET in front of me, I cannot be sure.
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 16 2006 :  4:46:51 PM  Show Profile  Reply with Quote
Nice idea!
Here is a version that works in vs2003 it even reads VAX column indicator setting from registry:)


Imports Microsoft.Win32
Sub VAXCommentAssist()
    Dim HKCU As RegistryKey = Registry.CurrentUser
    Dim keyValue As String = "Software\\Whole Tomato\\Visual Assist X\\VANet"

    Dim regKey As RegistryKey = HKCU.OpenSubKey(keyValue, False)
    Dim colIndicatorCol As Integer = 0
    If (Not regKey Is Nothing) Then
        colIndicatorCol = regKey.GetValue("ColumnIndicatorColumn", 0)
        regKey.Close()
    End If

    Dim texSel As TextSelection = ActiveDocument.Selection
    With texSel
        Dim i As Integer
        For i = .CurrentColumn To colIndicatorCol
            .Text += "/"
        Next
    End With
    texSel.NewLine()
End Sub

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19001 Posts

Posted - Jan 17 2006 :  3:22:19 PM  Show Profile  Reply with Quote
cool

rather usefully this also works perfectly in VS2005 professional as well. having seen this idea i suspect i will find a use for it in my own code

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000