Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
593b9dd2
Kaydet (Commit)
593b9dd2
authored
Agu 09, 2014
tarafından
Colomban Wendling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'single-line-regex'
üst
604e05cb
83deafed
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
8 deletions
+52
-8
geany.txt
doc/geany.txt
+35
-0
callbacks.c
src/callbacks.c
+3
-3
document.c
src/document.c
+3
-3
keybindings.c
src/keybindings.c
+2
-2
search.c
src/search.c
+0
-0
search.h
src/search.h
+9
-0
No files found.
doc/geany.txt
Dosyayı görüntüle @
593b9dd2
...
...
@@ -1231,6 +1231,10 @@ The syntax for the *Use regular expressions* option is shown in
.. note::
*Use escape sequences* is implied for regular expressions.
The *Use multi-line matching* option enables multi-line regular
expressions instead of single-line ones. See `Regular expressions`_ for
more details on the differences between the two modes.
The *Use escape sequences* option will transform any escaped characters
into their UTF-8 equivalent. For example, \\t will be transformed into
a tab character. Other recognized symbols are: \\\\, \\n, \\r, \\uXXXX
...
...
@@ -1451,10 +1455,17 @@ options`_). The syntax is Perl compatible. Basic syntax is described
in the table below. For full details, see
http://www.geany.org/manual/gtk/glib/glib-regex-syntax.html.
By default regular expressions are matched on a line-by-line basis.
If you are interested in multi-line regular expressions, matched against
the whole buffer at once, see the section `Multi-line regular expressions`_
below.
.. note::
1. The *Use escape sequences* dialog option always applies for regular
expressions.
2. Searching backwards with regular expressions is not supported.
3. The *Use multi-line matching* dialog option to select single or
multi-line matching.
**In a regular expression, the following characters are interpreted:**
...
...
@@ -1531,6 +1542,30 @@ $ This matches the end of a line.
distributed under the `License for Scintilla and SciTE`_.
Multi-line regular expressions
``````````````````````````````
.. note::
The *Use multi-line matching* dialog option enables multi-line
regular expressions.
Multi-line regular expressions work just like single-line ones but a
match can span several lines.
While the syntax is the same, a few practical differences applies:
======= ============================================================
. Matches any character but newlines. This behavior can be changed
to also match newlines using the (?s) option, see
http://www.geany.org/manual/gtk/glib/glib-regex-syntax.html#idp5671632
[^...] A negative range (see above) *will* match newlines if they are
not explicitly listed in that negative range. For example, range
[^a-z] will match newlines, while range [^a-z\\r\\n] won't.
While this is the expected behavior, it can lead to tricky
problems if one doesn't think about it when writing an expression.
======= ============================================================
View menu
---------
...
...
src/callbacks.c
Dosyayı görüntüle @
593b9dd2
...
...
@@ -837,14 +837,14 @@ static void find_usage(gboolean in_session)
if
(
sci_has_selection
(
doc
->
editor
->
sci
))
{
/* take selected text if there is a selection */
search_text
=
sci_get_selection_contents
(
doc
->
editor
->
sci
);
flags
=
SC
FIND_MATCHCASE
;
flags
=
GEANY_
FIND_MATCHCASE
;
}
else
{
editor_find_current_word_sciwc
(
doc
->
editor
,
-
1
,
editor_info
.
current_word
,
GEANY_MAX_WORD_LENGTH
);
search_text
=
g_strdup
(
editor_info
.
current_word
);
flags
=
SCFIND_MATCHCASE
|
SC
FIND_WHOLEWORD
;
flags
=
GEANY_FIND_MATCHCASE
|
GEANY_
FIND_WHOLEWORD
;
}
search_find_usage
(
search_text
,
search_text
,
flags
,
in_session
);
...
...
@@ -934,7 +934,7 @@ G_MODULE_EXPORT void on_find_next1_activate(GtkMenuItem *menuitem, gpointer user
G_MODULE_EXPORT
void
on_find_previous1_activate
(
GtkMenuItem
*
menuitem
,
gpointer
user_data
)
{
if
(
search_data
.
flags
&
SC
FIND_REGEXP
)
if
(
search_data
.
flags
&
GEANY_
FIND_REGEXP
)
/* Can't reverse search order for a regex (find next ignores search backwards) */
utils_beep
();
else
...
...
src/document.c
Dosyayı görüntüle @
593b9dd2
...
...
@@ -1491,7 +1491,7 @@ static void replace_header_filename(GeanyDocument *doc)
ttf
.
chrg
.
cpMax
=
sci_get_position_from_line
(
doc
->
editor
->
sci
,
4
);
ttf
.
lpstrText
=
filebase
;
if
(
search_find_text
(
doc
->
editor
->
sci
,
SCFIND_MATCHCASE
|
SC
FIND_REGEXP
,
&
ttf
,
NULL
)
!=
-
1
)
if
(
search_find_text
(
doc
->
editor
->
sci
,
GEANY_FIND_MATCHCASE
|
GEANY_
FIND_REGEXP
,
&
ttf
,
NULL
)
!=
-
1
)
{
sci_set_target_start
(
doc
->
editor
->
sci
,
ttf
.
chrgText
.
cpMin
);
sci_set_target_end
(
doc
->
editor
->
sci
,
ttf
.
chrgText
.
cpMax
);
...
...
@@ -2043,7 +2043,7 @@ gint document_find_text(GeanyDocument *doc, const gchar *text, const gchar *orig
return
-
1
;
/* Sci doesn't support searching backwards with a regex */
if
(
flags
&
SC
FIND_REGEXP
)
if
(
flags
&
GEANY_
FIND_REGEXP
)
search_backwards
=
FALSE
;
if
(
!
original_text
)
...
...
@@ -2124,7 +2124,7 @@ gint document_replace_text(GeanyDocument *doc, const gchar *find_text, const gch
return
-
1
;
/* Sci doesn't support searching backwards with a regex */
if
(
flags
&
SC
FIND_REGEXP
)
if
(
flags
&
GEANY_
FIND_REGEXP
)
search_backwards
=
FALSE
;
if
(
!
original_find_text
)
...
...
src/keybindings.c
Dosyayı görüntüle @
593b9dd2
...
...
@@ -1466,9 +1466,9 @@ static gboolean cb_func_search_action(guint key_id)
text
=
get_current_word_or_sel
(
doc
,
TRUE
);
if
(
sci_has_selection
(
sci
))
search_mark_all
(
doc
,
text
,
SC
FIND_MATCHCASE
);
search_mark_all
(
doc
,
text
,
GEANY_
FIND_MATCHCASE
);
else
search_mark_all
(
doc
,
text
,
SCFIND_MATCHCASE
|
SC
FIND_WHOLEWORD
);
search_mark_all
(
doc
,
text
,
GEANY_FIND_MATCHCASE
|
GEANY_
FIND_WHOLEWORD
);
g_free
(
text
);
break
;
...
...
src/search.c
Dosyayı görüntüle @
593b9dd2
This diff is collapsed.
Click to expand it.
src/search.h
Dosyayı görüntüle @
593b9dd2
...
...
@@ -61,6 +61,15 @@ enum GeanyFindSelOptions
GEANY_FIND_SEL_AGAIN
};
enum
GeanyFindFlags
{
GEANY_FIND_MATCHCASE
=
1
<<
0
,
GEANY_FIND_WHOLEWORD
=
1
<<
1
,
GEANY_FIND_WORDSTART
=
1
<<
2
,
GEANY_FIND_REGEXP
=
1
<<
3
,
GEANY_FIND_MULTILINE
=
1
<<
4
};
/** Search preferences */
typedef
struct
GeanySearchPrefs
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment