6381 Commits

Author SHA1 Message Date
Colomban Wendling
f2f22d34ab Parse C++11 enums with type specifier
Part of #3578557.
2012-10-22 22:38:12 +02:00
Colomban Wendling
a77785e378 Set style for SCE_C_STRINGRAW (C++11 raw strings)
Part of #3578557.
2012-10-20 14:07:13 +02:00
Colomban Wendling
f04df056cd Fix parsing of C++11 final classes
Closes #3577559.
2012-10-19 21:39:38 +02:00
Colomban Wendling
b626cc93e3 ReStructuredText: fix parsing of titles containing UTF-8 characters
If a title contained multi-byte UTF-8 characters, it wasn't properly
recognized due to the title being longer (in bytes) than the underline.
So, fix the title length computation to properly count the characters,
not the bytes.

Note that this fix only handles ASCII, one-byte charsets and UTF-8, it
won't help with other multi-bytes encodings.  However, the whole parser
expects ASCII-compatible encoding anyway, and in most situations it
will be fed the Geany's UTF-8 buffer.

Closes #3578050.
2012-10-18 17:15:17 +02:00
Colomban Wendling
6e8e0c7bfb Fix display of non-ASCII tags in the symbols tree for non-UTF-8 files
We used to convert the tags from the file encoding to UTF-8, but since
we parse directly from our UTF-8 buffer, all tags are UTF-8, which lead
to an improper conversion.
2012-10-18 16:55:33 +02:00
Matthew Brush
49d88f0cd5 Don't ignore custom M4 files in m4/ directory 2012-10-16 16:58:32 -07:00
Lex
306eaab391 Alter default and document icon setting
Previous default value prevented the preceding commit from working
(by default), oops.
2012-10-15 11:56:03 +11:00
Lex
6897cd49c6 Make use of theme icon a various pref.
Some users want the theme icon, some dislike the icon provided by
their theme and want the traditional Geany icon.

This makes that choice a various pref.  Used a standalone global
to avoid impacting the plugin interface and CommandLineOptions
and GeanyStatus didn't make sense.
2012-10-14 13:05:11 +11:00
Matthew Brush
4c7ca69be0 Prefer to use Geany icon from theme over inline one
Note that no attempt is made to handle when the icon theme is changed
to update Geany's window icon (ex. using the style-set signal).
2012-10-13 15:37:00 -07:00
Colomban Wendling
220ace841c Fix uncommenting multi-line comments when cursor is on a delimiter
If the cursor was inside one of the comment's delimiters, the code used
to look for another delimiter, leading to removing previous comment's
start.  Moreover, the code assumed the delimiter will always be found,
leading to improper deletions if a delimiter could not be found (either
because of the above problem or because the comment wasn't terminated).

Also, the code used document_find_text() which, if the searched text
cannot be found on the requested direction, either wraps or asks the
user whether to wrap.  Wrapping is wrong if there is more than one
single comment in the file, and the dialog is confusing for the use
since she didn't ask for it.

So, rework the code for it to correctly find the delimiters, and not
to wrap search or ask the user.  It is also simpler by reusing some
already existing code.
2012-10-12 20:40:38 +02:00
Matthew Brush
206c39cb6a Fix reshowing calltip after autoc list closed
Using default priority causes Geany's reshowing idle handler to run
before Scintilla's, changing priority to low in hopes of making it
run after.
2012-10-11 23:07:02 -07:00
Colomban Wendling
5bb0ca5a83 Fix cursor position after comment toggling with no selection
The implementation drops the non-selection code paths and simply makes
sure both caret and anchor are placed at the same position if there
was no selection.  This avoids having two completely different code
paths for things that are very similar -- and alternative code paths
were buggy.

Closes #3576431.
2012-10-12 00:15:29 +02:00
Lex Trotman
42b3629aaf Fix sign comparison warnings
GTK uses a signed page_nr parameter to callback draw_page despite
describing it as 0 based, cast it to unsigned for comparisons to
array len which is also unsigned.
2012-10-09 13:56:13 +11:00
Colomban Wendling
eeddd6f720 Move custom styles to a resource file 2012-10-08 17:51:19 +02:00
Colomban Wendling
3070738df8 Make wordchars have precedence over whitespacechars
This makes the "wordchars" setting from filetypes.common and each
specific filetype override filetype.common's "whitespace_chars"
setting, rather than it overriding filetype-specific "wordchars".

This makes the it easy to chose filetype-specific "wordchars", where
before user had not only to update this setting, but also the
filetype.common "whitespace_chars" setting if it listed one or more of
the new characters for the change to actually have an effect -- and
changing "whitespace_chars" for every filetype.

Closes #3429368.
2012-10-06 01:32:54 +02:00
Colomban Wendling
565c917688 Consider dash (-) when looking for the word to complete for CSS 2012-10-06 00:55:03 +02:00
Colomban Wendling
2297badbd7 Use "scala" extension for Scala
Closes #3574723.
2012-10-05 12:43:10 +02:00
Colomban Wendling
64a47b9cb6 Allow to switch message window orientation to place it on the right 2012-10-01 21:38:56 +02:00
trongthanh
474e60b6fa Add more CSS3 keywords 2012-09-30 11:13:43 -07:00
trongthanh
85cb6d527c Improve CSS highlighting 2012-09-30 11:08:13 -07:00
trongthanh
e70d9e5e05 Fix JavaScript ident/keyword highlighting in HTML filetype 2012-09-30 10:57:38 -07:00
Colomban Wendling
2c6c210c6f Fix detection of keywords when followed by a semicolon
Closes #2130612.
2012-09-30 15:46:59 +02:00
Colomban Wendling
c1a7b1b475 Fix various packing issue affecting GTK3 but compatible with GTK2 2012-09-28 18:06:58 +02:00
Colomban Wendling
972b34e49a Keep caret and anchor position upon indent and unindent
Closes #3167355.
2012-09-28 16:19:06 +02:00
Frank Lanitz
d6bbdab166 Update of Basque translation 2012-09-26 21:07:59 +02:00
Frank Lanitz
00ccac5b78 Update of Italian translation 2012-09-25 19:58:39 +02:00
Colomban Wendling
bf233bc055 JavaScript parser: create class tag for variable with children methods
If we generated methods, properties or class children tags for a
variable, generate a class tag for the variable itself so the children
aren't orphaned.
2012-09-25 16:48:10 +02:00
Colomban Wendling
5df551b1ce JavaScript parser: fix parsing non-method properties
If a property value had more than one token, the parser choked on it
and failed to parse further properties of the object.  Fix that by
properly skipping the property's value.  If that value is a sub-object,
parse it recursively.

Closes #3470609.
2012-09-25 16:47:42 +02:00
Colomban Wendling
dc6e4f2723 JavaScript parser: lowercase "object" isn't a keyword
Closes #3036476.
2012-09-25 02:11:58 +02:00
Colomban Wendling
b9ca95c381 JavaScript parser: fix some unterminated statement corner case issues
This fixes parsing of the following unterminated statements:

	if () {
		foo = 42
	}

	if () {
		foo = new Object()
	}

	if () {
		foo = ({a:1,b:2})
	}
2012-09-25 01:31:11 +02:00
Colomban Wendling
205bab83d7 JavaScript parser: properly consume closing brace after a block in findCmdTerm() 2012-09-25 01:29:33 +02:00
Colomban Wendling
74890cc308 JavaScript parser: Simplify parseJfFile() code (no functional changes) 2012-09-24 19:51:37 +02:00
Colomban Wendling
297bca3799 JavaScript parser: Don't drop the token after an unbraced if
If an `if` haven't had braces, the code used to check itself for an
`else` after it, eating the next token if it wasn't actually an `else`.

So, drop the check for the else altogether since parseLine() handles
`else`s by calling parseIf() anyway.

This fixes constructs like:

	if (foo)
		bar();
	function baz() {
		// ...
	}

Closes #3568542.
2012-09-24 19:46:48 +02:00
Oleg Eterevsky
66888d580f In ctags JavaScript parser fix recognizing functions inside methods 2012-09-24 18:20:53 +02:00
Colomban Wendling
effc8ef86f Add proper scope for JS tags including their own context
This makes `Foo.bar = function()` properly report a function tag "bar"
with scope "Foo" rather than a function tag "Foo.bar" with no scope.

Part of #3570192.
2012-09-24 12:25:36 +02:00
Colomban Wendling
be45924f7c JavaScript parser: don't set token position information again and again
There is no need to set the token position information in the loop
searching for the initial token character, simply do that when we
finally found the token start.
2012-09-22 18:13:07 +02:00
Colomban Wendling
772509e898 ctags: fix improper use of "const" type qualifier
The external declaration of "File" in read.h (defined in read.c) was
improperly tagged as "const" for it not to be modifiable outside of
read.c.  Although it is good to protect this global variable against
improper modification, the use of "const" here makes it perfectly valid
for the compiler to assume that the fields in this structure never
changes during runtime, thus allowing it to do optimizations on this
assumption.  However, this assumption is wrong because this structure
actually gets modified by many read.c's functions, and thus possibly
lead to improper and unexpected behavior if the compiler sees a window
for optimizing fields access.

Moreover, protecting "File" as it was with the "const" type qualifier
required a hack to be able to include read.h in read.c since "const"
and non-"const" declarations conflicts.

Actually, at least the JavaScript parser did suffer of the issue,
because it calls getSourceLineNumber() macro (expanding to a direct
"File" member access) several times in one single function, making it
easy for the compilers to cache the value as an optimization.  Both GCC
and CLang showed this behavior with optimization enabled.  As a result,
the line numbers of JavaScript tags were often incorrect.
2012-09-22 17:52:29 +02:00
Lex Trotman
9ef34bbe0c Fix pointer warning
GCC 4.7.1 gives a incompatible pointer warning because gtk_adjustment_new
returns a GObject* not a GtkAdjustment* (new compiler default).
2012-09-22 16:05:51 +10:00
Lex Trotman
5ef6e1627c Fix multiline comments at end of file
Multiline comments did not work at end of file because there is no
style there so also check if at end of file as well as style.
Closes #3026691
2012-09-22 14:13:14 +10:00
Lex Trotman
fbb89f523a Remove illegal signal handling
The SIGTERM handler called the standard exit callback which uses
functions that are illegal in signal handlers.  Commented out as
a prelude to full removal if no use case can be made.
2012-09-22 13:40:33 +10:00
Lex Trotman
e5e3760157 Use faster squiggle underlining
Geany performance suffered with a lot of error underlining visible.
Matthew Brush developed an improved implementation that was accepted
into Scintilla, this selects that implementation.
2012-09-22 12:47:29 +10:00
Colomban Wendling
877b0477c4 Set scope information for JavaScript tags
Instead of adding the scope to the tag name, properly add it as the
tag's scope.

Closes #3570192.
2012-09-22 01:27:11 +02:00
Colomban Wendling
2d83a85eb7 Update NEWS for a few recently fixed bugs 2012-09-17 23:15:11 +02:00
Colomban Wendling
b886ac1b2e Merge branch 'improve-scope-detection' 2012-09-17 22:59:52 +02:00
Colomban Wendling
8289e8f962 Report scope including classes, namespaces and alike
Don't only match the current function as the current scope, but also
classes, namespaces and others containers.

Closes #1996778.
2012-09-17 22:51:36 +02:00
Colomban Wendling
491a45f614 Improve symbols_get_current_function() a lot and make it more flexible
Finding the current function now better handles the case the current
line is after a function but outside its scope, and many other issues
the scope reporting had.
2012-09-17 22:50:32 +02:00
Colomban Wendling
9d2dab8fcf Fix an off-by-one issue in sci_get_position_from_line()
Scintilla counts lines from 0 but TagManager from 1, so convert them.
2012-09-17 20:22:52 +02:00
Colomban Wendling
d83bd40938 Add tm_get_current_tag() 2012-09-17 20:07:45 +02:00
Colomban Wendling
afb1eaaa01 Remove improper caching of the current function
The code assumed that if both old and new fold levels were above the
minimal function fold level the function couldn't have been changed,
which is wrong if a function can appear both inside and outside another
fold level (e.g. inside or outside a class).
2012-09-17 14:44:33 +02:00
Colomban Wendling
adbd162c7b Also consider tags up to date if realtime parsing is active
This makes symbols_get_current_function() more accurate by using TM
data even on a modified file if realtime tag parsing is enabled, thus
if the data has reasonable chances to be correct.
2012-09-17 14:44:33 +02:00