Skip to content

Commit

Permalink
Попытка работать на 8.3.19.x86
Browse files Browse the repository at this point in the history
В 8.3.19 поиск по текущему вью не работал.
Возможно не корректно сделал, но работает.
  • Loading branch information
7OH authored and orefkov committed Sep 15, 2021
1 parent 1229c51 commit 5a11823
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions addins/extSearchReplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,13 +678,23 @@ ExtSearch = ScriptForm.extend({
}
},

getTextObject : function (obj, title) {

if (obj && toV8Value(obj).typeName(0) == 'TextDocument')
return new TextDocObject(obj, title);

if (obj) Message('Неподдерживаемый тип объекта для поиска: ' + toV8Value(obj).typeName(0));

return null;
},

getWindowObject : function (view) {
try {
if (!view || !view.isAlive())
return null;
} catch(e){}

if (view.mdObj && view.mdProp)
if (view.mdProp && view.mdObj)
return new MdObject(view.mdObj, view.mdProp, view.title);

var obj = view.getObject();
Expand Down Expand Up @@ -745,8 +755,13 @@ ExtSearch = ScriptForm.extend({
this.re = this.buildSearchRegExpObject();
if (!this.re) return;

var obj = this.getWindowObject(activeWindow.GetView());
if (!obj) return;
var aView = activeWindow.GetView();
var obj = this.getWindowObject(aView);
if (!obj) {
obj = this.getTextObject(activeWindow.textWindow.textDocument, aView.title);
if (!obj)
return;
}

var docRow = this.search(obj, this.re);

Expand Down

0 comments on commit 5a11823

Please sign in to comment.