Commit Graph

25 Commits

Author SHA1 Message Date
Andrew Borodin
66da276200 Ticket 3069: fix of case-sensitive search
...if file encoding and locale are different.

Example: locale is KOI8-R, file encoding is UTF-8. Note: those encodings
are not same.

File content is following (in Russian):

йцукен
Йцукен

The difference is in first line char only: Й (lowercase letter) and й
(uppercase letter).  The search of Ê gives the result Й independently of
case sensitivity. й isn't found.
If switch "All charsets" on, nothing is found.

The main idea of fix is modification of search API to allow set of search
pattern charset and use if within search engine.
Old API:
mc_search_new (pattern, pattern_len);
New API:
mc_search_new (pattern, pattern_len, pattern_charset);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:31 +04:00
Andrew Borodin
de2a934b37 lib/search/search.c: cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin
4f16d7e8f0 Ticket #3026: Find File: "All charsets" options don't work.
(mc_search_prepare): use cp_display not cp_source to convert text to all
available charsets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin
31bacf56c9 Use G_N_ELEMENTS macro to calculate of array size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 10:58:14 +03:00
Andrew Borodin
5e070286b1 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 16:22:23 +04:00
Andrew Borodin
e574972d58 Fix crash when user menu is called in editor with no filename.
(mc_search): immediately return FALSE if str is NULL.
(mc_search_run): immediately return FALSE if user_data is NULL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:35 +04:00
Andrew Borodin
562ef41b15 Ticket #2842: change hotkey for Normal search mode.
In Search dialog in mcedit M-n hotkey was used for normal search mode.
Therefore, M-n as HistoryPrev in the input line was in accessible.

Change hotkey for normal seach mode to M-r. Use this hotkey for normal diff
mode in mcdiffviewer to unify i18n resources.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-08 16:27:48 +04:00
Andrew Borodin
e7fb3526f3 Core, mceditor, mcviewer and mcdiffviewer code tweak and cleanup
...in case of build with --disable-charset option.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-25 16:58:57 +04:00
Andrew Borodin
a395218ffb Ticket #2704: added hotkeys for search types.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-12-30 17:49:16 +03:00
Slava Zanko
0138645541 Ticket 1551: Update GPL version from 2 to 3
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-18 14:08:34 +03:00
Slava Zanko
045debaa8a Moved charsets.[ch] from src to lib directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Andrew Borodin
1192d34bd1 Clean up some empty lines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Slava Zanko
feb733663f Code indentation in lib directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:27:20 +03:00
Andrew Borodin
4892044e71 Remove extra check before mc_search free() call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:20 +03:00
Andrew Borodin
b6fd832a8a Create strings with small preallocated sizes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:48:39 +02:00
Slava Zanko
8d59d66188 Removed mc_search_cond_t->len (used mc_search_cond_t->str->len instead).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-01 15:48:38 +02:00
Andrew Borodin
bfbac0c5d8 Reimplemened codepages storage using GPtrArray.
Added capability to load codepage list from /usr/share/mc/mc.charsets
and /etc/mc/mc.charsets and merge them then.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:25:53 +04:00
Andrew Borodin
ec7b039588 Ticket #2243: code cleanup before 4.7.3 release.
Removed unneeded breaks from switch operators.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Andrew Borodin
e70db42deb Grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:13 +04:00
Slava Zanko
25155c311a Move all interface includes from subdirs lib/*/*.h into lib/*.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
93dbc46e9c Reorganization of sources. Part 1.
* moved src/global.h into lib/global.h
 * moved glibcompat.[ch] from ./src/ into ./lib/
 * moved fs.h from ./src/ into ./lib/

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
39d5b94cac Reorganized pathes to files in '#include' directives 2010-01-26 10:30:22 +02:00
Slava Zanko
ddb9ada2e8 Changes in sources matched with mass movement of $(srcdir)/src/*/ into $(srcdir)/lib/*/
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00
Slava Zanko
4f11e4b665 Massive moved some dirs from $(srcdir)/src into $(srcdir)/lib
Moved subdirs:
 * filehighlight
 * mcconfig
 * search
 * skin
 * tty

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00