<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; SciTE: интеллектуальная замена TAB'ов на пробелы в выделенном тексте]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=837</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=837&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «SciTE: интеллектуальная замена TAB'ов на пробелы в выделенном тексте».]]></description>
		<lastBuildDate>Wed, 14 Nov 2007 13:41:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[SciTE: интеллектуальная замена TAB'ов на пробелы в выделенном тексте]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=6019#p6019</link>
			<description><![CDATA[<p>Скрипт для <a href="http://forum.script-coding.com/viewtopic.php?id=680">SciTE</a>, на языке lua.<br />Заменяет TAB&#039;ы на пробелы в выделенном тесксте, с учетом размера табуляции, так, чтобы текст не &quot;разъезжался&quot; после такой замены.<br /></p><div class="codebox"><pre><code>local sel_text = editor:GetSelText()
if sel_text == &quot;&quot; then print(&quot;Выделите текст для обработки!&quot;) end
local sel_start = editor.SelectionStart
local sel_end = editor.SelectionEnd

local text_out = &quot;&quot;
for i = sel_start, sel_end-1 do
    local char = editor:textrange(i, i+1)
    if char == &quot;\t&quot; then
        local space_count = editor.Column[i+1] - editor.Column[i]
        text_out = text_out..string.rep(&quot; &quot;, space_count)
    else
        text_out = text_out..char
    end
end

editor:ReplaceSel(text_out)</code></pre></div><p>Пример подключения в файле .properties:<br /></p><div class="quotebox"><blockquote><p>command.name.135.*=Заменить TAB-ы на пробелы<br />command.135.*=dofile $(SciteDefaultHome)\tools\TabToSpace.lua<br />command.mode.135.*=subsystem:lua,savebefore:no</p></blockquote></div><p>Автор скрипта - <strong>mozers</strong>.</p>]]></description>
			<author><![CDATA[null@example.com (The gray Cardinal)]]></author>
			<pubDate>Wed, 14 Nov 2007 13:41:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=6019#p6019</guid>
		</item>
	</channel>
</rss>
