Ticket #2567 (assigned defect)

Opened 13 years ago

Last modified 7 years ago

Syntax highlighting disappears after undo operation.

Reported by: laborer Owned by:
Priority: minor Milestone: Future Releases
Component: mcedit Version: 4.7.5.2
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Steps to reproduce:

  1. Create trivial 111.cpp file with text
        #ifdef SOME
     ddd
    
  2. mcedit 111.cpp
  3. Move cursor to position 2,2
  4. backspace, backspace, ctrl+u
  5. subj

Also look at the screenshots.

Attachments

before.png (8.7 KB) - added by laborer 13 years ago.
normal syntax highlighting
after.png (8.3 KB) - added by laborer 13 years ago.
Syntax highlighting is absent

Change History

Changed 13 years ago by laborer

normal syntax highlighting

Changed 13 years ago by laborer

Syntax highlighting is absent

comment:1 Changed 13 years ago by laborer

Also,

tphost tmp # LANG=en mc -V
GNU Midnight Commander 4.7.5.2
Built with GLib 2.28.6
Using the ncurses library
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
tphost tmp # 
tphost tmp # uname -a
Linux tphost 2.6.38.5 #1 SMP Tue May 3 23:26:29 MSD 2011 x86_64 Intel(R) Core(TM) i3 CPU M 390 @ 2.67GHz GenuineIntel GNU/Linux
tphost tmp # cat /etc/gentoo-release 
Gentoo Base System release 2.0.2

comment:2 Changed 13 years ago by laborer

  • Branch state set to no branch

Any comments or feedback?

comment:3 Changed 13 years ago by angel_il

ok, i try fix it...

comment:4 Changed 13 years ago by angel_il

  • Owner set to angel_il
  • Status changed from new to accepted

comment:5 Changed 13 years ago by angel_il

2 laborer, try follow

diff --git a/src/editor/edit.c b/src/editor/edit.c
index 2bc97fd..2a15df2 100644
--- a/src/editor/edit.c
+++ b/src/editor/edit.c
@@ -1261,10 +1261,12 @@ edit_do_undo (WEdit * edit)
         case BACKSPACE:
         case BACKSPACE_BR:
             edit_backspace (edit, 1);
+            count++;
             break;
         case DELCHAR:
         case DELCHAR_BR:
             edit_delete (edit, 1);
+            count++;
             break;
         case COLUMN_ON:
             edit->column_highlight = 1;
@@ -1274,9 +1276,15 @@ edit_do_undo (WEdit * edit)
             break;
         }
         if (ac >= 256 && ac < 512)
+        {
             edit_insert_ahead (edit, ac - 256);
+            count++;
+        }
         if (ac >= 0 && ac < 256)
+        {
             edit_insert (edit, ac);
+            count++;
+        }
 
         if (ac >= MARK_1 - 2 && ac < MARK_2 - 2)
         {

comment:6 Changed 13 years ago by laborer

This does not solve the problem.
Tested with mc 4.7.5.2 with some modification(no BACKSPACE_BR/DELCHAR_BR) and latest git version.

comment:7 Changed 13 years ago by angel_il

this

         if (ac >= 256 && ac < 512)
+        {
             edit_insert_ahead (edit, ac - 256);
+            count++;
+        }
         if (ac >= 0 && ac < 256)
+        {
             edit_insert (edit, ac);
+            count++;
+        }

must be enough

Version 0, edited 13 years ago by angel_il (next)

comment:8 Changed 13 years ago by angel_il

This does not solve the problem.

what do you mean.

this solve for your testcase... or not ?

comment:9 Changed 13 years ago by laborer

what do you mean.

I have not noticed any changes with this patch. Maybe I'm wrong, but i do not know. It seems not.

this solve for your testcase... or not ?

No.

comment:10 Changed 12 years ago by andrew_b

  • Milestone set to Future Releases

comment:11 Changed 7 years ago by andrew_b

  • Status changed from accepted to assigned
  • Owner angel_il deleted
Note: See TracTickets for help on using tickets.