Scripts discussion (1)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

KDJ
One byte is not enough. At least two. And it is not solution.
1. In case when you writing into buffer end it rewrites memory after it, and in some cases there is situated very important for Memory Management subsystem internal data. When this data is corrupted memory subsystem will not work properly(when I tried this bug, I have lost all data in akelpad, its settings in AkelPad.ini and content of opened documents.
2. In case when you writing in the middle of buffer, it will overwrite adjacent memory cells to one you are writing into.(I.e. you are writing 2 bytes into memory address 1000000(i.e. affected memory cells are 1000000 and 1000001), but it will also write data to cells 1000002 and 1000003, which can store important application data).

Instructor will fix plugin soon, so you should not add extra byte to your memory allocations in you script, which you posted recently.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

FeyFre
Instructor for the time being did not improve the error.
In the script, I increased the buffer size of 2 bytes.
Work correctly.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

convertHTML.js
Добавлено перекодирование &#кодов; («…», «…» => «»).
Добавлена локализация.

convertEscapes.js
Добавлена локализация.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Очередное обновление:
Next update:

convertEscapes.js
convertHTML.js
highlighter.js
Improved logic of text getting.
insertEval.js
newFileTemplate.js

scriptToBookmarklet.js, scriptToBookmarklet_w2k.js
Improved logic of text getting.
textStatistics.js
Added English translation and information about shortest and longest lines, improved logic of text getting.
toggleComments.js

All: implemented new localization method (

Code: Select all

function _localize(s) {
	var strings = {
		"Some text": {
			ru: "Некоторый текст"
		}
	};
	var lng;
	switch(AkelPad.SystemFunction().Call("kernel32::GetUserDefaultLangID") & 0x3ff /*PRIMARYLANGID*/) {
		case 0x19: lng = "ru"; break;
		default:   lng = "en";
	}
	_localize = function(s) {
		return strings[s] && strings[s][lng] || s;
	};
	return _localize(s);
}

WScript.Echo(_localize("Some text"));
WScript.Echo(_localize("Another text"));
).

Offline
Posts: 767
Joined: Mon Sep 28, 2009 10:03 am
Location: Minsk, Belarus

Post by se7h »

Infocatcher
в openFileIn.js добавить бы для полного набора ещё и Safari

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

se7h
А у меня его с последней переустановки системы так и не завелось :D, и я его запомнил за нежелание ставить рядом несколько версий.
Добавил.

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Infocatcher
Можно ли в textStatistics.js сделать так, чтобы знак равенства шёл не в слитную с текстом, а через пробелы? Будет более читаемо.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

VladSh
В смысле?
Я вижу

Code: Select all

Строки: 207
  – Пустые: 23

Самая короткая строка: №3
  – Длина: 0
  – Строка: «»
Самая длинная строка: №157
  – Длина: 111
  – Строка: «	res += _localize("Numbers: ")        + form…»

Символы: 5 960
  – Кириллица: 213
  – Латиница: 3 028
  – Цифры: 80
  – Пробельные символы: 1 274
     = Пробелы: 791
     = Табуляции: 277
     = Возвраты каретки (\r): 206
     = Переводы строки (\n): 0

Слова: 607
  – Слова (кириллица): 33
  – Слова (латиница): 574

Числа: 30
и

Code: Select all

Lines: 207
  – Empty: 23

Shortest line: #3
  – Length: 0
  – Line: “”
Longest line: #157
  – Length: 111
  – Line: “	res += _localize("Numbers: ")        + form…”

Symbols: 5 960
  – Cyrillic: 213
  – Latin: 3 028
  – Digits: 80
  – Space symbols: 1 274
     = Spaces: 791
     = Tabs: 277
     = Caret returns (\r): 206
     = Line feeds (\n): 0

Words: 607
  – Words (Cyrillic)33
  – Words (Latin): 574

Numbers: 30
. Пробелы имеются.

[upd]
А вот у «Words (Cyrillic)» я даже двоеточие потерял. Сейчас исправлю.

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Infocatcher
Я дико извиняюсь, оказывается у меня в меню был вызов Stats-плагина... :oops:

Offline
Posts: 767
Joined: Mon Sep 28, 2009 10:03 am
Location: Minsk, Belarus

Post by se7h »

VladSh
у тебя наблюдается подобное?
Если да, то может для начала неплохо бы подравнять список, а потом уже пробелы добавить? 8)

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

In the script FileInfo.js, added detailed information about the lines.

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

se7h wrote:у тебя наблюдается подобное?
Да, наблюдается. В теме плага отписал.

Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

se7h
реально доработать ChmKeyword.js так, чтобы можно было одновременно открывать несколько окон справки...
var bCatchEsc=false;

KDJ
FeyFre
sizeof(WORD) и sizeof(BYTE)
Fixed. Will be available after 4.5.1 release.

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Fixed. Will be available after 4.5.1 release.
Значит ждемс смачную фичу(и предположительно изменение архитектуры плагинов) ;)

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Хорошо пошло. :D

convertEscapes.js
convertHTML.js
Improved logic of text operations.

colorsConverter.js
Added localization and improved handling of incorrect colors.
Locked