4412 Commits

Author SHA1 Message Date
Colomban Wendling
72c809f633 Use Glade to create the File Properties dialog 2013-05-20 04:12:44 +02:00
Colomban Wendling
2e9a1753d7 Fix internationalization of the File Properties dialog title 2013-05-20 01:50:02 +02:00
Colomban Wendling
9652a34ef0 Add ellipsis to menu items requiring further user input
This is a very common paradigm used by GNOME, KDE, MacOSX, Windows,
etc., and following it makes our UI more consistent with these and
easier to use by their users.

https://developer.gnome.org/hig-book/stable/menus-design.html.en#menu-item-type-command

Closes #3613494.
2013-05-19 23:15:38 +02:00
elextr
c2d2fddca3 Return a non-printing sequence for no context separators
Function symbols_get_context_separator() returns the symbol
separator for the language, but some languages do not have
symbol context separators, for example markup languages like
Asciidoc.  To prevent the symbols pane wrongly detecting and
acting on a valid character sequence as a separator, return a
non-printing character which should not occur.

Options "" and NULL not used as they break some code and would
need an ABI bump.

Other languages can be added as they are identified.
2013-05-15 14:10:22 +10:00
Colomban Wendling
deede0595e Fix notebook tab switching with keyboard if some pages are hidden
When switching the current notebook tab, we need to take only visible
pages into account.  If we don't and we try switching to an invisible
page, nothing happens.

In practice, the issue is visible on the message window notebook if one
of the tabs are hidden due to one of the "msgwin_*_visible" settings.
2013-05-10 00:10:46 +02:00
Matthew Brush
d9ead8591a Make editor-related View menu items document-sensitive again
They used to be because their parent menu item (Editor) was
document-sensitive but now they are in the top of the View
menu they need to be invdividually made so.

TODO: should they really be/have been document-sensitive? They
can still change the pref without a document open and their
equivalent options in the Preferences dialog are not
document-sensitive? Same goes for existing "Change Font" item.
2013-04-27 11:42:04 -07:00
Colomban Wendling
564ef98f9c Update for new Scintilla styles 2013-04-27 18:30:17 +02:00
Matthew Brush
0f614dd885 Remove reference to removed "menu_view_editor1" (oops) 2013-04-26 23:56:16 -07:00
Matthew Brush
e0245df568 Make "Create" button default for New Project dialog
So it activates when you press the enter/return key in one of the
entries.
2013-04-26 14:56:55 -07:00
Atanas Beloborodov
a3da0467d4 Add version check around deprecated g_thread_init() call.
g_thread_init has been deprecated since GLib version 2.32
2013-04-25 17:30:09 -07:00
Colomban Wendling
ea87576ee4 Remove use of global variables in custom commands code 2013-04-22 20:24:20 +02:00
Colomban Wendling
5868c6991c Fix leaks upon symbol list updating 2013-04-22 20:20:53 +02:00
Colomban Wendling
776c77d6b6 Use GLib version of C99's snprintf() 2013-04-22 20:18:18 +02:00
Colomban Wendling
659276730a Don't use deprecated gtk_icon_set_render_icon() on GTK3 2013-04-22 20:18:18 +02:00
Eugene Arshinov
e8443b19f7 rewrite_reflow: Remove a check inside line breaking implementation that caused breaking to occur too early 2013-04-21 11:45:09 +10:00
Eugene Arshinov
7e732bddc8 rewrite_reflow: Remove no longer used sci_lines_split function that wrapped SCI_LINESSPLIT 2013-04-21 11:45:09 +10:00
Eugene Arshinov
cc5e6d2a19 rewrite_reflow: Reimplement split_line function to achieve consistency with the "Line breaking" option 2013-04-21 11:45:09 +10:00
Eugene Arshinov
40fb3aa64d rewrite_reflow: Create sci_get_position_from_col function to wrap Scintilla's SCI_FINDCOLUMN command. 2013-04-21 11:45:09 +10:00
Eugene Arshinov
390646a412 rewrite_reflow: Extract split_line function
Extract `split_line` function from `reflow_lines` to reimplement it in
the future without using SCI_SPLITLINES to achieve the
behaviour consistent with the "Line breaking" option.
2013-04-21 11:45:09 +10:00
Colomban Wendling
c986eeee99 PHP: show namespaces and traits in the symbol list 2013-04-17 17:07:47 +02:00
Colomban Wendling
8b3142ef4d PHP: use "::" as the scope separator 2013-04-17 17:07:18 +02:00
Matthew Brush
d452d0b737 Cleanup statusbar template code a bit
* Unhardcode "pos" and "style" statusbar messages which were only
enabled when GEANY_DEBUG is defined and make them real possible
format chars.

* Move needless global "statusbar_template" into UIPrefs structure
with the other UI preferences, removing (now) pointless ui_finalize()
function.

* Rename "add_statusbar_statistics" to "create_statusbar_statistics"
and make it return a gchar* instead of passing in a GString argument
to update. Fixes a one-time "leak" of the GString and makes the code a
little easier to follow.

* Move the default statusbar template string to the top of the file
and use it as the default for the various preferences so the user has
something to base their customizations off of. TODO: check that the
N_() translations stuff works OK.
2013-04-14 19:03:58 -07:00
Enrico Troeger
029d78536c Don't try to set std_out and std_err if they are NULL 2013-04-14 13:22:41 +02:00
Colomban Wendling
5412a244ba Fix crash with bulk pattern replacements (introduced with c83a93e)
"regex_match_text" and "regex_matches" being globals, performing
several searches and then the replacements separately lead to them
having unexpected values, resulting in incorrect behavior and crash.

Fix this by removing the globals and instead make the search functions
return match details.  Not only this fixes the issue, but also make the
code a lot more maintainable by not having globals introducing side
effects (proof of them being an issue is that c83a93e inadvertently
broke things bad).
2013-04-13 17:06:47 +02:00
Nick Treleaven
99d06abea8 Use widget parameter in on_find_usage() for consistency 2013-03-25 15:57:58 +00:00
Nick Treleaven
4fcce9cc00 Add symbol list Find in Files popup menu item 2013-03-25 15:57:56 +00:00
Colomban Wendling
235b8613fb Use GSlice to allocate find_range() elements 2013-03-24 18:47:55 +01:00
Colomban Wendling
2c11c3c5e7 Fix cursor position and selection after comment toggling
Fix the selection start position after uncommenting if it was inside
the comment marker;  and fix the selection end position if it was in
the indentation or before or inside the comment marker.

Improved fix for #3576431.
2013-03-24 18:34:29 +01:00
Colomban Wendling
4f78efc9f1 Unify algorithm for searching all matches inside a range
Instead of re-implementing the search-all algorithm everywhere it is
needed, move it to a re-usable function.  This is useful because some
care is required to avoid improper rematches and endless loop, so
avoiding duplication is important (especially if something has to be
fixed someday).
2013-03-24 15:53:39 +01:00
Colomban Wendling
c83a93eb65 Fix search/replace for the replacement not to change search results
Fix the search & replace algorithm to make sure a replacement won't
possibly affect the next one (e.g. in case of lookahead and lookbehind
regular expressions).

To do so, first find all occurrences and only then perform replacements,
instead of doing both together.

This fixes searching/replacing of any pattern that may be affected by
its replacement (e.g. patterns that look for something not a character
in the match range), including:

 * Start/end of line:
   Before this change, searching with regular expression "^A" and
   replacing with an empty string on the input "AA" would have resulted
   in an empty output ("^A" matching again after removing the first
   one).  Now it properly only removes the leading "A".
 * Lookahead/lookbehind:
   Pattern "(?<=a)b" with empty replacement and input "abb" would have
   resulted in the output "a" instead of "ab".
 * And more generally, many patterns matching non-characters like
   positions or out-of-match characters.
2013-03-24 15:50:22 +01:00
Lex
e18d75b23b Change signal used to kill executions to SIGTERM
The originally used SIGQUIT has problems:
1) see the deleted comment
2) some xterm alternatives ignore it, so they don't stop

Changed to SIGTERM which is the canonical "terminate" signal.

Removed associated unneeded ignore of SIGQUIT.
2013-03-23 11:58:45 +11:00
Colomban Wendling
b1fb2ab053 Fix various line length computation issues for the last line
The last line doesn't have EOL characters, so computing
(line_length() - eol_length()) is wrong on the last line.

Instead, use (line_end_pos() - line_start_pos()) as suggests
Scintilla's documentation.

Closes PR#124
2013-03-20 23:17:19 +01:00
Colomban Wendling
57940e67a3 Windows: use absolute path to the icons directory 2013-03-19 16:59:32 +01:00
Enrico Tröger
9d412702e8 Make the compat_widget_set_flag macro more robust 2013-03-19 14:43:12 +01:00
Enrico Tröger
d9c7f59b41 Improve GTK compatibility macros for GTK 2.16
On GTK 2.16 GTK_WIDGET_[UN]SET_FLAGS resolves to a do-while construct which
raises a syntax error when embedded into a ? operator.
Also gtk_widget_get_visible() is only available since GTK 2.18, so add a fallback to
the old variant.
2013-03-19 14:17:25 +01:00
Colomban Wendling
3291c30de5 Fix utils_parse_and_format_build_date() 2013-03-17 19:36:17 +01:00
Colomban Wendling
e409b70fab Fix various TMTag leaks 2013-03-17 17:31:36 +01:00
Enrico Tröger
fbce364182 Improve build date conversion code
Don't use strptime() as it is not very portable, instead use a GDate and use the
code also for the date output in --version.
2013-03-17 17:17:09 +01:00
Christian Dywan
d270e6c690 Parse compiler provided build date to use the translatable date format string 2013-03-17 17:17:09 +01:00
Christian Dywan
a982908bec Define default template date format strings globally and make them translatable 2013-03-17 17:17:09 +01:00
Nick Treleaven
7150c63f22 Add Find Usage popup menu items for symbol list tags (#3608278) 2013-03-17 13:30:59 +00:00
Colomban Wendling
232290aad4 Fix our custom styles under KDE and for people using gtk-chtheme
We have a custom RC file defining various styles we need, and we want
the user to be able to override them (e.g. if they want -- or need --
other colors).  Fair enough, one would simply call gtk_rc_parse() with
the appropriate filename.  However, the styling rules applies in the
order they are loaded, then if we load our styles after GTK has loaded
the user's ones we'd override them.

There are 2 solutions to fix this:
1) set our styles' priority to something with lower than "user"
   (actually "theme" priority because rules precedence are first
   calculated depending on the priority no matter of how precise the
   rules is, so we need to override the theme).
2) prepend our custom style to GTK's list while keeping priority to
   user (which is the default), so it gets loaded before real user's
   ones and so gets overridden by them.

One would normally go for 1 because it's ways simpler and requires less
code: you just have to add the priorities to your styles, which is a
matter of adding a few ":theme" in the RC file.  However, KDE being a
bitch it doesn't set the gtk-theme-name but rather directly includes
the style to use in a user gtkrc file, which makes the theme have
"user" priority, hence overriding our styles.  So, we cannot set
priorities in the RC file if we want to support running under KDE,
which pretty much leave us with no choice but to go with solution 2,
which unfortunately requires writing ugly code since GTK don't have a
gtk_rc_prepend_default_file() function.  Thank you very much KDE.

Though, as a side benefit it also makes the code work with people using
gtk-chtheme, which also found it funny to include the theme in the user
RC file.
2013-03-16 16:19:20 +01:00
Nick Treleaven
fd8ba60b4a Disable start of word checkbox when whole word checkbox is enabled 2013-03-16 13:47:28 +00:00
Nick Treleaven
14878850cd Don't find start of word when whole word matching should prevent it 2013-03-16 13:26:52 +00:00
Nick Treleaven
feb4a6409e Remove unused variables 2013-03-15 17:55:18 +00:00
Colomban Wendling
71093fec62 Autotools: replace use of deprecated INCLUDES in favor to AM_CPPFLAGS 2013-03-15 16:48:33 +01:00
Colomban Wendling
35cc441b74 Merge branch 'gtk3-support'
Conflicts:
	src/ui_utils.c
2013-03-10 17:20:25 +01:00
Colomban Wendling
7e3a235436 Post release version bump
Say welcome to Geany 1.24 "Sakai"!
2013-03-10 17:00:01 +01:00
Colomban Wendling
e5245eb053 Increase the number of lines where filename is replaced upon save as
Search the first 4 lines (instead of 3) for Python templates support.
2013-03-05 23:58:04 +01:00
Colomban Wendling
5b23669649 Fix replacing file name in headers upon save as
The code used a Scintilla-specific regex escape (\<) which doesn't work
anymore since the time we switched to full PCRE (which uses \b).  So,
update the regular expression to PCRE.

Also, properly escape the name to search in the unlikely case it has
regular expression escapes in it;  and properly check for word
boundaries even when not searching with an extension.
2013-03-05 23:47:37 +01:00