← Back to team overview

papercuts-ninja team mailing list archive

[Bug 318517] Re: Word wrapping is not respecting indentation

 

The following is copied from the Upstream Bug:

Ignacio Casal Quinteiro (nacho) [gtksourceview developer] 2012-12-04
17:15:42 UTC

Here are some find outs from a quick research that I made today.
First of all we need to touch almost all the layers to have this working, so if
somebody is brave enough to make it here are the steps:

1) Get the size of a tab "\t" from the gtktextlayout.c. For this we can either
check if there is a way to get it from the pango layout or we could as well
move the tab-width property from GtkSourceView to GtkTextView.

2) From the gtktextlayout.c we need to detect the indentation of the paragraph,
counting the number of tabs and get the size in a pango scale.

3) For that layout we need to set the indentation level for the wrapped text.
For this we can already do it by setting a negative value to the pango layout
indent value (i.e set_indent(-20)). Although I think the right thing to do here
is to set a new set/get_indent_wrapped_text, which will do the same as the
indent value but just for the wrapped text.

4) We need to add a setting into gedit, either in the preferences dialog or at
this point it could be easily done with a plugin. (A setting in the dialog I
think it would be better though).

So if somebody wants to have some fun feel free to go fixing each of those
steps, and if you have any question we are like always in the irc channel
spotted in the previous comment.

** Changed in: hundredpapercuts
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Paper
Cuts Ninja, which is a bug assignee.
https://bugs.launchpad.net/bugs/318517

Title:
  Word wrapping is not respecting indentation

Status in Light-Weight Text Editor for Gnome:
  New
Status in One Hundred Paper Cuts:
  Triaged
Status in “gedit” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: gedit

  When wrapping a line it would be awesome to have gedit indent the
  wrapped line just like the original line.

  Imagine "_" being a space character, the current wrapping works like
  this

  ____hello hello hello hello hello
  hello hello hello

  It would be better if it worked like this:

  ____hello hello hello hello hello
  ____hello hello hello

  While editing this makes code-indentation readable even if the editing
  window is resized to be very narrow. It is also very helpful for
  unavoidable long lines, like regexps or URLs. It makes formatting less
  of a pain with generated code. etc etc etc

  KDE editor component and Eclipse both have this behaviour, it was also
  present in the famous EditPlus editor for Windows.

  I am sure i am not the first person requesting this feature, so i
  wonder if there is a philosophical stance against this wrapping style
  or if a plugin is available to handle it.

  ProblemType: Bug
  Architecture: i386
  Date: Sun Jan 18 20:17:05 2009
  DistroRelease: Ubuntu 8.04
  ExecutablePath: /usr/bin/gedit
  Package: gedit 2.22.3-0ubuntu1
  PackageArchitecture: i386
  ProcEnviron:
   PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
   LANG=de_DE.UTF-8
   SHELL=/bin/bash
  SourcePackage: gedit
  Uname: Linux 2.6.24-23-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/318517/+subscriptions