On OS X /etc/bashrc does some Apple-terminal-specific thing:
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
This however doesn't work in VTE when Geany is started from the Terminal
application so we get some strange prefix for the prompt. Unset the
TERM_PROGRAM variable so it isn't set to Apple_Terminal when running
inside VTE.
The initial prompt may get corrupted so it looks something like
any/src $ het-vm ~/projects/gea
instead of
techet@techet-vm ~/projects/geany/src $
This is just the initial display problem - when enter is pressed, the
second line already shows correct prompt.
It appears that VTE isn't fully initialized when starting the shell process
and when the shell start is delayed a bit (performed on idle), the prompt
looks correct.
When the Symbols tab isn't shown, symbol tree isn't updated. However,
we should record the cases when update should have been performed
and once the symbols tab is shown, perform update if something changed.
Thanks to this patch we also don't have to always perform symbol tree
update when switching to the Symbols tab but only when something has
actually changed.
The tags_lang variable is set from the first tag in the found array but
the array may actually contain tags from several languages. This may
lead to two things:
1. Goto tag definition goes to a tag from a different filetype
2. Worse, the first tag is from a different language than the current file
and we get a message that no tag was found
Get lang for every tag in the array and rename tags_lang to tag_lang.
The tree model nodes consist of GNode structs:
struct GNode {
gpointer data;
GNode *next;
GNode *prev;
GNode *parent;
GNode *children;
};
where children are a linked list. To append a value, the list has to be
walked to the end and with nodes with many children (which is our case)
this becomes very expensive.
We sort the tree afterwards anyway so it doesn't matter where we insert the
value.
gtk_tree_store_set() becomes very slow when the tree gets bigger
because internally it calls gtk_tree_store_get_path() which counts
all the entries in a linked list of elements at the same tree level
to get the tree path.
Avoid the call of this function when not needed.
Because function return types are not used to determine tag equality,
we need to also update the tooltip of an existing tag otherwise the return
type doesn't get updated when changed.
This is not completely obvious - when I first saw the message, I started
pressing backspace which really doesn't help.
Also clarify and shorten the message a bit - in "Could not execute the file
in the VTE because it probably contains a command" it's not clear if it's
the file or VTE which contains the command. Also use "terminal" instead
of "VTE" which is more user-friendly.
Right now users are confused when various VTE actions don't work because
there's no indication that the terminal is in the non-clean state.
Visualise "modified" terminal in the same way as modified document - by
a red label in the tab so it's clearer when terminal isn't clean.
Avoid quick red flashes when pressing enter by delaying the color change
a bit.