Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Winmerge in QM_Editor
#1
Would it be possible to use WinMerge (http://winmerge.org/) or another system in QM_Editor?
#2
To compare macros?
#3
Yes, although it could also be used to compare text files.
#4
I use the following simple macro for this purpose. It could be useful to you too. Best regards. Simos.

Code:
Copy      Help
Function [b]tempf1[/b] [help1][/help1]
[code]str si.getmacro(getopt(itemid) 1)
str controls = "4 6"
str e4 e6
if(!ShowDialog("CompareMacrosDlg" 0 &controls)) ret ;; A simple dialog to get names of the macros to be compared
str s1 s2 sfil1 sfil2
s1.getmacro(e4)
err
,_s=_error.description
,out "<>%s : <open ''%s /%i''>%s</open> - %s" NowT si _error.place si _s
,end
s2.getmacro(e6)
err
,_s=_error.description
,out "<>%s : <open ''%s /%i''>%s</open> - %s" NowT si _error.place si _s
,end
sfil1.from("C:\tmp\" e4 ".txt")
s1.setfile(sfil1)
sfil2.from("C:\tmp\" e6 ".txt")
s2.setfile(sfil2)
_s.from(sfil1 " " sfil2)
run "$program files$\WinMerge\WinMergeU.exe" _s
[/code]
#5
Would it be possible to use LibXDiff in QM_Editor in next QM?
#6
Not in near future.

Try this.

.qml   Diff in scintilla.qml (Size: 2.86 KB / Downloads: 541)

Also need Xdiff: Find differences between 2 strings/files; patch

Also need this function, if don't have.
Function SciGetText
Code:
Copy      Help
;/
function hwnd str&s

;Gets text from a scintilla-based control in QM.
;Such controls are: code editors (QM_Code class), output (QM_Output), tips (QM_Tips), qml viewer code view (QM_Code).
;Note that, if there is a link, it will get some garbage text around. In the control it is hidden.

;hwnd - control handle.
;s - receives text.

;EXAMPLE
;int h=id(2201 _hwndqm) ;;qm output
;;int h=GetQmCodeEditor ;;currently active code editor
;str s
;SciGetText h s
;ShowText "" s


int lens=SendMessage(hwnd SCI.SCI_GETTEXTLENGTH 0 0)
s.fix(SendMessage(hwnd SCI.SCI_GETTEXT lens+1 s.all(lens)))
#7
Thanks.

I added to Menu bar.


Forum Jump:


Users browsing this thread: 1 Guest(s)