4164 Commits

Author SHA1 Message Date
Matthew Brush
fb8e061242 Prevent warning about comparing signed and unsigned values
The g_match_info_fetch_pos() function uses a signed value for the match_num
parameter, even though values less than 0 are not valid, so a cast is used.
2011-12-25 14:44:32 -08:00
Matthew Brush
2fe42bfc0c Support [named_colors] in filetypes.* and color schemes 2011-12-25 14:34:04 -08:00
Matthew Brush
8a04222301 Support normal and abbreviated HTML hex triplets in color schemes 2011-12-25 13:43:20 -08:00
Nick Treleaven
773d7e42d2 Let GRegex handle escape sequences itself 2011-12-25 17:22:06 +00:00
Nick Treleaven
21f0715381 Fix \b regex word boundary always matching at start of search 2011-12-25 13:42:19 +00:00
Nick Treleaven
c2481ccb95 Use GRegex matching for Find & Replace commands 2011-12-25 13:23:06 +00:00
Jiří Techet
624c11cec0 Do not change notebook tab in document-close callback
This can lead to unpredictable behavior of document_get_current()
2011-12-24 12:31:22 +01:00
Jiří Techet
ddbb2535f4 Move MRU tab handing from keybindings.c to notebook.c because this is where it belongs 2011-12-24 12:31:10 +01:00
Colomban Wendling
23eede5291 Make switch to MRU upon tab close configurable
Add configuration option tab_close_switch_to_mru to allow the user
to choose whether to switch to the most recently used tab or to the
next one after closing the current tab.
2011-12-24 12:30:58 +01:00
Jiří Techet
f6be8b47d7 Make the tab switching dialog a bit more useful
Right now the tab switching dialog shows the full
path of the current file. However this dialog is too
narrow and in my case usually displays one directory
per line. This makes it hard to find the base
filename, which is the thing you are most probably
looking for.

This patch displays only the base name - in bold. In
addition, it displays the following three filenames
in the MRU list, each on a new line (not in bold).
This helps to see what file comes next and how many
times one has to press ctrl+tab.
2011-12-24 12:30:01 +01:00
Jiří Techet
0acb273c55 Rewrite tab switching queue
There was one more bug related to the tab switching. When we switch
so many times that we return back to the original document (so we
actually don't switch at all) then the following switch attempt
doesn't switch immediately to the next document.

After spending two hours thinking what is wrong, I gave up and rewrote
the whole thing in a different way. The problem with the previous
implementation was that before you couldn't just look what's in the queue
"now" - you had to imagine what will be inserted there in the next step
because the switch_in_progress variable was set after the first switch
(this is also why I put the long comment why mru_pos = 2 - that is not
clear at all when you first look at it). Also there were some not very
nice "workarounds" like the idle function that was executed after the
switch and removed the double entry on top of the queue.

So with the new implementation things are much simpler IMO. The queue
starts with the current document and the previously opened documments
follow. It's *always* like that, no exceptions. The idle function
is gone and cb_func_switch_tablastused() is simplified too. The rest of
the functionality should be clear from the code.

Signed-off-by: Jiří Techet <techet@gmail.com>
2011-12-24 12:29:51 +01:00
Jiří Techet
d0892b95d1 When closing tab, return to the document at the top of the MRU list
This is a pretty frequent work pattern of mine:

1. Editing file A
2. Searching for function and opening file B
3. Closing file B because I just wanted to look at the function definition
4. Without this patch I get to the file following the B's tab (which
is just a random file) but my brain expects that I get to A

I know it's possible to kind of simulate the behaviour I want with
the "next to current" placement option but I really don't see a single
advantage of having tabs closed in sequential order. This is also
why I didn't make this behaviour optional. But maybe I miss some
use case of tabs being closed sequentially - just tell me.

Signed-off-by: Jiří Techet <techet@gmail.com>
2011-12-24 12:29:43 +01:00
Nick Treleaven
0c6aed700d Make 'Replace Spaces by Tabs' only match leading spaces
Replacing spaces used for alignment with tabs would often break the
alignment as tab stop positions were not checked. It's also not
possible to distinguish between a true space and a single aligning
space, so we should ignore all spaces outside of indentation.
2011-12-21 17:06:32 +00:00
Colomban Wendling
ed1fe7903b Explicit all required casts in sciwrappers
There is still 3 signed values implicitly converted to unsigned not
fixed, but they aren't really legitimate and would require a behavior
change in some corner cases.
2011-12-18 00:32:22 +01:00
Colomban Wendling
0aea05d10d Fix various integer signedness and minor styling issues
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning.  This should not change anything in behavior, only
makes clear the index won't underflow.
2011-12-18 00:32:22 +01:00
Colomban Wendling
53a98c303f Clear error indicators upon build start even if no document is given 2011-12-18 00:32:22 +01:00
Colomban Wendling
9e7301cdef Fix initial back and forward items sensitivity
These actions were marked as document sensitive but their sensitivity
is already managed by the navqueue, so making them document sensitive
only leads to them being wrongly updated when the document count
changes from or to 0.

So, make them initially insensitive and let the navqueue correctly
handle their later sensitiveness.
2011-12-18 00:32:22 +01:00
Nick Treleaven
ef3d5b8417 Use 'comment' named style for D nested comments
This also fixes a wrong style key name for filetypes.d.
(Nested comments aren't necessarily doc-comments).
2011-12-16 21:02:39 +00:00
Colomban Wendling
adfbfa5838 Remove useless warning message written in bad English (oops) 2011-12-11 23:38:04 +01:00
Colomban Wendling
e389168162 Make main window geometry loading more robust
Properly handle the case the saved geometry isn't valid, avoiding
a crash with corrupted preferences.
2011-12-11 23:13:24 +01:00
Matthew Brush
a64c46c496 Initialize window geometry array on error conditions
Instead of using the garbage values in memory for default size.
This fixes what was attempted to be fixed in the last two reverted commits.
2011-12-11 13:10:05 -08:00
Matthew Brush
77a900b976 Revert "Use a sane default window size if config is missing"
This reverts commit 00473dff4e95c6d1b128edfc26038f4e98cbddf8.
2011-12-11 13:01:19 -08:00
Matthew Brush
36498ddfae Revert "Ensure Geany's default size takes effect (oops)"
This reverts commit d090e7dd854e5eec99c8176aacb6759081e9a4d4.
2011-12-11 13:00:49 -08:00
Matthew Brush
d090e7dd85 Ensure Geany's default size takes effect (oops) 2011-12-10 19:52:55 -08:00
Matthew Brush
00473dff4e Use a sane default window size if config is missing 2011-12-10 19:28:23 -08:00
Matthew Brush
b60413ed60 Clean up some compiler warnings (oops) 2011-12-10 16:14:11 -08:00
Matthew Brush
2d41ee941b Merge branch 'gtkbuilder' 2011-12-10 15:50:05 -08:00
Matthew Brush
7d6731279f Show error dialog if the Glade file could not be loaded
Also remove old comment that doesn't apply anymore.
2011-12-10 15:44:37 -08:00
Matthew Brush
467363adb9 Set translation domain for the GtkBuilder 2011-12-10 14:39:07 -08:00
Matthew Brush
906ffc6aae Fix some widget names in glade file and code so they match (oops) 2011-12-10 14:10:44 -08:00
Nick Treleaven
fb1c6c63e6 Print system plugin path debug message on startup 2011-12-08 17:02:25 +00:00
Nick Treleaven
d7f53f7f83 Fix offscreen window after quitting when minimized
Fixes #3421282.
Occurred with Windows e.g. Vista, 7.
2011-12-08 16:35:29 +00:00
Nick Treleaven
8818ee3fc9 Include gdk-pixbuf-2.0 path for recent GTK+ dev (Windows build)
Fixes #3396195.

Note: GTK+ 2.24 is the current maintained version of the developer
files bundle:
http://www.gtk.org/download/win32.php
2011-12-08 12:53:11 +00:00
Matthew Brush
3f6b4f950d Remove interface.c file added back in from last merge (oops) 2011-12-06 19:06:53 -08:00
Matthew Brush
088b0bc362 Merge branch 'master' into gtkbuilder
Conflicts:
	geany.glade
	src/Makefile.am
	src/callbacks.c
2011-12-05 20:52:00 -08:00
Dimitar Zhekov
4ffbd8f9ad split "always wrap search and hide find dialog" pref into "always wrap search" and "hide find dialog" 2011-12-05 21:54:38 +01:00
Colomban Wendling
f0de946d3e Fix inserting multi-line comments with "Insert multiline comment"
"Insert multiline comment" did insert single-line style comment when
available even if multi-line style was also supported for the filetype.
2011-12-04 00:21:41 +01:00
Colomban Wendling
c69b8eea23 Fix and unify getting open/close/single comment markers
Add filetype_get_comment_open_close() to get appropriate start and end
comment markers from a filetype, and use it everywhere these markers
are fetched.

This fixes a crash in editor_insert_multiline_comment() if only single
comments are available (closes #3449635).
2011-12-04 00:16:31 +01:00
Colomban Wendling
77a484e990 Don't leave some fields initialization to implicit initialization
Although this doesn't change anything in practice, it started to be a
nightmare trying to deal with compilers warnings about "missing"
initializers, which are generally good but not in that file.
2011-11-23 02:22:07 +01:00
Colomban Wendling
4a0a5f0a09 Don't try to parse 0-length data since TM don't support it 2011-11-23 00:51:46 +01:00
Colomban Wendling
c252b1f376 Fix finding duplicated keybindings
When checking whether a keybinding is already in use before updating
it in the preferences, check against the keybindings the user may have
updated, not the ones that are currently applied.

This fixes changing action A from key K to key L and action B from key
L to key K, which led to conflicts back and forth since when setting B
to K the check found A as a duplicate even after having changed it.
2011-11-23 00:51:46 +01:00
Dimitar Zhekov
6738d43dee --read-only cleanup
Use the global variable only when needed and add an initializer for it
in the default options.
2011-11-21 21:48:32 +01:00
Colomban Wendling
102ce1d205 Prevent GCC to warn about missing initializers in highlightingmappings.h
Use a GCC pragma to disable -Wmissing-field-initializers in this file.
This works with both GCC and CLang, and should be harmless on other
compilers since unknown pragmas are supposed to be ignored.
2011-11-21 16:12:22 +01:00
Colomban Wendling
425e0e39be Merge branch 'symbols-tree-update-fixes' 2011-11-21 15:31:49 +01:00
Colomban Wendling
319a6355fe Use GSlice to allocate cached tree iters 2011-11-21 03:52:51 +01:00
Colomban Wendling
ef0b059917 Rewrite symbols tree updating code
Old implementation was not really fitting the updating needs and had a
bug making symbols disappear if they haven't changed but their parent
did (e.g. when a C++ constructor's signature changed).

New implementation does:
1) walk old tree, updating or removing rows;
2) add remaining tags.

It walks less than (new_tags + old_tags + new_tags) in the worst case,
thanks to some hash table-based caching;  and also gets rid of the
"valid" column in the symbols tree, saving a few bytes in memory.

Finally, there is a ~7% performance gain (from 21 to 18ms) upon common
tree updates, sometimes more.
2011-11-21 03:52:42 +01:00
Enrico Tröger
39606dd17c Add Close menu item to the notebook tab menu
This is especially useful if tab close buttons are disabled.
2011-11-20 16:10:02 +01:00
Enrico Tröger
cfa334de74 Fix using the current document on 'Close Other Documents' from the GtkNotebook tab menu
Instead we should use that tab which is under mouse cursor where the user clicked (this might be a
different one than the current document). To be able to do so, we need to handle the right-click signal
per tab not on the GtkNotebook tab area to identify the tab under the mouse cursor.
2011-11-20 16:05:39 +01:00
Enrico Tröger
7aa9160b5f Mention new openro command 2011-11-20 14:48:05 +01:00
Enrico Tröger
22ba6de142 Remove set but unused variable dwStatus (closes #3440276). 2011-11-20 13:39:20 +01:00