[gnote] Fix bullet not removed on delete key
- From: Aurimas Černius <aurimasc src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnote] Fix bullet not removed on delete key
 
- Date: Thu, 18 Sep 2014 16:36:02 +0000 (UTC)
 
commit e4bf4e338884bc96633ab117435b7698376ab11f
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Thu Sep 18 19:34:05 2014 +0300
    Fix bullet not removed on delete key
    
    Press delete key at line end on non-bulleted line, when next line is
    bulletted. Lines should be joined with bullet removed.
 src/notebuffer.cpp |    7 ++++++-
 src/notebuffer.hpp |    1 +
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/notebuffer.cpp b/src/notebuffer.cpp
index 99f4f0a..62fdf8c 100644
--- a/src/notebuffer.cpp
+++ b/src/notebuffer.cpp
@@ -239,6 +239,11 @@ namespace gnote {
   {
     Glib::RefPtr<Gtk::TextMark> insert_mark = get_insert();
     Gtk::TextIter iter = get_iter_at_mark(insert_mark);
+    return is_bulleted_list_active(iter);
+  }
+
+  bool NoteBuffer::is_bulleted_list_active(Gtk::TextIter iter)
+  {
     iter.set_line_offset(0);
 
     Glib::RefPtr<Gtk::TextTag> depth = find_depth_tag(iter);
@@ -555,7 +560,7 @@ namespace gnote {
     else if (start.ends_line() && start.get_line() < get_line_count()) {
       Gtk::TextIter next = get_iter_at_line (start.get_line() + 1);
       end_iter = start;
-      if(is_bulleted_list_active()) {
+      if(is_bulleted_list_active() || is_bulleted_list_active(next)) {
         end_iter.forward_chars(3);
       }
       else {
diff --git a/src/notebuffer.hpp b/src/notebuffer.hpp
index 203fec8..8e68f65 100644
--- a/src/notebuffer.hpp
+++ b/src/notebuffer.hpp
@@ -82,6 +82,7 @@ public:
                       const Gtk::TextIter &,const Gtk::TextIter &);
   bool is_active_tag(const std::string & );
   bool is_bulleted_list_active();
+  bool is_bulleted_list_active(Gtk::TextIter iter);
   bool can_make_bulleted_list();
   bool add_tab();
   bool remove_tab();
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]