-
Notifications
You must be signed in to change notification settings - Fork 617
Rpg sidebar tree (see #259) #1813
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
Conversation
@codebrainz too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code was reviewed too, but I couldn't find anything to complain about!!! :)
files are shown as paths (similar to *Show Paths* mode). Home directory | ||
always shortened to ``~``. If there is an active project, it makes a tree | ||
of project documents inside project name. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "project name" do you mean "project base directory"?
And what does it do with documents that are outside the project base dir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The node in the tree view is labeled after the project. While normally folders are combined if no files in parent folders are open, this is not done for projects.
e.g. if I open document.c it shows normally as
~/dev/geany.git/src
-- document.c
If I make a project it shows as
geany
-- src
---- document.c
Documents outside the project base dir are not affected (i.e. the nodes are labeled after the paths)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok, so if I read that right only the project base dir and below shows as a tree?
Maybe the selection should be called "Show Project Tree"
Just a final check, commonly my directory layouts look like:
/data -- the raid array mount point
foo -- the project name
foo -- the git tree and the project base dir in foo.geany
src
foo.cpp
lots more source
foo.geany
dev_build -- out of tree build dir
foo -- the executable
test_output -- unit test output file
lots more stuff the build makes
So if I had project foo open and foo.cpp and test_output open I would get
/data/foo/dev_build
test_output
foo
src
foo.cpp
doc/geany.txt
Outdated
Show opened documents as tree similar to directory tree, but it shows only | ||
directories that contains opened files. Directories that doesn't contain | ||
files are shown as paths (similar to *Show Paths* mode). Home directory | ||
always shortened to ``~``. If there is an active project, it makes a tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is always
d6c442c
to
3ca8921
Compare
hey sorry to dissapoint, I dont know how my email got linked to this
project but the Kugel you are looking for doesnt use this email (ive been
getting random updates from github every once in a while for years), sorry
=( but hey i hope you guys work out those bugs and keep plugging away at it!
…On Mon, Mar 26, 2018 at 5:47 PM, elextr ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/geany.txt
<#1813 (comment)>:
> +
+ .. image:: ./images/sidebar_documents_only.png
+
+Show Paths
+ Show opened documents as two-level tree in which first level is a full
+ directory path to document and second level is a file name.
+
+ .. image:: ./images/sidebar_show_paths.png
+
+Show Tree
+ Show opened documents as tree similar to directory tree, but it shows only
+ directories that contains opened files. Directories that doesn't contain
+ files are shown as paths (similar to *Show Paths* mode). Home directory
+ always shortened to ``~``. If there is an active project, it makes a tree
+ of project documents inside project name.
+
Oh, ok, so if I read that right only the project base dir and below shows
as a tree?
Maybe the selection should be called "Show Project Tree"
Just a final check, commonly my directory layouts look like:
/data -- the raid array mount point
foo -- the project name
foo -- the git tree and the project base dir in foo.geany
src
foo.cpp
lots more source
foo.geany
dev_build -- out of tree build dir
foo -- the executable
test_output -- unit test output file
lots more stuff the build makes
So if I had project foo open and foo.cpp and test_output open I would get
/data/foo/dev_build
test_output
foo
src
foo.cpp
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1813 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFh94vi_hC13eNhoFXodrBn1SOdsmxTLks5tiWIKgaJpZM4SyLKn>
.
|
hehe its fine, i get these every once in a while, just wanted to make sure
the real kugel gets your message, eve if he stole my nickname =D
…On Tue, Mar 27, 2018 at 2:19 AM, elextr ***@***.***> wrote:
@Kugel <https://github.com/Kugel> sorry, I meant @kugel-
<https://github.com/kugel-> but your user comes up first on the
autocomplete, and hey us humans make mistakes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1813 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFh94ipxXxoJMJTTXUVW5B-aPy40D7GDks5tidnggaJpZM4SyLKn>
.
|
Oh, ok, so if I read that right only the project base dir and below
shows as a tree?
No, all open files are tree'ified. Its just that once a project is open it is ensured that its base path gets its own tree node (labeled after the project)
Maybe the selection should be called "Show Project Tree"
No, see above.
Just a final check, commonly my directory layouts look like:
```
/data -- the raid array mount point
foo -- the project name
foo -- the git tree and the project base dir in foo.geany
src
foo.cpp
lots more source
foo.geany
dev_build -- out of tree build dir
foo -- the executable
test_output -- unit test output file
lots more stuff the build makes
```
So if I had project foo open and foo.cpp and test_output open I would
get
```
/data/foo/dev_build
test_output
foo
src
foo.cpp
```
Yes. But if you also had a /data/bar folder then it'd look like
```
/data
foo/dev_build
test_output
bar
file.txt
foo
src
foo.cpp
```
|
Oh, ok, thats sort of unexpected, so it needs to be explained more clearly (if only so we can close issues and point people to the manual that says thats how its meant to work :) |
Please suggest a better description, I'm not so good at this.
|
@kugel- yep, will propose something as soon as I'm happy I understand :) But on looking at the above example again.
But in your additional example you have shown |
foo/dev_build is one tree node because no file in foo itself is open. foo->src is two tree nodes because foo represents the project (therefore always gets its own top-level node) and src is a subdirectory (with an open file). Might be easier if you just try the patch and see yourself, Github/mail kind of sucks for showing examples. |
Two things:
|
@elextr do you need more information on how it's supposed to work? |
Yes, above I said:
I had previously asked if only the project tree was expanded and you said no as quoted above, so to be clear the question is, if "all open files are treeified" then why isn't |
This proves that I'm not good at documenting such things for end users :-) There is additional confusion since your example has two foo folders and the project is named foo as well. I'll rename to illustrate:
So accordingly, in your next example foo/src becomes bar/src. If xx.cpp and test_output are open, then it's displayed as follows:
This is because of the following rules:
Compare to the situation when there is no project open:
|
Thats ok, thats why I'm asking all these annoying questions :-) I think the confusion is that I understood that the difference between this option and the existing option was that all directories on the path to open files expanded, but in fact they only expand if more than one thing inside them is open. To confirm by example, if my project
but if I had a file open in each of
with |
Correct |
@kugel- I still can't do anything with github, so I have posted my suggested text below.
|
Works for me, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I get the following warning when building the manual:
In the generated pdf sidebar_documents_only.png appears very small. The HTML manual is fine though. Does anyone know what to do about it? |
@elextr Actually, the home directory is merely abbreviated (using ~), it doesn't get an individual root node unlike the project base path. See the doc/sidebar_show_tree.png |
@kugel-, erm, ok, what happens if there are two directories open along the path to
or
or no
|
changed which @kugel- :) |
I think the second. However, upon trying I found there is a crash (but only when there are open files of another user AND a file located in ~ itself). I'll dig into it. On a side note, having a file of another user open seems unlikely, as Geany is a poor program for pair programming :-) |
@kugel- various daemons and databases run under other users and have their config files in that home dir as another use-case. But even if we can't think of a use-case, if its at all possible, somebody will do it 😄 |
5c79661
to
6125657
Compare
I amended the commit message of 7552d5f due to typos. There are no code changes, except the three new commits on top of @elextr change. @elextr Upon looking at the code handling the home directory, I think the intention was to match your first case, and it was a bit buggy. Since I think this is the most useful behavior, so I fixed the code to match that behavior. |
@elextr is your approval still valid even after my changes? I'd like to merge this finally. |
ce29af6
to
2455539
Compare
2455539
to
2474712
Compare
@kugel- sorry, I totally lost track of this PR. Tested, some observations below, not sure if they are deliberate? But they were surprising, appeared inconsistent, and in at least one case annoying. Initial layout:
The Note the path starting with Opened
Note the resorting of When I closed
The When I closed I expected:
but got:
Note Also |
Thanks, I'll check. It's quite hard to get GTK to do what you want. Remembering fold state is not supported by GTK directly so I have to code around it, basically using a hammer so long until it fits. Do you have comments aside the fold state memory? |
The resorting of ~ when it became a standalone level |
Sorting weirdness seems to be caused by |
Makes sense, it probably is intended to work on absolute filenames, or at least filenames with the same root (ie directory).
Getting ordering and merging stable will probably make saved fold state work a lot easier. |
@elextr I think I got this right now. Please check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Had only a few remarks.
LGTM now! Thanks. |
Great, thanks! I'll merge in a few days then. @elextr do you plan more tests and/or review or are you fine with this now as well? |
@kugel- Intending to test this weekend. |
@kugel- its better, ~ handling seems more correct, successfully recombines ~ and child when reduced from two children to one. But folding saving doesn't seem to be right yet. Initial state
close and re-open Geany gives
set back to same initial state and close and re-open, Geany opens with everything unfolded and from then on always seemed to re-open with everything unfolded, no matter what I did. |
Thanks for testing. I'll check. Just leaving the note here that folding state is not stored to disk anywhere so re-opening Geany begins anew. |
Ok, so opening all unfolded is fine then, so the only issue is the ~ opening folded one time. Since it didn't repeat the few times I tried maybe its an uninitialised variable that is mostly the correct value, but occasionally bad. |
I made a minor change that should fix startup (the expectation is that everything is unfolded on startup). Please check again. I couldn't reproduce your second example even without the last correction. |
Ok, now seems consistent, can't cause any bad behaviour, always opens unfolded, ~ coalescing seems to work. :-) To be explicit, looks ok to merge. |
I could reproduce the your second example (all under So if nothing comes up last minute I will merge by the weekend or so. |
Would have been useful to detail the reproducer for testers. Anyway I found an order that reliably reproduced the problem and your latest push seems to fix it.
As I have said before, its important to allow a whole weekend before merging, I just happened to have time today, but many people only have weekends to try anything. |
Currently you can chose between a flat document list and a two-level tree that groups the files by their directory. With the new tree view the latter mode is extended to a true tree where directory rows only represent the direct parent directory of open documents. Except that single-child subtrees are collapsed to a single row. See the manual for glory details. The new mode allows to quickly close entire subtrees and is visually close to the file system layout. As with the two-level tree, the home directory and project base directory (if any project is open) are treated specially and usually get a distict row - home directory appears as "~" - project base directory path is replaced by the project name The new mode is the default. Existing installations will use the new mode because a new pref is introduced. Closes geany#259 Based on work by RPG <[email protected]>
- Move to separate file geany-gtk.m4 - Merge gthread checks into the main gtk ones
The test program checks if open documents are grouped correctly by their parent directory. The older modes (plain document list and two-level tree) also get a distinct test. For this to work some symbols must become visible from libgeany. The test uses g_strv_length() which is relatively new. Autoconf and meson checks are added as needed.
b4adf7e
to
8932304
Compare
Merging after CI is done. The last push was just a squash of the fixup (as well as splitting the unit test commit into two). No diff to the previous state. |
Continuation of #259 since I can't push to @scriptum branch (I suggest you allow that).
I added some cleanup commits on top of @scriptum work and rebased onto 1.33.
@elextr @b4n Please give feedback (considering the history in #259). I think I'll merge this in maybe 10 days or so.