about summary refs log tree commit diff stats
path: root/select.lua
diff options
context:
space:
mode:
Diffstat (limited to 'select.lua')
-rw-r--r--select.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/select.lua b/select.lua
index 9b2a278..a24b828 100644
--- a/select.lua
+++ b/select.lua
@@ -73,10 +73,8 @@ function Text.mouse_pos(State)
     return State.screen_top1.line, State.screen_top1.pos
   end
   for line_index,line in ipairs(State.lines) do
-    if line.mode == 'text' then
-      if Text.in_line(State, line_index, x,y) then
-        return line_index, Text.to_pos_on_line(State, line_index, x,y)
-      end
+    if Text.in_line(State, line_index, x,y) then
+      return line_index, Text.to_pos_on_line(State, line_index, x,y)
     end
   end
   return State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
@@ -157,9 +155,7 @@ function Text.selection(State)
   assert(minl < maxl)
   local result = {State.lines[minl].data:sub(min_offset)}
   for i=minl+1,maxl-1 do
-    if State.lines[i].mode == 'text' then
-      table.insert(result, State.lines[i].data)
-    end
+    table.insert(result, State.lines[i].data)
   end
   table.insert(result, State.lines[maxl].data:sub(1, max_offset-1))
   return table.concat(result, '\n')