#415 open selected with relative path

release
open
nobody
Program (402)
5
2004-09-08
2004-09-08
Anonymous
No

Using solaris, prebuilt executable on version nedit 5.5rc2.

Highlight a filename in an xterm with a relative path
and use open selected. Works fine, the first time.
But for a subsiquent 'open selected' it starts with the
path of the previous file.

Example. Start nedit in '.'. Open file ../somefile1.
Fine. Now open file ../somefile2. It looks for
somefile2 at ../../somefile2 reative to where I started
nedit.

Thanks,
Joe
jeglennn@lycos.com

Discussion

  • Tony Balinski

    Tony Balinski - 2004-09-08

    Logged In: YES
    user_id=618141

    Very true: although shells are executed in the directory of
    the current document (*very* useful), file read and write
    operations in macro, and open-selected operations, are
    performed relative to the execution directory of NEdit
    itself. This has always struck me as very surprising. I
    tried looking for a simple way to fix this, but it seems the
    file path building routines are dead-set on using getcwd()
    rather than a variable "relative-to" path string. (It also
    assumes that the partial path dir1/../dir2 is equivalent to
    dir2 - this is not always the case where symlinks are used.)

    Where this really gets annoying is in a scenario like the
    following:
    1) Open a file in a directory other than NEdit's execution
    directory
    2) Create a new document from the window/tab for that file
    (which uses the same directory as the file - a great feature)
    3) Execute "ls" in that new document using Ctrl-KPEnter -
    the directory of the file is listed
    4) Select one of the file names in that list (other than the
    original file's) and hit Ctrl-Y to open it. This operation
    will *fail* to open the expected file (the one on the
    original file's directory).

    Such behaviour is counterintuitive, flouting the principle
    of least surprise. The operation should just work - it doesn't.

     
  • Scott Tringali

    Scott Tringali - 2004-09-08
    • milestone: 103147 --> release
     
  • Scott Tringali

    Scott Tringali - 2004-09-08

    Logged In: YES
    user_id=11321

    I agree- the cwd of nedit meaningless here. I've always
    thought that this operation should be done relative the file
    itself.

    There are probably other operations that should follow suit
    here, but this would be a good start.

     

Log in to post a comment.