The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: supercoollee on May 06, 2010, 05:04:17 AM

Title: the INDENT function in QEDITOR
Post by: supercoollee on May 06, 2010, 05:04:17 AM
in the CHM help file, it says
"3. Micro indent on a selected block of text using the RIGHT and LEFT arrow keys. This is fixed at one (1) space per key repeat."

i have got used to notepad or other editor, RIGHT LEFT arrow keys move the cursor, not move the selected text. can i cancel this INDENT function?
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 06, 2010, 06:23:06 AM
Use RichMasm (http://www.masm32.com/board/index.php?topic=12460) :toothy
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 06, 2010, 11:55:32 AM
supercoollee,

Every editor has its characteristics, QE does micro indent differentiated by whether it is selected or not. Select a block and it can have the indent changed, unselect the text and the arrows work like arrows.
Title: Re: the INDENT function in QEDITOR
Post by: supercoollee on May 06, 2010, 02:10:16 PM
i understand how it behaves. but i don't know the good of this.
if i want to increase the indent of a block, i can move the cursor to the left of the block, then press SPACEBAR or TAB.
now with this function, i can't deselect a block by pressing RIGHT or LEFT. i have to press UP or DOWN, or use the mouse, which is slower.

maybe this function is useful when i want to move multiple rows of text. but if i only selected a block within 1 row, i feel this is not good.
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 08, 2010, 02:56:53 AM
QE has been around from its earliest versions since 1997 and over that time folks have asked to make it like the Borland IDE, the VC IDE, UltraEdit, Notepad++ etc etc etc .....

It is a tool in its own right that had block indent years before anyone else caught onto it, the micro-indent is a refinement on the larger movement buttons on the toolbar.
Title: Re: the INDENT function in QEDITOR
Post by: Slugsnack on May 08, 2010, 03:01:19 AM
Quote from: supercoollee on May 06, 2010, 02:10:16 PM
i understand how it behaves. but i don't know the good of this.
if i want to increase the indent of a block, i can move the cursor to the left of the block, then press SPACEBAR or TAB.
now with this function, i can't deselect a block by pressing RIGHT or LEFT. i have to press UP or DOWN, or use the mouse, which is slower.

maybe this function is useful when i want to move multiple rows of text. but if i only selected a block within 1 row, i feel this is not good.

you can just press up instead of right and down instead of left. not that big a difference really
Title: Re: the INDENT function in QEDITOR
Post by: dedndave on May 08, 2010, 03:39:13 AM
i like QE   :U
simple and fast
the only thing that is a little uncomfortable is that copy and paste are 2-deep in context menus
with most editors, it is right-click/copy or right-click/paste
i have thought some of messing around with it to see if i could change it   :P
maybe it could be an option ?
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 08, 2010, 03:56:38 AM
now i am confused, what is wrong with the toolbar buttons for clipboard operations ?
Title: Re: the INDENT function in QEDITOR
Post by: dedndave on May 08, 2010, 04:14:04 AM
 :bg
not a thing, Hutch - i am just used to the context menu method
mainly because notepad and wordpad don't have menu icons (maybe wordpad does - i dunno)   :P

EDIT - what i ought to do is make QE my default text editor and get used to the icons
you are talking to a guy that used to use PC-Write   :lol
(which actually had some powerful fetures that i miss)
Title: Re: the INDENT function in QEDITOR
Post by: supercoollee on May 08, 2010, 05:06:40 AM
Hutch, i understand what dedndave meant about "too deep in context menu".
in most apps for windows(text editor or multimedia editors) have "right-click menu". they have different context when the user right-clicks on different areas.
in , such as notepad, when right-click on the editing area, the menu should show "copy, cut, paste, ...".
but in QEDITOR, when right-click on the editing area, the menu shows "file , edit , selection, ..." , while copy , paste functions are submenu of "edit". they are 1 level deeper than those of notepad.
it's not a problem for me though, i mostly use CTRL+C / V rather than clicking the menu.
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 08, 2010, 05:56:42 AM
Until now I have not even foreseen copy etc in any menu of RichMasm - I had just assumed that all coders use Crtl C, X, V :red
Is that a must for an editor?? After a nasty experience with Repetitive Stress Injury some years ago, I have switched as much as possible from mouse to keyboard. It protects your fingers, really.
Title: Re: the INDENT function in QEDITOR
Post by: oex on May 08, 2010, 08:20:56 AM
How do you TAB in qeditor? I hate 4 spaces at the beginning of a line, that may seem lame to some but I've always regarded it at totally inefficient :lol
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 08, 2010, 08:46:29 AM
The problem is you cannot be all things to all people, I mentioned the requests over time for a reason, it used to be "copy the Borland IDE", then it was "Copy the Microsoft VC IDE", then it was Copy "UltraEdit", then "Copy Notepad", then "Notepad++" etc etc etc .....

For clipboard operations QE has the normal menu, the toolbar, Ctrl+V etc.. and the older Ctrl+Insert/Delete. Then it duplcates the complete main menu as a right click menu in the client area anhd the problem is here that some want the right click for help, others for text operation, others for File operations and others again want clipboard operations.

The usage order is toolbar first, then Ctrl+V etc then Ctrl/Shift+Ins/Del then the menu then the right click menu, I wonder how many more variation are required.

The tab replacement with spaces is to ensure that the text display is correct in places where tabs make a mess of formatting. Every editor and its dog has a different tab setting, this one has none, it aligns text with spaces only, that is why it can be used to produce text for many different targets without the mess that tabs make.
Title: Re: the INDENT function in QEDITOR
Post by: sinsi on May 08, 2010, 08:58:23 AM
Since this is a qeditor bash, the one thing I don't like is having to use F2 to search - it should be F3.
A feature I would like to see is one that's in the FASM editor - vertical selection with cut/copy/paste.

Other than that, I like it (I upgraded from the old DOS6 edit.com)  :bg
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 08, 2010, 11:52:32 AM
Sinsi,

I would have done it if it was possible but the selection techniques for richedit are contained internally and I doubt there is a way to change that. I still have a working copy of the old DOS Programmers Work Bench that does block selection perfectly but it was a pure character based app in text mode where the content was easy enough to get.
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 08, 2010, 12:01:48 PM
Quote from: sinsi on May 08, 2010, 08:58:23 AM
A feature I would like to see is one that's in the FASM editor - vertical selection with cut/copy/paste.

Sinsii,
Just curious: Can you give an example where that would be useful?
Title: Re: the INDENT function in QEDITOR
Post by: sinsi on May 08, 2010, 12:51:17 PM
jj, I use the FASM editor as a general text editor when I want a quick'n'dirty way of getting rid of the first 4 characters of a text file for example.
Just select them vertically and hit delete.

edit: getting rid of the first 4 characters of each line in a text file
Title: Re: the INDENT function in QEDITOR
Post by: dedndave on May 08, 2010, 01:33:51 PM
yes - that is a feature i miss from PC-Write - it was called "Block Edit"

one example of where you might use it....
you make a text file list of files using DIR
they are listed, filename first, then size
with PC-Write, you could mark the filename column - copy - cut
all that's left are the sizes
then, paste the names on the right
you have swapped column order so that sizes are listed first, then names

now, i know DIR has been updated with options to do this, but it is just an example

btw - i am not bashing QE - lol
i just mentioned one thing that i noticed, is all - it was only a suggestion   :8)
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 08, 2010, 07:33:57 PM
Quote from: sinsi on May 08, 2010, 12:51:17 PM
edit: getting rid of the first 4 characters of each line in a text file

Quote from: dedndave on May 08, 2010, 01:33:51 PM
you make a text file list of files using DIR
they are listed, filename first, then size
with PC-Write, you could mark the filename column - copy - cut
all that's left are the sizes
then, paste the names on the right
you have swapped column order so that sizes are listed first, then names

Ts ts ts... why overload a poor editor with functions that you can do with a few lines of assembler?

include \masm32\MasmBasic\MasmBasic.inc
Init
Recall "\Masm32\include\Windows.inc", L$()
For_ n=0 To eax-1
Let L$(n)=Mid$(L$(n), 5)
Next
Store "WindowsMinus4.inc", L$()

Open "O", #1, "tmp.bat"
Print #1, Chr$("dir *.asm ", 62, "1.txt"), CrLf$
Close
Launch "tmp.bat", SW_MINIMIZE, 5000
Recall "1.txt", L$()
For_ n=5 To eax-3
Let ecx=L$(n)+Space$(40)
Let L$(n)=Mid$(ecx, 37, 40)+Left$(ecx, 35)
Next
Store "1.txt", L$()
Launch "\masm32\qeditor.exe 1.txt"
Exit
end start

:lol
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 08, 2010, 11:27:55 PM
 :bg

Now for those folks who need to strip left side leading spaces from their text, try the block select on the whole file loaded into QE then use the "Less Indent" button OR "The micro-indent" with the arrow buttons and adjust the side spacing to your required layout.
Title: Re: the INDENT function in QEDITOR
Post by: oex on May 08, 2010, 11:50:18 PM
Quote from: sinsi on May 08, 2010, 12:51:17 PM
jj, I use the FASM editor as a general text editor when I want a quick'n'dirty way of getting rid of the first 4 characters of a text file for example.
Just select them vertically and hit delete.

edit: getting rid of the first 4 characters of each line in a text file

I like that idea

;(code)
;comments
;stripped
;in
;one
;go
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 09, 2010, 12:25:25 AM
Quote from: oex on May 08, 2010, 11:50:18 PM
I like that idea

;(code)
;comments
;stripped
;in
;one
;go

That sounds a bit too simple - what if you have a comment every second line...? In RichMasm, you can select a block and then comment/uncomment the whole block by hitting the F4 key; but that function requires a check for every line if it starts with a semicolon or not. Otherwise you end up with "ov eax, 123", double semicolons or similar effects... ::)
QEditor's Tools/Block Asm comments works pretty well in this respect.
Title: Re: the INDENT function in QEDITOR
Post by: oex on May 09, 2010, 10:54:36 AM
I rarely get outside of notepad and my own apps :lol I was just in the process of editing my code and saw a use.... I long ago realised that learning all the editors tricks and finding the right editor and changing the settings then loosing the settings  including the license serial every hard drive crash was actually generally slower than manually coding everything up as I like it.... The tab issue was curious to me because it's a very old style of tabbing (in my computing lifetime) and I hadnt really understood whether it was feature based and with reason or just 'feature poor'.... In other words I was just checking if you old timers were using a trick I did not know.... It is surprising the tricks you can find in even feature poor functionality that was obsolete before some of us kiddies got to the table

I like the further twist you added and have seen it in apps like visual studio.... It was useful, especially the ability to click a few pixels at the beginning of a line to select the line and multi-comment ie ;; to have multiple levels of debugging (I think this is likely already available in a basic commenting function).... I will write my own editor eventually but I code in many languages so this could be a little while yet.... I think I've covered most of the conceptual it's just a question of having the time to take on such a monumental task.... I wrote one for php once in html, with js being so mind numbingly tardish that is certainly a monumental task :lol

Windows is designed as a user operating system not a programmers interface imho.... This is changing and they have added more programming features over the years but everytime they make a change you need functionality/information to change/update your code and they can be sketchy with the details.... You have to follow their controls and proceedures, it's like painting by numbers.... They do however have a lot of useful functionality even in something as simple as notepad which is hard to replace in full :lol

Though I might add notepad has some crappy dealing with chr$(10)
Title: Re: the INDENT function in QEDITOR
Post by: supercoollee on May 09, 2010, 11:43:44 PM
i wish QEDITOR has a "recent files " menu  ::)
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 10, 2010, 01:01:59 AM
Think about it and you will know why it does not have that written in it. It is a multiple instance editor so the MRU list would be out of date each time you opened a new file while other instances are running.

The solution is to write your own and you will have none of the problems you mentioned.  :bg
Title: Re: the INDENT function in QEDITOR
Post by: supercoollee on May 10, 2010, 04:06:37 AM
i found that i can modify the menu. i want to put some frequently used files in the menu, such as "windows.inc".  i wrote:

read windows.inc,MASM32\include\windows.inc

in [&Tools] paragraph.

but when i click the menu, the file doesn't come up, why?
Title: Re: the INDENT function in QEDITOR
Post by: supercoollee on May 10, 2010, 04:11:18 AM
haha, i found the way  :green2

Read windows.inc,qeditor.exe "d:\masm32\include\windows.inc"
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 10, 2010, 06:12:48 AM
 :bg

You have just learnt one of the magic secrets of editor design, "extendability". QE can do this type of operation on any executable file on your machine.
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 10, 2010, 06:40:10 AM
Quote from: hutch-- on May 10, 2010, 01:01:59 AM
Think about it and you will know why it does not have that written in it. It is a multiple instance editor so the MRU list would be out of date each time you opened a new file while other instances are running.
You could update the MRU list to the ini file, and create the menu on the fly (that's how I do it).

Quote
The solution is to write your own and you will have none of the problems you mentioned.  :bg
Yep :toothy
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 10, 2010, 08:11:09 AM
he problem is with an MRU in a multi-instance editor is the sheer clutter that it would generate when you keep multiple instances open which is part of the design of QE. Unless you had an MRU list dozens deep you would generally not find the last source file you were after as it would end up too far down the list to be useful. MRU lists are for single instance applications only with MDI or tabs, it becomes unworkable with 5 or 6 instances running and much worse with more.
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 10, 2010, 10:00:50 AM
Quote from: hutch-- on May 10, 2010, 08:11:09 AM
the problem is with an MRU in a multi-instance editor is the sheer clutter that it would generate when you keep multiple instances open which is part of the design of QE. Unless you had an MRU list dozens deep you would generally not find the last source file you were after as it would end up too far down the list to be useful. MRU lists are for single instance applications only with MDI or tabs, it becomes unworkable with 5 or 6 instances running and much worse with more.

Can't see that problem, actually. I often have four or more instances open, and by design the MRU list of each instance is being generated when the user hovers over the File menu:
(http://www.webalice.it/jj2006/pics/RichMasmRecentFilesList.png)
#1 is the last one opened or saved. Each open instance shows the same list. In the moment when I save SpreadSheet.asc, all five lists change so that SpreadSheet.asc moves to the top.

Furthermore, if a user clicks e.g. on MasmBasic.asc (#3), the editor would activate the open instance, instead of re-opening the file (re-opening could indeed cause trouble). If, however, MasmBasic.asc is not yet open, it would be opened in a separate instance.

I don't see how that could be confusing, for me it's intuitive... and a must, if you are using a variety of folders.
Title: Re: the INDENT function in QEDITOR
Post by: hutch-- on May 10, 2010, 12:30:55 PM
Its not a problem to do technically, I already do that with the number of running instances by dynamically loading the menu on selection, its when you need to go back 30 or 40 files to find the last one you wanted where the MRU becomes unmanagable.
Title: Re: the INDENT function in QEDITOR
Post by: jj2007 on May 10, 2010, 01:25:43 PM
Quote from: hutch-- on May 10, 2010, 12:30:55 PM
Its not a problem to do technically, I already do that with the number of running instances by dynamically loading the menu on selection, its when you need to go back 30 or 40 files to find the last one you wanted where the MRU becomes unmanagable.

Sure. I have fixed the MRU at 19 files, but effectively I use about ten. Beyond that file age, you typically have an idea what the name should contain, and will do a proper search with whatever explorer variant.

I find the MRU handy, though, because you can be sure to get the most recent version in case you have a bunch of versions with similar name. Besides, if I launch the editor without arguments, it opens automatically the top file in the MRU list - and that's exactly what I need in 90% of all cases. Now the real luxury comes in when on opening the source the editor jumps directly to line 2867 of 12,000, and displays the page where you stopped the bug search the night before ;-)