Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not possible to use Geany as a text editor if they want to edit (as plain text) Geany project file specified in command line. #1658

Closed
A1-Triard opened this issue Oct 24, 2017 · 9 comments

Comments

@A1-Triard
Copy link

The Geany does not have command line option to force open a "*.geany" file as a text file. This limitation means that it is not possible to use Geany as generic text editor, as editor which can open and edit any text file, specified by command-line.

@elextr
Copy link
Member

elextr commented Oct 24, 2017

Indeed but you can open them from the open dialog. So I think you are making a bit of an overreach that Geany can't be a "general text editor".

@A1-Triard
Copy link
Author

It is true, but I cannot, for example, bind Geany to F4 key in MidnightCommander (I can bind, but on "*.geany" files F4 will load project instead on start editing file).

@elextr
Copy link
Member

elextr commented Oct 24, 2017

Also you normally should not need to edit .geany files, almost all changes can be made from the GUI, and if you edit the .geany file that Geany is using it will be written over when Geany closes.

Anyhow if someone wants to propose a pull request it can be considered.

@A1-Triard
Copy link
Author

A1-Triard commented Oct 25, 2017

I have found real workaround. Firstly, Geany opens "*.geany" file as ordinar files if more than one file specified in command line. Secondly, Geany silently ignores "files with empty name", i. e. empty command line arguments. Thus, to open "some_file.geany" as ordinar text file they can use the following command:
geany "" some_file.geany

I think this issue should be closed now.

@elextr
Copy link
Member

elextr commented Oct 25, 2017

Just to clarify, if the *.geany file is not the FIRST non-option argument it will open, not load the project, but if you use the "empty file first" trick consistently it will be ok.

@elextr
Copy link
Member

elextr commented Oct 25, 2017

Just BTW Github allows you to close your own issues, but done.

@elextr elextr closed this as completed Oct 25, 2017
@A1-Triard
Copy link
Author

Note: invlaid URI (like "workaround://") works much better, than empty string: it works good even when new editor instance delegates files to already running instance.

@A1-Triard
Copy link
Author

Ok, I finally got it. The approach with empty argument works well with "-i" option, when you should do not care about processes merging, Without "-i" option it is possible to add ":0" suffix to *.geany file. All workarounds do not cover a case with *.geany argument, representing non-existing file, and '-i' option is not specified. But in my case (using Geany as $EDITOR), I does not have such case.

@A1-Triard
Copy link
Author

Ok, now I really finally got it. Always-working workaround:
geany some_existing_or_not_existing_file_with_very_strange_name_or_even_dir_name_or_project_name:0:00000

(Trailing zeros count should be enough to result does not match an existing file.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants