Commit Graph

704 Commits

Author SHA1 Message Date
Andrew Borodin
c057b0a02a Fixed radiobutton label for Macintosh line break.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-03 11:39:57 +04:00
Andrew Borodin
f9d6bb075c Ticket #1562: simplfication API of QuickDialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-03 11:39:57 +04:00
Ilia Maslakov
4eba917c0c Added field lb (kind of line break) into WEdit struct
Some cosmetic changes.
Fixed compiling warnings.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-31 13:20:49 +04:00
Andrew Borodin
f023ce440f Ticket #1571: enhancement of mcedit 'Save as' action.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-31 13:20:49 +04:00
Denys Vlasenko
e064bd60df De-inline a few functions which are large
...or not-so-large but nevertheless
contain more than one function call,
or contain loops, or contain if's and at least one
function call, or contain largish objects on stack.

In my experience, in those cases the code size
growth is big enough to not inline stuff.

I guess some of the really big functions
are defined inline because they have, or had in the past,
just one callsite.

But for a few years gcc already does it automatically,
no need to do it by hand and risk code size explosion
when later during code evolution another callsite
is created. This optimization by hand is simply
no longer needed.

Anyway, here is the code size difference:

   text    data     bss     dec     hex filename
 572337   17944  177820  768101   bb865 mc.t5/.obj/src/mc
 567697   17944  177820  763461   ba645 mc.t6/.obj/src/mc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-31 07:12:59 +03:00
Ilia Maslakov
7ff7368c5d * add 'Whole words' option into the viewer 'Search' dialog
related  Ticket #1487
    * fix: some warnings

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-24 19:31:31 +00:00
Ilia Maslakov
b819359535 Ticket #1558 (Search backwards behaves erratically)
fix: backward search. When the cursor set on the begin of the word,
         search found this word, but should not.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-24 07:04:52 +00:00
Ilia Maslakov
7e13f0a5c1 edit/editdraw.c: removed unused variable
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-24 09:31:26 +04:00
Ilia Maslakov
156b79609c Ticket #1487 (Whole words search)
thanx Daniel Borca <dborca@yahoo.com> for the patch

    * fix special_chars in regex.c
    * add whole_words into mc_search_struct
    * add 'Whole words' into 'Search', 'Replace' 'File find' dialogs

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-22 11:24:00 +00:00
Ilia Maslakov
7ef283975b Ticket #1519 (Editor Search/Replace in selection only)
thanx dborca <dborca@yahoo.com> for the patch

    * add option 'In selection' into 'Search' and 'Replace' dialogs
    * changed search and replace algorithm
    * fix search start position if cursor placed beyond marked text.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    * Fixed handle of 'In selection' option in 'search' dialog.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-08-22 10:00:33 +00:00
Ilia Maslakov
68a6495c96 fix: incorrect move/delete block if 'Cursor beyond end of line' swiched on
fix: Enter behavior if 'Cursor beyond end of line' swiched on

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-21 13:42:30 +00:00
Ilia Maslakov
cdd28feca8 fix: mouse selection if line state swiched on.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-21 13:42:29 +00:00
Ilia Maslakov
46eccd1102 Ticket #61 (Misbehaving rectangular select in editor)
fix: incorrect draw rectangular selection if start highlight from first line.
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-21 13:42:29 +00:00
Sergei Trofimovich
985f076e5f Merge commit 'origin/82_sanitize_ro_file_edition'
* commit 'origin/82_sanitize_ro_file_edition':
  Ticket #82: savannah: "save as" retains mode (take 2) provided by dborka
2009-08-19 20:54:15 +03:00
Sergei Trofimovich
c769f7fcd3 Ticket #82: savannah: "save as" retains mode (take 2) provided by dborka
Suppose you have two files, foo and bar. Both files have 444 permissions.
Now edit foo and "Save". It can't save and instead prompt you to "Save As".
Enter bar. It will chmod bar to 644. If we don't touch touch existing file
permissions for "Save", I don't see why we should for "Save As".

Patch adds S_IWUSR only if different_filename and file does not exist yet.
For consistency, it's S_IWUSR not S_IWRITE.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-18 22:28:59 +03:00
Ilia Maslakov
c7001ef7cf Ticket #1484 (Editor bookmarks made visible)
fix: TWS and abnormal chars not highlighted

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-18 11:30:12 +00:00
Daniel Borca
9f2034d376 Ticket #1484 (show bookmark)
* add keyboard shortcuts
    * add showing bookmarks

Signed-off-by: Ilia Maslakov <il.smind@google.com>

    * show '*' for bookmarked line (if line state showed)

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-18 10:05:50 +00:00
Daniel Borca
ea219adec3 Ticket #1412 (vertical selection issue)
fix: vertical selection issue then line state is switch on

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-18 06:13:01 +00:00
Ilia Maslakov
4afee14f94 Ticket #1529 (remove search converter overhead)
* add: void tty_print_anychar (int c)
    * remove superfluous search converter in convert_from_utf_to_current_c,
      convert_from_8bit_to_utf_c add converter to WEdit struct
    * fix: init defaulf codesets
    * fix: segfault on replace if LANG=C

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-18 05:52:40 +00:00
Ilia Maslakov
b536c3e487 add option "Cursor beyond end of line" into "Options\General..." dialog (editor_beyond_eol in ini)
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-17 18:11:20 +00:00
Ilia Maslakov
f4fc6ad79d Ticket #1534 (cool cooledit)
first commit for support drag cursor after end of line

    * change mouse movement, allow place cursor after EOL
    * change vertical select
    * fix: right scroll

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-17 18:11:20 +00:00
Andrew Borodin
bc09ff3888 Ticket #1414: implemented scalable TUI.
Thanks to E.L.K.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-17 15:54:39 +04:00
Ilia Maslakov
2289c62c6e Ticket #267 (etags incorrect get the line number definition)
fix: etags incorrect get the line number of function definition
2009-08-15 11:36:57 +00:00
Ilia Maslakov
bf6d6bafb4 Ticket #364 (Broken keymap after external command)
fix: broken keymap after run external command (like ispell)
2009-08-15 09:09:21 +00:00
Andrew Borodin
509f4d5c4f TTY: fixes after rebase.
Code clean up.
Modification of tty_refresh for NCurses: call doupdate() after refresh()
every time.
tty_draw_box_slow() is not private function of TTY now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-12 21:23:54 +04:00
Andrew Borodin
3318a5fd98 Call repaint_screen() in screen repaint command handling. 2009-08-12 21:23:13 +04:00
Andrew Borodin
30fd7fc34a TTY: modified line drawing. 2009-08-12 21:23:13 +04:00
Andrew Borodin
55e626726c For NCurses, always call doupdate() in tty_refresh(). 2009-08-12 21:23:12 +04:00
Andrew Borodin
86f77f3cb2 New functions.
tty_touch_screen() is used instead of touchwin() function or macro.
tty_set_normal_attrs() is used instead of standend() function or macro.
tty_set_alt_charset() is used instead of acs() and noacs()
functions or macros.
tty_baudrate() is used instead of baudrate() function or macro.
2009-08-12 21:23:12 +04:00
Andrew Borodin
2b7a991fde New functions.
tty_keypad() is used instead of keypad() function or macro.
tty_nodelay() is used instead of nodelay() function or macro.
tty_reset_prog_mode() is used instead of reset_prog_mode() function or macro.
tty_reset_shell_mode() is used instead of reset_shell_mode()
function or macro.
tty_beep() is used instead of beep() function or macro.
2009-08-12 21:23:12 +04:00
Andrew Borodin
c4dc0b22b0 Set dialogs colors is moved from TTY layer to MC core. 2009-08-12 21:23:12 +04:00
Andrew Borodin
fe1adb5f27 tty_print_char() function is used instead of addch() one.
Modified tty_print_char() function for S-Lang library to use it
instead of addch().
2009-08-12 21:23:12 +04:00
Andrew Borodin
26631548d8 Fixed TTY sublayer after rebase to current master. 2009-08-12 21:23:12 +04:00
Andrew Borodin
c12ddff69b Reorganization of TTY color functions. 2009-08-12 21:23:12 +04:00
Andrew Borodin
7a75f8723d Replaced addstr() call to tty_print_string() one. 2009-08-12 21:23:12 +04:00
Andrew Borodin
069aab9ebc Renamed mc_refresh() to tty_refresh(). 2009-08-12 21:22:17 +04:00
Andrew Borodin
ebbf6fbcdc Replaced functions.
attrset() -> tty_setcolor()
move() -> tty_gotoyx()
getyx() -> tty_getyx()
2009-08-12 21:19:20 +04:00
Andrew Borodin
ea0cb38b9e Initial step to split NCurses- and SLang-based TTY layers. 2009-08-12 21:19:20 +04:00
Andrew Borodin
f3730bdc41 Initial step to move TTY layer of MC to separate library. 2009-08-12 21:19:20 +04:00
Daniel Borca
2a586710b7 Ticket #1496 (Search backwards is broken)
fix: file edit/editcmd.c backward search is broken
2009-08-12 15:04:37 +03:00
Sergei Trofimovich
65771004c4 Ticket #82 (savannah: "save as" retains mode) patch by imdagger
Consider following scenario:
$ touch /tmp/foo_file
$ chmod 0444 /tmp/foo_file # readonly for owner
$ mcedit /tmp/foo_file
> 1. edit
> 2. try to save, fail. choose another name: /tmp/foo_file2
> 3. edit
> 4. try to save, fail again!

This patch adds owner write permissions for files, created in
step 2.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-09 19:24:42 +03:00
Daniel Borca
556089fc9f Ticket #1478 (kill word)
add: "kill word" (M-d) shortcut in editor;
2009-08-08 12:48:24 +00:00
Ilia Maslakov
00200124dd Ticket #1411 (issue insertion in overwite mode)
fix: issue insertion in overwite mode
2009-08-06 10:18:08 +00:00
Ilia Maslakov
99c8f6a680 Ticket #1460 (shared search history)
* The sample of the containing text by file search;
    * The sample of search in file mcview;
    * The sample of search in mcedit (search operation);
    * The substituting text in mceditor (replacement operation).

    Author: Alexey Korop

    Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    Editor: search will continue from last search string if SHIFT+F7 hotkey pressed
    at first time (without pressed F7 key).

    Signed-off-by: Slava Zanko <slavazanko@gmail.com>

    add const MC_HISTORY_SHARED_SEARCH into history.h

    Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-05 14:30:08 +00:00
Slava Zanko
f67fcfb94f Fixed excaping of '%' symbol in edit_complete_word_cmd() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-07-17 12:00:03 +03:00
Patrick Winnertz
2a9faab6e4 Fix compiler warning about different signedness of pointers in editcmd.c
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-07-17 12:00:01 +03:00
Patrick Winnertz
bada6849cd Remove unneeded vars in edit/edit.c to avoid compiler warnings
Signed-off-by: Patrick Winnertz <winnie@debian.org>

edit: cleanup: moved variable declaration to begin of block
edit: have_charset: added explicit variable declarations

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>

fix not initialized variable 'cw'
fix variables 'cw', 'utf_ch', make more safety algorithm.
2009-07-17 12:00:01 +03:00
Ilia Maslakov
3596ceeb9f Ticket #1402 (mcedit replace regression)
fix: issue in 'while'
    remove 'Once' button as 'atavism'
    add 'from' field in confirm dialog

Fixed layout of place confirmation dialog in mcedit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-07-16 05:42:36 +00:00
Ilia Maslakov
348ab7303f Ticket #1384 (Whitespace highlighting should be optional)
Add Denis Vlasenko patch for draw options in dialog
    Add hotkey M-S-<minus> as swicher for show tabs and tws
2009-07-07 05:53:52 +00:00
Mikhail S. Pobolovets
9e92f803cc FIX: Completion in editor doesn't work with subwords ended with '_'
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-06-29 14:14:25 +03:00