When changing or opening a project directory do not
take the selected item from suggestion but simply the
entered text as it is.
Otherwise the user may be unable to choose a directory
if the text matches the beginning of suggestion.
Close#791
Attempt to fix issue #791.
The logic set with the previous commit for suggest_directory
is similar to the one we use except the previous expression
was false do to operator precedence for "and" versus "or".
With the modification here, when opening a project directory,
we suggest the recently used projects
if the text is equal to dirname(project_dir) + "/" which
happens to be the text the command view is initially set to.
In addition we do the same if text is "". If the condition is
not met we return the suggestions from common.dir_path_suggest to
match the text entered.
Works well on Linux but may not solve the problem on Windows, it
should be tested.
It wasn't fine to call core.open_doc without filename argument
and later call Doc:save without providing both the filename and
the absolute filename. It was giving a Doc in an inconsistent
status where self.filename was set but not self.abs_filename.
Added an asset to detect early the problem if ever happens again.
In turn the problem prevented the project's module hook to work if the
file was newly created.
Fix a conspicuous omission to call the dmon_unwatch function
when changing project directory.
This uncovered a bug or a quirk of the dmon library where the watch_ids
can change as a result of calling dmon_unwatch because they are just
indexes on a contiguous array. Use a workaround to always unwatch the
first valid watch_id N times.
Bring back the command like before to keep single selection but with
ctrl+f3 keybindings. Change the name of the new multi-cursor command
but keep the ctrl+d keybinding.
The initial position for the search is defined by the last selection
towards the end of the file.
After reaching the end of the file, it would always select the same
selection to start the search from.
Now, we start the search from each selection, until a new occurrence is
found.
When using hidden suggestions remember the text user was typing when
navigating suggestions.
Ensure also that in the previously searched expressiosn we have no
duplicate entries.
If the selected text containes newlines it doesn't make sense to
use it as the initial text in the "replace text" command view.
Do not use the selected text if a newline is found in the selection.
Fix#511.