andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 39 forks source link

Point to the current folder when pressing CTRL+O #367

Closed dglent closed 8 years ago

dglent commented 8 years ago

According the manual: "Open file The open file dialog begins in the directory where current file located. If you want to open a file from some other directory, it's usually quicker to select a file from the opened file list which resides in the same directory, then press Ctrl+O or Ctrl+L. "

But when i click on a file in the opened files list, and i press ctrl+o the file dialogue points to the folder of the previous file and not the current.

dglent commented 8 years ago

It works as expected with this:

udiff --- workspace_actions.py 2015-12-21 06:38:11.760604097 +0100 +++ /usr/lib/python2.7/site-packages/enki/plugins/workspace_actions.py 2015-12-21 06:33:11.198969368 +0100 @@ -88,8 +88,10 @@ def _onFileOpenTriggered(self): """Handler of File->Open """

andreikop commented 8 years ago

Hi, @dglent!

This functionality was broken when adding fuzzy open functionality. I rolled back some changes, it seems like it is convenient to use current file path as current path.

dglent commented 8 years ago

Thanks hlamer, just for info (i have not applied any changes yet): I have remarked a different behavior between windows and linux. Under linux, i could n't point to the current folder in any case (after opening a file with ctrl+O or after selecting a file from the browser view). On windows it works as expected only when choosing a file from the browser view. It doesn't point to the current folder if i choose a file by ctrl+o. *I don't have two computers at the same time, i'd like to test again when i will be with windows but i am 90% sure that it was as i described.

dglent commented 8 years ago

It hasn't the same behaviour as the code in my previous comment (needs an exception in case of empty mainwindow)

andreikop commented 8 years ago

Hmm. Could you write step-by-step instructions on Enki tree. What you do, what you see

dglent commented 8 years ago

The steps are the following:

1) I have applied the https://github.com/hlamer/enki/commit/5931564df1adee7e1ade80f5841a669c14679229 2) I press ctrl+o and it points to the folder of the current file (~/Scripts) 3) I choose a file from the ctrl+o dialogue, from another folder (~/bin) 4) I press ctrl+o and the file dialogue points to the folder of the current file (~/bin) 5) I clic on another file from another folder (~/Scripts) from the list in the Opened Files 6) I press ctrl+o and it doesn't point to the current folder (~/Scripts) but in the previous (~/bin)

andreikop commented 8 years ago

Hmm. Probably our Qt versions differ. Could you test the bug on the latest master?

dglent commented 8 years ago

I applied the above commit (+ the https://github.com/hlamer/enki/commit/5931564df1adee7e1ade80f5841a669c14679229) and it is ok now. I have python-qt4-4.11.3

andreikop commented 8 years ago

With pyqt4 the <, _> gives this:

But why don't you migrate to pyqt5?

dglent commented 8 years ago

I was waiting the porting to python3 and pyqt5 in a next version What is the current state ?

andreikop commented 8 years ago

I use current master for my everyday work and don't see any regressions. But it's too early to release it officially.

dglent commented 8 years ago

Ok then, i will make a package of the the current master, so i use and test the latest version every time.