Windows Vista Forums

Prevent TabExpansion to delete chars after cursor position
  1. #1


    flashdrvnk Guest

    Prevent TabExpansion to delete chars after cursor position

    Hello,

    I was kind of surprised to see Powershell still completes filenames and
    discards everything what was typed after the current cursor position.

    Scenario:

    You type: `gvim apps\server\tcpserver.rb` and get "gvim not recognized..."
    because you just upgraded to vim 7 and didn't adjust your %PATH%

    You type: ArrowUp, Home, delete gvim and want to tabcompletet to your gvim.exe
    Once you pressed TAB your filename is gone.


    Attempt:



    Since RC1 you are able to gc the functions and redefine them, so I thought
    about making my own TabExpansion.
    I failed, since $line referrs NOT to the whole line but to the part of the
    line until the cursor position.


    Question:

    Is there a way to change the behaviour, so that you keep the rest of the
    line after completion?
    If not, is it on the todo list?
    I know there are other users, which demand the same feature.


    Thanks for reading.
    Robert Retzbach

      My System SpecsSystem Spec

  2. #2


    /\\/\\o\\/\\/ Guest

    Re: Prevent TabExpansion to delete chars after cursor position

    this was already answered by Bruce in a former thread.

    > Agreed. Unfortunately this is not somethat that the end-user can fix with a
    > function. It'll have to be post 1.0 thing...
    >
    > -- Bruce Payette [MSFT] Windows PowerShell Technical Lead Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights.


    as I was the one that recommended Robert posting this here (on IRC) ,
    sorry, I forgot

    as CMD.exe does the same (only you notice it much less there)
    I guess this is a difficult problem .

    but its good that it is named again as it would very much improve the
    usability of tab expansion.

    b.t.w. as a workaround you can sometimes get some text back by using the
    right arrow if it was the last line.

    I also made my first addition to the standard command completion, I
    added tab expansion support for types, so you can do :

    [dateTime]:: [tab]
    [datetime]::Compare(

    [consolecolor]::B [tab]
    [consolecolor]::Black [tab]

    you can find it here :

    http://mow001.blogspot.com/2006/05/p...ompletion.html

    gr /\/\o\/\/

    flashdrvnk wrote:
    > Hello,
    >
    > I was kind of surprised to see Powershell still completes filenames and
    > discards everything what was typed after the current cursor position.
    >
    > Scenario:
    >
    > You type: `gvim apps\server\tcpserver.rb` and get "gvim not recognized..."
    > because you just upgraded to vim 7 and didn't adjust your %PATH%
    >
    > You type: ArrowUp, Home, delete gvim and want to tabcompletet to your gvim.exe
    > Once you pressed TAB your filename is gone.
    >
    >
    > Attempt:
    >
    > Since RC1 you are able to gc the functions and redefine them, so I thought
    > about making my own TabExpansion.
    > I failed, since $line referrs NOT to the whole line but to the part of the
    > line until the cursor position.
    >
    >
    > Question:
    >
    > Is there a way to change the behaviour, so that you keep the rest of the
    > line after completion?
    > If not, is it on the todo list?
    > I know there are other users, which demand the same feature.
    >
    >
    > Thanks for reading.
    > Robert Retzbach


      My System SpecsSystem Spec

Prevent TabExpansion to delete chars after cursor position problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
tabexpansion... Michael Soza PowerShell 0 26 Mar 2010
Word 7 will not open at last saved cursor position Diane113 Microsoft Office 0 01 Feb 2010
Prevent folder move and delete in 2003 Server cjg.groups Server General 2 29 Oct 2009
controlling cursor position or other way to control placement of output to screen James PowerShell 0 31 Mar 2009
crazy cursor - cursor keeps bouncing back form certain clickable a jordanly Vista performance & maintenance 0 10 May 2008