APPLY CASE

local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  geany.selection(string.lower(s))
end

local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  geany.selection(string.upper(s))
end

local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  local s1 = string.upper(string.sub(s, 1, 1))
  local s2 =  string.lower(string.sub(s, 2, -1))
  geany.selection(s1 .. s2)
end

local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  s = string.gsub(string.lower(s), "^(%w)", string.upper)
  s = string.gsub(s, "([^%w]%w)", string.upper)
  geany.selection(s)
end

APPLY CASE & KEEP ITEMS SELECTED

local start, stop = geany.select()
local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  geany.selection(string.lower(s))
  geany.select(start, stop)
end

local start, stop = geany.select()
local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  geany.selection(string.upper(s))
  geany.select(start, stop)
end

local start, stop = geany.select()
local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  local s1 = string.upper(string.sub(s, 1, 1))
  local s2 =  string.lower(string.sub(s, 2, -1))
  geany.selection(s1 .. s2)
  geany.select(start, stop)
end

local start, stop = geany.select()
local s = geany.selection()
if (s ~= nil) and (s ~= "") then
  s = string.gsub(string.lower(s), "^(%w)", string.upper)
  s = string.gsub(s, "([^%w]%w)", string.upper)
  geany.selection(s)
  geany.select(start, stop)
end


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/repo-discussions/4086/comments/11622326@github.com>