4134 Commits

Author SHA1 Message Date
Matthew Brush
7193a1161b Minor style changes from last commit 2012-08-10 18:19:54 -07:00
Alexander Eberspächer
a17e37bcd8 Test against the lexer instead of the filetype when computing
indentation. This fixes Cython indentation.
2012-08-10 11:34:56 +02:00
Matthew Brush
9a63e05f63 Change plugin manager's OK button response to GTK_RESPONSE_OK
Used to be GTK_RESPONSE_CANCEL for some reason.
2012-08-09 22:36:03 -07:00
Matthew Brush
bc5b68822d Remove indirection from callback handler 2012-08-09 22:35:16 -07:00
Matthew Brush
e62bec43fc Use g_build_filename() instead of g_strconcat() for paths 2012-08-09 18:21:43 -07:00
Colomban Wendling
c2c6a70515 Open files with leading or trailing whitespaces through the socket 2012-08-08 15:35:46 +02:00
Colomban Wendling
d152c5ce22 Properly indent even if the indenting character isn't the last one
For all languages, this change allows comments at the end of the
checked line, e.g.:

	if 42:  # magic number
		print("I'm indented!")

For languages with braces, it also properly indent if there is code
on the same line as the opening brace, e.g.:

	if (42) { printf("some code here...");
		printf("...but I'm properly indented");
	} else { /* comment! */
		printf("normal block is fine too, of course");
	}

Although this is uncommon (and quite ugly) it's valid and should be
handled properly.
2012-08-07 17:50:17 +02:00
Colomban Wendling
4c2d8998d7 Fix a reference to a function in the documentation 2012-08-07 15:37:38 +02:00
Colomban Wendling
cb54ccf8e1 Merge branch 'scintilla-update' 2012-07-30 17:06:00 +02:00
Colomban Wendling
5110fab0e1 Fix search and replacement of empty matches (again)
f4eb89cd7d79738a9c6c45e29abdd9d15d22e4fd was partially wrong and
removed legitimate re-matches when two different matches ends at the
same position.  Particularly, the replacement changes are reverted.

Interestingly, Perl and Python does not agree on how to do such
replacements.  Python does what I did in the above-cited commit, e.g.
doesn't replace twice if the match end overlaps, but Perl does.
Perl looks more legitimate here since both Python and Perl does find
the overlapping matches when performing a search, so Python is the odd
guy here doing it differently on replace than it does upon search.

For example, replacing using the pattern "a?(?=b)" and the replacement
string "_":

	Python: ababcdb -> _b_bcd_b
	Perl:   ababcdb -> __b__bcd_b

But finding using the same pattern on the same input gives the same
results on both:

	Python: ababcdb -> ['a', '', 'a', '', '']
	Perl:   ababcdb -> ['a', '', 'a', '', '']

Anyway, GLib and us claim to support "Perl-compatible regular
expressions", so we gotta follow Perl, especially in such doubtful
situations.
2012-07-28 19:23:37 +02:00
Colomban Wendling
95d767f873 Document sci_get_lexer()
This function is part of the plugin API but missed its documentation,
leading to it not appearing in the generated API documentation.
2012-07-28 00:32:26 +02:00
Colomban Wendling
f4eb89cd7d Fix search and replacement of empty matches
Regular expressions might match empty ranges, which weren't handled
properly, but generally simply omitted.

For example, the regular expression "^$" (empty line) never matched
because we assumed empty results were not interesting, and actually
needed more care in the code.  Alike, an expression matching only on
its lookahead part, like "a?(?=b)" against "b", would stop further
search, although it could even match a non-empty range if "ab" is
present later in the input.  This last kind of expressions also lead
to double-replacement because they first matched "ab" and then "b"
alone when re-matching after the "a" replacement.

This commit fixes:
 * searching when the matched range is empty;
 * step-by-step search when matching an empty range;
 * double replacement when the pattern re-matches an empty range
   straight after a replacement;
 * replacement to and empty string when the matching an empty range.

A know issue though is the step-by-step replacement that won't replace
an empty match but rather find the next match.
2012-07-28 00:32:26 +02:00
Colomban Wendling
a091238617 Fix searching out of document range
If a search matched the very last character of the document, next
search attempt started out of the document bounds.  This even lead
to an infinite loop due to an improper sanity check.

By the way, this fixes matching of contiguous results, as the next
search used to improperly skip one character after the result.
Although this looks like a huge issue, it was actually visible almost
only on the match count since the whole matching line was printed.
2012-07-28 00:32:26 +02:00
Nick Treleaven
f90bdc5957 Only set Find in Files directory once per-document
Use the current document's directory unless the directory field has
already been edited and the current document has not changed.
Otherwise, prepend the current document's directory to the drop-down
history in case it is wanted.

This is useful to avoid losing the edited directory when it is less
likely the user wants to use the current document's directory.
2012-07-26 16:13:34 +01:00
Matthew Brush
5fff1e69c2 Add NULL guard for reloading "untitled" documents
Previously it was using a GLIB assertion which shouldn't be used
to detect a normal condition and so it caused a warning on the
console output when clicking "Reload" with an "untitled" document.
2012-07-24 17:56:29 -07:00
Colomban Wendling
d11f9a51b9 Rely on GModule for adding or not the --export-dynamic linker flag
We explicitly use GModule's .pc since 7b2f0fe, and it provides the
appropriate flag: we don't need to add it ourselves anymore.  Moreover,
since this flag is not needed (nor available) on all platforms (e.g.
Windows or MacOS X), it is safer to let GModule deal with adding it
anyway.
2012-07-17 23:09:00 +02:00
Colomban Wendling
4cdcaa22e6 Update for new Scintilla styles 2012-07-14 15:30:03 +02:00
Nick Treleaven
8d26450f07 Add status bar warning if Windows spawn timed out 2012-07-09 13:31:04 +01:00
Colomban Wendling
deb5f3542b Bump API version to reflect Scintilla's SCI_{GET,SET}USEPALETTE removal
Scintilla deprecated SCI_GETUSEPALETTE and SCI_SETUSEPALETTE messages,
and since we don't build with deprecated API support they aren't
available anymore.
2012-07-09 01:07:52 +02:00
Nick Treleaven
5af4dab5f0 Fix showing project name in sidebar documents
This was broken if the base path ended with a directory separator.
2012-07-06 13:17:54 +01:00
Nick Treleaven
74959b9cb9 Support MSYS=1 to enable building with MSYS; use $/ instead of DIRSEP
Defining MSYS=1 is cleaner than requiring users to define CP, RM, etc.
2012-07-04 17:13:14 +01:00
Nick Treleaven
65fe863691 Use PREFIX=C:/libs and minor cleanup (Windows makefiles)
This PREFIX works on both cmd.exe and MSYS, whereas backslash confuses
MSYS.
Use copy /y in doc/makefile.win32.
Remove unused targets binclean, exec.
2012-07-04 16:47:38 +01:00
Nick Treleaven
c72dce06a5 Merge remote-tracking branch 'origin/master' into tm/tree-refactoring
Conflicts:
	makefile.win32
	src/makefile.win32
2012-07-04 12:15:53 +01:00
Colomban Wendling
a6c0dc0978 Merge branch 'scintilla-update' 2012-06-30 20:13:56 +02:00
Colomban Wendling
298ce94c5d Update for new Scintilla styles 2012-06-26 23:26:30 +02:00
Dimitar Zhekov
08d751daf2 Fix building with makefile.win32 from Windows command prompt, not MSYS 2012-06-26 21:39:56 +01:00
Nick Treleaven
40da14b5b1 Add keybinding for 'Go to Start of Display Line' (#3182425) 2012-06-25 14:31:36 +01:00
Colomban Wendling
e9d61aa7e5 Post release version bump 2012-06-18 19:16:05 +02:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Nick Treleaven
edeaa521a2 Show info message if selection style is invisible, not warning 2012-06-08 13:28:07 +01:00
Nick Treleaven
9f99b4f55a Merge remote-tracking branch 'origin/master' into tm/tree-refactoring 2012-06-07 16:32:32 +01:00
Nick Treleaven
18cec1fb81 Fix Windows build 2012-06-06 15:21:00 +01:00
Nick Treleaven
6f0d015ed2 Fix documentation using old directory tagmanager/include 2012-06-06 15:19:34 +01:00
Matthew Brush
4e5a7231bf Always select current editor font when showing the font dialog
Previously, choosing another font and then pressing cancel would keep
the font selected rather than resetting it to the current editor font
because the dialog is not destroyed between showings.
2012-06-04 14:29:23 -07:00
Matthew Brush
9d7ff79a9a Restore secondary clear icon functionality in Preferences dialog
Ensures all entries that get a clear icon added to the secondary position
also set the secondary icon to be activatable. This was probably
introducted during the Glade switch and could be fixed in the Glade file
but this fix ensures that even hard coded entries will always have their
clear icon activatable.
2012-06-04 14:18:49 -07:00
Frank Lanitz
304f3a8b47 Adding a small note pointing out that setting a default keybinding might not the best idea for plugin maintainers 2012-06-04 16:19:11 +10:00
Nick Treleaven
7b3b65e27d Add workaround for users with an invisible selection style
This is likely to be the case for any users that copied the system
selection style line as this was incorrectly set before, but not
applied.
2012-06-03 18:04:03 +01:00
Nick Treleaven
dd87e318cf Fix applying default selection colors after editing 'selection' style
Default colors were not restored when disabling the override flags.
2012-06-03 17:38:30 +01:00
Frank Lanitz
58a03352b6 Enable two strings for translation. Patch by gymka 2012-06-03 17:48:30 +02:00
Colomban Wendling
1d6efd332e Remove an useless NULL check and error message
gtk_builder_new() cannot fail but in case of memory exhaustion, where
the GLib allocator will abort anyway.
2012-06-03 16:56:31 +02:00
Colomban Wendling
e98f11cbc5 Display warnings, critical and error messages even if not in verbose mode 2012-06-03 16:50:57 +02:00
Colomban Wendling
70e0f6eaa0 Fix verbose output with GLib 2.32 and newer
Since GLib 2.32, messages logged with levels INFO and DEBUG aren't
output by the default log handler unless the G_MESSAGES_DEBUG
environment variable contains the domain of the message or is set to
the special value "all".

Since we use INFO level messages for verbose mode, we need to make
sure this environment variable is properly set when in verbose mode.
2012-06-03 16:47:18 +02:00
Colomban Wendling
05e5f756c1 Merge branch 'master' into tm/tree-refactoring 2012-05-31 22:19:32 +02:00
Colomban Wendling
c30936028e When not sorting the file list, don't preserve read order
If the caller doesn't want the list to be sorted, there is no need to
preserve the order in which the files were actually read, since that
order is undefined anyway.
2012-05-31 21:58:37 +02:00
Colomban Wendling
13a7fb521e Don't sort tags file list since the order doesn't matter 2012-05-31 21:58:14 +02:00
Colomban Wendling
6f62a55370 g_slist_prepend() is faster than _append() and the order doesn't matter 2012-05-31 21:58:08 +02:00
Nick Treleaven
fa5929ecbe Fix clearing styles in sci_set_lexer() 2012-05-30 13:03:42 +01:00
Colomban Wendling
c84d486472 GeanyWrapLabel: fix rendering issues
GtkLabel may re-create its PangoLayout between calls leading to the
final layout used for rendering not to be set up with the appropriate
values for our sizing.  Then, re-set up the layout each time we have to
deal with it and straight before GtkLabel renders it.
2012-05-30 01:50:08 +02:00
Colomban Wendling
6c15dd4724 Drop GEANY_WRAP_LABEL_GET_PRIVATE() macro 2012-05-30 01:50:08 +02:00
Colomban Wendling
232919a16d GeanyWrapLabel: make sure we ask for the height matching our width
With this patch, we make sure the height we query is the one matching
the width we stored and not a newer or older one.

This only fixes the sizing problem, the rendering issue visible in
some situations is still present.

This fix is replicated from the fix in libview's WrapLabel, see
http://view.svn.sourceforge.net/viewvc/view/trunk/libview/libview/wrapLabel.cc?revision=132&view=markup
It also includes the "fix for the fix",
http://view.svn.sourceforge.net/viewvc/view/trunk/libview/libview/wrapLabel.cc?revision=135&view=markup
2012-05-30 01:44:49 +02:00