Author | Topic: "Inteligent indent" | |
---|---|---|
João Pedro Machado de Sousa | "Inteligent indent" on Tue, 30 Dec 2003 17:20:08 +0000 Hi All Hope you had a merry xmas and that you'll have a great new year. Basicaly, my question is: Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? If it does how can I configure it? (If it doesn't when will it?) Very Best Regards João Pedro Machado de Sousa | |
Andreas Herdt | Re: "Inteligent indent" on Wed, 31 Dec 2003 11:42:20 +0100 João Pedro Machado de Sousa wrote: > Hi All > > Hope you had a merry xmas and that you'll have a great new year. > > Basicaly, my question is: > > Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? > > If it does how can I configure it? > > (If it doesn't when will it?) > > Very Best Regards > > João Pedro Machado de Sousa Menu->Tools->Editor Options Tab: IntelliCode Checkmark: Smart tab I'm not shure if this is what you need. Give it a try. Best Regards and Happy new Year Andreas Herdt [Alaska Research & Development] | |
Joe Carrick | Re: "Inteligent indent" on Wed, 31 Dec 2003 08:52:38 -0800 Hi Andreas, I find that my source code which was created with MultiEdit32 gets indents that are much to wide using VX. I have used the Block "UnIndent" and "Indent" facility to reformat a couple of prg's but that is very tedious. I simply don't have the time to spend 100's of hours reformating my code. So, my question is this - can a facility be added to strip all leading spaces/tabs and then "Intelligently indent" the entire source file? This would be really handy. I could write it myself as a Tool (a lot of work but not impossible), but it would be great if it was incorporated directly into the Editor. -Joe "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message news:fyqJEw4zDHA.1976@S15147418... > Joo Pedro Machado de Sousa wrote: > > Hi All > > > > Hope you had a merry xmas and that you'll have a great new year. > > > > Basicaly, my question is: > > > > Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? > > > > If it does how can I configure it? > > > > (If it doesn't when will it?) > > > > Very Best Regards > > > > Joo Pedro Machado de Sousa > > Menu->Tools->Editor Options > Tab: IntelliCode > Checkmark: Smart tab > > I'm not shure if this is what you need. > Give it a try. > > Best Regards and Happy new Year > > Andreas Herdt > [Alaska Research & Development] > | |
James Loughner | Re: "Inteligent indent" on Wed, 31 Dec 2003 12:55:02 -0500 Mark the text and use shift-tab to move it left. This should get ride of any indents. Jim Joe Carrick wrote: > Hi Andreas, > > I find that my source code which was created with MultiEdit32 gets indents > that are much to wide using VX. I have used the Block "UnIndent" and > "Indent" facility to reformat a couple of prg's but that is very tedious. I > simply don't have the time to spend 100's of hours reformating my code. > > So, my question is this - can a facility be added to strip all leading > spaces/tabs and then "Intelligently indent" the entire source file? This > would be really handy. I could write it myself as a Tool (a lot of work but > not impossible), but it would be great if it was incorporated directly into > the Editor. > > -Joe > "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message > news:fyqJEw4zDHA.1976@S15147418... > >>João Pedro Machado de Sousa wrote: >> >>>Hi All >>> >>>Hope you had a merry xmas and that you'll have a great new year. >>> >>>Basicaly, my question is: >>> >>>Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? >>> >>>If it does how can I configure it? >>> >>>(If it doesn't when will it?) >>> >>>Very Best Regards >>> >>>João Pedro Machado de Sousa >> >>Menu->Tools->Editor Options >>Tab: IntelliCode >>Checkmark: Smart tab >> >>I'm not shure if this is what you need. >>Give it a try. >> >>Best Regards and Happy new Year >> >> Andreas Herdt >> [Alaska Research & Development] >> > > > | |
Joe Carrick | Re: "Inteligent indent" on Wed, 31 Dec 2003 10:19:31 -0800 I understand marking and "Shift Tab" to get rid of the indents. What I want is the ability to "autoIndent" the entire source afterward in one step. ie: **************************************************************************** **** * FUNCTION HandleKeys() **************************************************************************** **** FUNCTION HandleKeys(nKey) LOCAL oDlg := setAppWindow() LOCAL aPos := oDlg:currentPos() LOCAL nX := 0 LOCAL nY := 0 IF nKey==xbeK_UP nY := +1 ELSEIF nKey==xbeK_DOWN nY := -1 ELSEIF nKey==xbeK_RIGHT nX := +1 ELSEIF nKey==xbeK_LEFT nX := -1 ELSEIF nKey==xbeK_SH_UP nY := +5 ELSEIF nKey==xbeK_SH_DOWN nY := -5 ELSEIF nKey==xbeK_SH_RIGHT nX := +5 ELSEIF nKey==xbeK_SH_LEFT nX := -5 ELSEIF nKey==xbeK_CTRL_UP nY := +10 ELSEIF nKey==xbeK_CTRL_DOWN nY := -10 ELSEIF nKey==xbeK_CTRL_RIGHT nX := +10 ELSEIF nKey==xbeK_CTRL_LEFT nX := -10 ENDIF IF nX<>0 .OR. nY<>0 oDlg:setPos({aPos[1]+nX,aPos[2]+nY}) ENDIF RETURN NIL should become: **************************************************************************** **** * FUNCTION HandleKeys() **************************************************************************** **** FUNCTION HandleKeys(nKey) LOCAL oDlg := setAppWindow() LOCAL aPos := oDlg:currentPos() LOCAL nX := 0 LOCAL nY := 0 IF nKey==xbeK_UP nY := +1 ELSEIF nKey==xbeK_DOWN nY := -1 ELSEIF nKey==xbeK_RIGHT nX := +1 ELSEIF nKey==xbeK_LEFT nX := -1 ELSEIF nKey==xbeK_SH_UP nY := +5 ELSEIF nKey==xbeK_SH_DOWN nY := -5 ELSEIF nKey==xbeK_SH_RIGHT nX := +5 ELSEIF nKey==xbeK_SH_LEFT nX := -5 ELSEIF nKey==xbeK_CTRL_UP nY := +10 ELSEIF nKey==xbeK_CTRL_DOWN nY := -10 ELSEIF nKey==xbeK_CTRL_RIGHT nX := +10 ELSEIF nKey==xbeK_CTRL_LEFT nX := -10 ENDIF IF nX<>0 .OR. nY<>0 oDlg:setPos({aPos[1]+nX,aPos[2]+nY}) ENDIF RETURN NIL I realize this is a simple example, but when there's a lot of indentation ( if/elseif/els/endif, do while, for/next ) and hundreds or thousands of lines of code, "Intelligent (Re)Indent" of the entire source file in one step would be a big help. -Joe "James Loughner" <jwrl@charter.net> wrote in message news:SJK60d8zDHA.1976@S15147418... Mark the text and use shift-tab to move it left. This should get ride of any indents. Jim Joe Carrick wrote: > Hi Andreas, > > I find that my source code which was created with MultiEdit32 gets indents > that are much to wide using VX. I have used the Block "UnIndent" and > "Indent" facility to reformat a couple of prg's but that is very tedious. I > simply don't have the time to spend 100's of hours reformating my code. > > So, my question is this - can a facility be added to strip all leading > spaces/tabs and then "Intelligently indent" the entire source file? This > would be really handy. I could write it myself as a Tool (a lot of work but > not impossible), but it would be great if it was incorporated directly into > the Editor. > > -Joe > "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message > news:fyqJEw4zDHA.1976@S15147418... > >>Joo Pedro Machado de Sousa wrote: >> >>>Hi All >>> >>>Hope you had a merry xmas and that you'll have a great new year. >>> >>>Basicaly, my question is: >>> >>>Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? >>> >>>If it does how can I configure it? >>> >>>(If it doesn't when will it?) >>> >>>Very Best Regards >>> >>>Joo Pedro Machado de Sousa >> >>Menu->Tools->Editor Options >>Tab: IntelliCode >>Checkmark: Smart tab >> >>I'm not shure if this is what you need. >>Give it a try. >> >>Best Regards and Happy new Year >> >> Andreas Herdt >> [Alaska Research & Development] >> > > > | |
Andreas Herdt | Re: "Inteligent indent" on Wed, 31 Dec 2003 18:58:21 +0100 Joe Carrick wrote: > Hi Andreas, > > I find that my source code which was created with MultiEdit32 gets indents > that are much to wide using VX. I have used the Block "UnIndent" and > "Indent" facility to reformat a couple of prg's but that is very tedious. > I simply don't have the time to spend 100's of hours reformating my code. There is a bug in VX that is allready reported. When code was written with tabs and you have selected "use tab char" in editor options, then the tabs are transformed to 8 blanks. It should work like that: select "use tab chars". load the source code. Thats all. There should be no reason to reformat source code here. > So, my question is this - can a facility be added to strip all leading > spaces/tabs and then "Intelligently indent" the entire source file? This > would be really handy. I could write it myself as a Tool (a lot of work > but not impossible), but it would be great if it was incorporated directly > into the Editor. > > -Joe > "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message > news:fyqJEw4zDHA.1976@S15147418... >> João Pedro Machado de Sousa wrote: >> > Hi All >> > >> > Hope you had a merry xmas and that you'll have a great new year. >> > >> > Basicaly, my question is: >> > >> > Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? >> > >> > If it does how can I configure it? >> > >> > (If it doesn't when will it?) >> > >> > Very Best Regards >> > >> > João Pedro Machado de Sousa >> >> Menu->Tools->Editor Options >> Tab: IntelliCode >> Checkmark: Smart tab >> >> I'm not shure if this is what you need. >> Give it a try. >> >> Best Regards and Happy new Year >> >> Andreas Herdt >> [Alaska Research & Development] >> Regards Andreas Herdt ////////////////////////////////////////////////////////////////// // // Alaska Research & Development // Homepage: www.alaska-research.com // Newsgroup: nntp://news.alaska-Software.net // ////////////////////////////////////////////////////////////////// | |
Joe Carrick | Re: "Inteligent indent" on Wed, 31 Dec 2003 12:20:55 -0800 Hi Andreas, So as I understand it, the bug was that the default should have been: x "Use Tab Char" If a prg was saved after the tabs were converted to 8 spaces, will changing the setting cause the spaces to revert to tab characters? I would think that would be very difficult if there were a combination of tabs and spaces originally. For example: 3 tabs and 20 spaces (equivalent to 29space indentation) would be converted to 44 spaces but on reverting to tabs I would think this would become 5 tabs and 4 spaces (equivalent to 19 space indentation) -Joe "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message news:UAASH$8zDHA.1976@S15147418... > Joe Carrick wrote: > > > Hi Andreas, > > > > I find that my source code which was created with MultiEdit32 gets indents > > that are much to wide using VX. I have used the Block "UnIndent" and > > "Indent" facility to reformat a couple of prg's but that is very tedious. > > I simply don't have the time to spend 100's of hours reformating my code. > > There is a bug in VX that is allready reported. > When code was written with tabs and you have > selected "use tab char" in editor options, then > the tabs are transformed to 8 blanks. > > It should work like that: > select "use tab chars". > load the source code. > Thats all. > There should be no reason to reformat source code here. > > > > So, my question is this - can a facility be added to strip all leading > > spaces/tabs and then "Intelligently indent" the entire source file? This > > would be really handy. I could write it myself as a Tool (a lot of work > > but not impossible), but it would be great if it was incorporated directly > > into the Editor. > > > > -Joe > > "Andreas Herdt" <andreas.herdt@alaska-research.com> wrote in message > > news:fyqJEw4zDHA.1976@S15147418... > >> Joo Pedro Machado de Sousa wrote: > >> > Hi All > >> > > >> > Hope you had a merry xmas and that you'll have a great new year. > >> > > >> > Basicaly, my question is: > >> > > >> > Does VX do auto indent/unindent structures (IF, FOR, DO) like MEW? > >> > > >> > If it does how can I configure it? > >> > > >> > (If it doesn't when will it?) > >> > > >> > Very Best Regards > >> > > >> > Joo Pedro Machado de Sousa > >> > >> Menu->Tools->Editor Options > >> Tab: IntelliCode > >> Checkmark: Smart tab > >> > >> I'm not shure if this is what you need. > >> Give it a try. > >> > >> Best Regards and Happy new Year > >> > >> Andreas Herdt > >> [Alaska Research & Development] > >> > > -- > Regards > > > Andreas Herdt > > > ////////////////////////////////////////////////////////////////// > > Alaska Research & Development > Homepage: www.alaska-research.com > Newsgroup: nntp://news.alaska-Software.net > > ////////////////////////////////////////////////////////////////// | |
Phil Ide | Re: "Inteligent indent" on Mon, 05 Jan 2004 15:49:00 +0000 Joe, > I find that my source code which was created with MultiEdit32 gets indents > that are much to wide using VX. I have used the Block "UnIndent" and > "Indent" facility to reformat a couple of prg's but that is very tedious. I > simply don't have the time to spend 100's of hours reformating my code. I insist that any code (whichever language!) is properly indented (there are two other developers here, plus we get in some contractors on occasion - usually to do html/JScript/Perl work). Since everyone uses their own favourite editor, here is the rule I enforce: The editor must translate all TABS to 3 spaces Then when I load some code im my editor, it will indent correctly. More importantly, if someone else loads my code in their editor, any indents they add will look good when I load it back into my editor. The days when we had to keep file sizes to less than 64k are gone, and disk space is cheap. In Ed4W there is a script to reformat 'Clipper' code which takes care of naughty code. Regards, Phil Ide *************************************** * Xbase++ FAQ, Libraries and Sources: * * goto: http://www.idep.org.uk/xbase * *************************************** My favorite mythical creature? The honest politician. | |
João Pedro Machado de Sousa | Re: "Inteligent indent" on Thu, 01 Jan 2004 01:13:16 +0000 Hi Andreas A great 2004 for all out here !! > Menu->Tools->Editor Options > Tab: IntelliCode > Checkmark: Smart tab > > I'm not shure if this is what you need. > Give it a try. If it is, it doesn't work Anyone has managed it to work? Very Best Regards João Pedro Machado de Sousa | |
Andreas Herdt | Re: "Inteligent indent" on Fri, 02 Jan 2004 08:21:47 +0100 João Pedro Machado de Sousa wrote: > A great 2004 for all out here !! Same to you and to all others. To your problem: I'm very shure that smart tab work. So please, can you give an example what you expect how smart tab should work? Regards Andreas Herdt ////////////////////////////////////////////////////////////////// // // Alaska Research & Development // Homepage: www.alaska-research.com // Newsgroup: nntp://news.alaska-Software.net // ////////////////////////////////////////////////////////////////// | |
Andreas Herdt | Re: "Inteligent indent" on Fri, 02 Jan 2004 11:01:28 +0100 João Pedro Machado de Sousa wrote: > Hi Andreas > > A great 2004 for all out here !! > > >>Menu->Tools->Editor Options >>Tab: IntelliCode >>Checkmark: Smart tab >> >>I'm not shure if this is what you need. >>Give it a try. > > > If it is, it doesn't work Anyone has managed it to work? > > Very Best Regards > > João Pedro Machado de Sousa I just recognized that there is a related thread. Please refer to my posting in "Behaviour at start of line" in this newsgroup. Andreas Herdt [Alaska Research & development] |