Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Stefan

Pages: 1 [2] 3 4 ... 49
16
Feature requests and suggestions / Re: better vertical selection
« on: September 03, 2011, 02:39:11 am »
Hi sans, welcome to the community!

That's an perfect example for an tool i wish to be implemented at default for a long time  :P

But HippoEDIT has already that feature build in, you just have to "activate" it.

We can do that by an "Code Templates" and %BEFORE%%SelectedLine%%AFTER% as template.
Please see that post for an how-to => nsert-in-front-or-at-end-of-line



You can also use an regex search&replace:
Code: [Select]
Replace all "^(.+)$" to "<i>$1</i>", "Selection", Use regular expression,

- - -
BTW

That the zero-width column mode
insert on all lines at the same, namely the widest position
instead of the EOL after the last sign on each line
can be seen as a feature.

But do it alternatively the way you had first imagine is also an nice to have feature.
I don't know if this is currently possible. Or, if not, how this can be implemented as an alternative, switchable mode.
But i can see an use of this and it is worth to think about.

But as always: "easy to wrote, but hard to code". Lets hear what Alex thinks about.

17
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: September 01, 2011, 02:38:36 pm »
Hi Stefan,

main problem that you have not installed but only unpack binaries. Now installer also register type library and this step is missing, if you do not run it.
But generally you can achieve the same, if you will run Hippoedit.exe /Register  . This is a reason for "undefined" errors.

Ah, i see.
I do install 1.50 builds, but i work with limited user rights, of course ;-)
<edit to clarify> i have installed to X:\, where i have write access. (To "C:\Pro Fi" i wouldn't) - But i had still no write access to HKLM. </edit>
Anyway. runas /u:administrator "Hippoedit.exe /Register" did it. Much better now.


Quote
Problem with select comes because you call engine with invalid range. Maybe I will add some more meaningful error description in the future.
I have not add any error check in the example script, so if you decrease by one or increase by one selection range and goes out of line size of document size you will get it. For testing, just select some text in between of the line, before execution.
Yes you are right. Works.

Quote
Crash with wscript_test.js I also reproduced.. Something strange, in debug was working. But I will fix it, should not be something serious. Just try the same, but with commented Quit (it cause the crash) to see the idea.
Added: It is very funny, but I am not able to reproduce this any more.. By me works. As release as debug. But probably there is something wrong...
//WScript.Quit();
But still the same here. (as limited user)
But no matter for me. I have other things to check out.
<edit> Not related to limited user, the same with runas /u:Admin HE </edit>


Quote
You can also check updated dialog_actions.hejs for color_browser and font_browser.
Yes, have seen and used. Now i need to use that choice to do smtg. e.g.  alert me the choice taken...
I also have seen things like "ActiveDocument.BeginUndoGroup();", ... you have did much work for that 1.5 build it seams...


Now I going to see if I can take an selection, modify it and write back,... i think i had seen smtg in your example code to reuse...

18
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: September 01, 2011, 10:21:14 am »
Hi Alex, thanks for the update!

Are you ready for feedback... or it is to early to report malfunctions?



1.50.721  on XP SP3

1.)
Code: Javascript
  1. edit-2011-08-31.hejs
  2.  
  3. Got the yellow tool tip, but then
  4. "Schwerwiegender Fehler"
  5. ==> ActiveView.Select(sel);
  6.  
  7. or
  8.  
  9. Got the yellow tool tip,
  10. got output in output pane, but then
  11. "HE_ACTION_UNKNOWN is undefined"
  12. ==>ActiveDocument.ReplaceText(sel.start, "New Text", sel.end, HE_ACTION_UNKNOWN);

<EDIT
Alex> but excluding start/end of line
I had read/thought "start/end of FILE", sorry.
Now if i take your advice it works better.
But get still: "HE_ACTION_UNKNOWN is undefined"
</EDIT




2.)
Code: Javascript
  1. dialog_actions-2011-08-31.hejs
  2. "eMessageTypeInfo is undefined"
  3. ==>status("Result code: " + result, eMessageTypeInfo);



3.)
dialog_test-2011-08-31.hejs seams to work fine.


4.)
wscript_test.js
executing ends HE

19
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 26, 2011, 10:14:35 am »
Hi Alex, if you find some time please take an look:


I have only provide you example function you can use.
To get selected text you need something like this:

Alex> "Create a tool, taking script path into command window. It should work as normal tool, and called tool script."

When i execute this script via an tool at an document, HE jumps to the script and shows the red arrow:
ila_rendered

What did i wrong?

20
convert lines to columns

e.g. ABC1 ABC2 XYZ1 XYZ2 and so forth;

to transpose these lines into columns
ABC1
ABC2
XYZ1
XYZ2
(then add the commas),

Do i misunderstand this request
or couldn't that be done by

Code: [Select]
For Each Line In LineS Do
   ColumnsArray = split(Line, " ")
    For x = 0 To UBount(ColumnsArray)
         OutArray = OutArray & ColumnsArray(x) & "," & vbCRLF
    Next Column
Next Line

This would provide for lines like:
ABC1 ABC2 XYZ1 XYZ2
One1 Two2 Thre Four4

that output:
ABC1,
ABC2,
XYZ1,
XYZ2,
One1,
Two2,
Thre,
Four4,


Also, once we are able to replace selected text by an output from an tool, we can use SED or AWK for such tasks.

21
Alex> Based on this problem, I have two ideas/helpers:
Alex> - add one more Find (maybe plus Replace) menu item into Edit menu, which will just duplicate one from Navigation
You know yourself what this idea is, i guess. (Move "Find" completely or not at all)

Alex> - add menu path as additional detail in command description in keyboard settings and maybe in Hint Windows.
I can not really imagine what you mean, and from what i imagine this would not really be of any help

- updating the help to show where the functions are located in the menu.
  "Find and Replace (Navigation > Find and Replace > ...)"


- OTOH, your "Find and Replace" sub-menu is large enough to get its own main menu "Search" (like the above screen shots)



22
I remember i hade always to search the search menu too.
But since i use the keyboard shortcuts i don't really care for myself.

Then i thought ... "Edit" menu, yes, fits better.
But then i did an closer look an found out:

23
Bug reports / Re: "Replace With", the first letter can not use "I"
« on: August 22, 2011, 02:53:49 pm »
Don't know



"RIplacI With",   thI first lIttIr can not input "I", and thI sIcond lIttIr can usI "I".  why??

VIrsion 1.49.822.     os:XP SP3


via 'Ctrl+H'
Find what: 'e'
Replace with: 'I'


What did YOU have done?
- CTRL+H ?
- only problem with upper case i ?
- Or other letters/cases too?
- only problem with "Replace With"?
- First letter of "Find what" can be upper case i ?
- As text in document you can type 'I' ?
- do you have any "shortcut" / "key mapping" tools running?

24
General Discussion / Re: Highlight portions of current line only
« on: August 15, 2011, 11:19:39 pm »
Oh man! Good find! ;D

Thanks for the feedback.

25
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 12, 2011, 10:47:31 am »
Of course take your time and have an nice vacation. Greetings to your family.


Just my thought:

But i don't understand your syntax:
ActiveView.GetSelection(ptStart, ptEnd);
ActiveDocument.GetText(ptStart, ptEnd);
ActiveDocument.ReplaceText(ptStart, "New Text", ptEnd, 0);

While it is good to know start and end point
sometimes i don't take care of this info
and only want to get or set (replace) the selected text
varSel = ActiveDocument.GetSelectedText
ActiveDocument.SetSelectedText varString
I want to make the syntax more easy to write for the most time, and use the extended syntax only f needed.

And the editor already knows the ptStart and ptEnd of an selection, why should the user execute this GetSelection command again?
F.ex.: In other editors i had to get the start and end point of an selection and calculate the selected lines on my own.
I hope HE will provide such infos just by build-in "variables"?
ActiveDocument.Info.CountLinesDocument
ActiveDocument.Info.CountLinesSelection
ActiveDocument.Info.CountByteDocument
ActiveDocument.Info.CountByteSelection

ActiveDocument.Info.SelectionStartLine
ActiveDocument.Info.SelectionStartColumn
ActiveDocument.Info.SelectionEndLine
ActiveDocument.Info.SelectionEndColumn

Yes, i have browse the heapi.chm, but i got lost somewhere.

As far as i  underst guess,
the last four infos i  should get by using
var ptStart, ptEnd;
ActiveView.GetSelection(ptStart, ptEnd);
???

But according your last post you have to modify it to smtg like:
var LineStart, LineEnd, ColumnStart, ColumnEnd;
ActiveView.GetSelection(LineStart, LineEnd, ColumnStart, ColumnEnd);
???

.

26
General Discussion / Re: Any way to disable "shift" key popup menu?
« on: August 11, 2011, 12:34:36 am »
Hi RickF,

please take an look there >> FAQs << if that setting will help you.

27
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 10, 2011, 07:53:13 pm »
WOW the API chm is pretty full loaded with commands. You must have been very busy.

Would you please tell me how i can get and set selected text?
I only see "GetText start, end"

But i think about smtg like
varSel = GetSelectedText
and
SetSelectedText(varString)
to replace an selection.

Is this already there?

28
General Discussion / Re: how to sort then remove duplicate line?
« on: August 10, 2011, 11:04:40 am »
Quote
06 July 2011, Once more update for 1.49 release. Build number 821.
- Fixed. Join Lines logic has been corrected to insert additional space between joined lines, if there are no spaces already

I am afraid it was me suggesting this behavior, and today i think that was not an good idea.
However it had made sense for joining sentences but not for joining other strings as you show us here.
Because while i can easily add an trailing space after each line before joining,
it is not that easy to find and remove unwanted spaces inside an string after joining.

Since i think Alex didn't want to provide two join commands in the menu i would agree it is an good idea to go back to the old logic.
The question is: what is more common? joining sentences or joining string?
Since HE is an code editor i think now the second, and that it is not always good to let the program be as smart as it could be (remember me later again about this wise words)

- - -

As an meanwhile work around i would add an additional trailing sign like:
A,~
B,~
C,

and then after joining
A,~ B,~ C,

remove that sign-space-pair
A,B,C,

29
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 04, 2011, 01:21:55 pm »
I don't know if i can make myself clear with all that 'host' and 'object'.


What i mean was:

"WScript.Shell" is not the same as the "WScript .dot" object in an script.


"WScript.Shell" is an string only to refer to the "WshShell object" registry entry
HKEY_CLASSES_ROOT\CLSID\{72C24DD5-D70A-438B-8A42-98424B88AFB8}\VersionIndependentProgID
to use this object for your script.



Where as "WScript .dot" as object in your script
is only instanced if you use the WSH as your host (via cscript/wscript)
but HE is its own host (as other text editors, or IE for that matter) and don't have access to this object.
http://msdn.microsoft.com/en-us/library/at5ydy31%28v=vs.85%29.aspx



So the simple use of
WScript.echo,
WScript.Quit,
WScript.BuildVersion, ... will not work inside HE.
http://www.devguru.com/technologies/wsh/quickref/wscript.html


Try 
C:\>cscript test.vbs

test.vbs
Code: Visual Basic
  1. Set WS = WScript.CreateObject("WScript.Shell") '//not need, only to see
  2.  
  3. WScript.echo WScript.Fullname & ", v:" & WScript.BuildVersion
  4. WScript.echo "Hi one"
  5. WScript.Quit
  6. WScript.echo "Hi two"

WScript Dot will only work for (c|w)script in WSH host. Not for other hosts.


I guess that's why (if i understand you right)
var WshShell = new WScript.CreateObject("WScript.Shell");
will not work
and you have created your own 'ActiveXObject' ?
var WshShell = new ActiveXObject("WScript.Shell");


Or, changes are good, you know more about that things under the hood... or i misunderstood the whole topic? Then excuse me.

30
Scripting, Scripts and Macros / Re: 1.50: scripting first test
« on: August 04, 2011, 10:11:25 am »
Alex, the first script from Ramon was an example only, tested outside of HE by involving script.exe.

Common info:
WScript is an object of the Windows Scripting Host, meaning only available by using cScript.exe or wScript.exe
Since HippoEDIT is it own scripting host, the WScript object is not involved at all.


An other idea for
var WshExec = WshShell.Exec("cmd /c dir c:\\");

maybe
var WshExec = WshShell.RUN( strCommand, intWindowStyle, bWaitOnReturn);
where intWindowStyle could be '0' (Hides the window)

See
http://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.85%29.aspx

Pages: 1 [2] 3 4 ... 49