WordDeletePrevious bug

If reporting a bug with the Zeus editor please post the details here. Please do not post questions here.
Julian
Posts: 1
Joined: Sun Aug 27, 2006 6:15 pm

WordDeletePrevious bug

Postby Julian » Sun Aug 27, 2006 6:36 pm

Just wanted to report a problem with the WordDeletePrevious that is assigned to the CTRL-BACKSPACE, this is the standard windows function for that key combination as well as the BriefEx configuration I am using. When there are no spaces separating the 'words' in the area of the cursor, it will frequently delete material to the right of the cursor when only the left section should be deleted. For example:

This sentence would work fine since it is nicely spaced.

Code doesn't work frequently, like

somevar:1234; someothervar:abd;

In the last example above, if I position my cursor to the right of the second colon (i.e. right before abd) then the first CTRL-BACKSPACE will delete the colon only (which is fine), the second CTRL-BACKSPACE will delete 'someothervar' AS WELL AS 'abd' which is clearly wrong since it is to the right of the cursor. I suspect that the editor considers the cursor in the middle of a single word and deletes the whole thing. This, however, is entirely incorrect behavior, both Windows and Brief delete only what is to the left of the cursor. The way it is now, if you are coding and want to delete a few words to the left of the cursor and consequently press CTRL-BACKSPACE a few times to accomplish this, one generally ends up with large (or all) parts or the code to the right of the cursor missing as well. As I have a more than a decade's worth of conditioning working on Brief, I rarely pay attention to the keys combinations I use, they have become second nature, especially the CTRL-BACKSPACE. Suddenly code is missing, this is a major annoyance to me. Some kind of fix would be greatly appreciated unless there is some way I can fix this on my end?

Another issue, which may not be a bug but just my ineptitude in finding the proper documentation. In the Search and Replace using REGEXs I cannot seem to insert a newline. If I search for ';' and set the replace to ';\n' with REGEX (without the quotes, they are just for clarity here) checked the it simply inserts the three characters ';\n' rather than breaking the line at that point. Is this a bug, a short-coming, or my inability to comprehend something?

Thanks,
Julian

jussij
Site Admin
Posts: 2230
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Sun Aug 27, 2006 11:44 pm

Hi Julian,

Code doesn't work frequently, like

somevar:1234; someothervar:abd;

In the last example above, if I position my cursor to the right of the second colon (i.e. right before abd) then the first CTRL-BACKSPACE will delete the colon only (which is fine), the second CTRL-BACKSPACE will delete 'someothervar' AS WELL AS 'abd' which is clearly wrong since it is to the right of the cursor.

What happens is because the cursor is over a delimiter the first CTRL-BACKSPACE will delete all the delimiters character (ie the white space and the colon) and stop at the end of the previous word.

The second CTRL-BACKSPACE finds itselef at the end of the word so it deletes all the characters up to the next delimiter.

It would asume if it deletes someothervar:abd in one go that is because you don't have : defined as a delimiter in the document type :?

I suspect that the editor considers the cursor in the middle of a single word and deletes the whole thing.

This example illustrates how it will work:

Code: Select all

somevar:1234; someothervar:abd;
                     ^
                     cursor here

a CTRL-BACKSPACE will produces this result:

Code: Select all

somevar:1234; :abd;
             ^
             cursor here

So as you can see, you are correct in that it will delete the current word.
Some kind of fix would be greatly appreciated unless there is some way I
can fix this on my end?

The following Lua macro should produce the desired result:

Code: Select all

function key_macro()
    screen_update_disable()
    MarkColumnToggle()
    MoveWordPrevious()
    MarkDeleteEx()
    screen_update_enable()
    screen_update()
end

key_macro() -- run the macro

Just save it to the zScript diretory and bind it to the CTRL-BACKSPACE keys.

Another issue, which may not be a bug but just my ineptitude in finding the proper documentation. In the Search and Replace using REGEXs I cannot seem to insert a newline.

This is a limitation of the current Zeus :(

Cheers Jussi


Return to “Reporting a Bug”

Who is online

Users browsing this forum: No registered users and 1 guest

cron