aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-01-19 17:23:15 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2011-01-19 17:23:15 -0500
commit86e7eba2ca2c58537092ac7a09df85f2f7b747dd (patch)
treee8dcf391b4513587dfeb129481df45b21fc3ba0a
parent030c3c6f3aa9a11db4aa16c0eb4fb63cdb4d819e (diff)
downloadtextadept-86e7eba2ca2c58537092ac7a09df85f2f7b747dd.tar.gz
textadept-86e7eba2ca2c58537092ac7a09df85f2f7b747dd.zip
Modified Buffer menu options.
-rw-r--r--core/locale.conf9
-rw-r--r--modules/textadept/menu.lua18
2 files changed, 19 insertions, 8 deletions
diff --git a/core/locale.conf b/core/locale.conf
index 0ac77d6c..2f12d53f 100644
--- a/core/locale.conf
+++ b/core/locale.conf
@@ -148,15 +148,16 @@ _Current Directory = _Current Directory
_Buffer = _Buffer
_Next Buffer = _Next Buffer
_Previous Buffer = _Previous Buffer
-Swit_ch Buffer = Swit_ch Buffer
+Switch _Buffer = Switch _Buffer
Toggle View _EOL = Toggle View _EOL
Toggle _Wrap Mode = Toggle _Wrap Mode
-Toggle Show _Indentation Guides = Toggle Show _Indentation Guides
+Toggle Show Indentation _Guides = Toggle Show Indentation _Guides
Toggle Use _Tabs = Toggle Use _Tabs
Toggle View White_space = Toggle View White_space
Toggle _Virtual Space = Toggle _Virtual Space
-EOL Mode = EOL Mode
-Encoding = Encoding
+_Indentation = _Indentation
+EOL _Mode = EOL _Mode
+En_coding = En_coding
UTF-8 = UTF-8
ASCII = ASCII
ISO-8859-1 = ISO-8859-1
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 1bbe69f4..a183996c 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -44,6 +44,10 @@ local function toggle_setting(setting, i)
end
events.emit('update_ui') -- for updating statusbar
end
+local function set_indentation(i)
+ buffer.indent, buffer.tab_width = i, i
+ events.emit('update_ui') -- for updating statusbar
+end
local function set_eol_mode(mode)
buffer.eol_mode = mode
buffer:convert_eo_ls(mode)
@@ -222,23 +226,29 @@ menubar = {
{ title = L('_Buffer'),
{ L('_Next Buffer'), { 'goto_buffer', v, 1, false } },
{ L('_Previous Buffer'), { 'goto_buffer', v, -1, false } },
- { L('Swit_ch Buffer'), { gui.switch_buffer } },
+ { L('Switch _Buffer'), { gui.switch_buffer } },
{ SEPARATOR, SEPARATOR },
{ L('Toggle View _EOL'), { toggle_setting, 'view_eol' } },
{ L('Toggle _Wrap Mode'), { toggle_setting, 'wrap_mode' } },
- { L('Toggle Show _Indentation Guides'),
+ { L('Toggle Show Indentation _Guides'),
{ toggle_setting, 'indentation_guides' } },
{ L('Toggle Use _Tabs'), { toggle_setting, 'use_tabs' } },
{ L('Toggle View White_space'), { toggle_setting, 'view_ws' } },
{ L('Toggle _Virtual Space'),
{ toggle_setting, 'virtual_space_options', 2} },
{ SEPARATOR },
- { title = L('EOL Mode'),
+ { title = L('_Indentation'),
+ { '2', { set_indentation, 2 } },
+ { '3', { set_indentation, 3 } },
+ { '4', { set_indentation, 4 } },
+ { '8', { set_indentation, 8 } },
+ },
+ { title = L('EOL _Mode'),
{ L('CRLF'), { set_eol_mode, 0 } },
{ L('CR'), { set_eol_mode, 1 } },
{ L('LF'), { set_eol_mode, 2 } },
},
- { title = L('Encoding'),
+ { title = L('En_coding'),
{ L('UTF-8'), { set_encoding, 'UTF-8' } },
{ L('ASCII'), { set_encoding, 'ASCII' } },
{ L('ISO-8859-1'), { set_encoding, 'ISO-8859-1' } },